regularizepsf.builder#

Functions for building PSF models from images.

Classes#

ArrayPSFBuilder

A builder that will take a series of images and construct an ArrayPSF to represent their implicit PSF.

Functions#

_convert_to_generator(→ collections.abc.Generator)

_scale_image(image, interpolation_scale)

_find_patches(image, star_threshold, star_mask, ...)

_find_matches(coordinate, x_bounds, y_bounds, psf_size)

_average_patches_by_mean(patches, corners, x_bounds, ...)

_average_patches_by_percentile(patches, corners, ...)

_average_patches(patches, corners[, method, percentile])

Module Contents#

regularizepsf.builder._convert_to_generator(images: list[pathlib.Path] | numpy.ndarray | collections.abc.Generator, hdu_choice: int | None = None) collections.abc.Generator#
regularizepsf.builder._scale_image(image, interpolation_scale)#
regularizepsf.builder._find_patches(image, star_threshold, star_mask, interpolation_scale, psf_size, i)#
regularizepsf.builder._find_matches(coordinate, x_bounds, y_bounds, psf_size)#
regularizepsf.builder._average_patches_by_mean(patches, corners, x_bounds, y_bounds, psf_size)#
regularizepsf.builder._average_patches_by_percentile(patches, corners, x_bounds, y_bounds, psf_size, percentile: float = 50)#
regularizepsf.builder._average_patches(patches, corners, method='mean', percentile: float = None)#
class regularizepsf.builder.ArrayPSFBuilder(psf_size: int)#

A builder that will take a series of images and construct an ArrayPSF to represent their implicit PSF.

Initialize an ArrayPSFBuilder.

_psf_size#
property psf_size#
build(images: list[str] | list[pathlib.Path] | numpy.ndarray | collections.abc.Generator, star_masks: list[str] | list[pathlib.Path] | numpy.ndarray | collections.abc.Generator | None = None, hdu_choice: int | None = 0, interpolation_scale: int = 1, star_threshold: int = 3, average_method: str = 'median', percentile: float = 50)#

Build the PSF model.

Parameters:

images (list[pathlib.Path] | np.ndarray | Generator) – images to use

Returns:

an array PSF and the counts of stars in each component

Return type:

(ArrayPSF, dict)