punchbowl.level1.psf#
Functions#
|
Build the PSF transform for Level 1 processing from a list of images. |
|
Create a varying PSF reflecting how a true circle looks in the mosaic image projection. |
|
Correct the PSF. |
|
Prefect Task to correct the PSF of an image. |
Module Contents#
- punchbowl.level1.psf.build_psf_transform(image_paths: list[str] | list[pathlib.Path], alpha: float = 0.7, epsilon: float = 0.515, target_sigma: float = 3.3, psf_size: int = 64) regularizepsf.ArrayPSFTransform[source]#
Build the PSF transform for Level 1 processing from a list of images.
- Parameters:
image_paths (List[str] | List[Path]) – images to use in building the PSF model
alpha (float) – alpha parameter of the PSF transform, see Coma Off It paper
epsilon (float) – epsilon parameter of the PSF transform, see Coma Off It paper
target_sigma (float) – the target sigma of the PSF model in pixels
psf_size (int) – size of the grid in the PSF model in pixels
- Returns:
the PSF transform that corresponds to the input images
- Return type:
ArrayPSFTransform
- punchbowl.level1.psf.generate_projected_psf(source_wcs: astropy.wcs.WCS, psf_width: int = 64, star_gaussian_sigma: float = 3.3 / 2.355) regularizepsf.ArrayPSF[source]#
Create a varying PSF reflecting how a true circle looks in the mosaic image projection.
- punchbowl.level1.psf.correct_psf(data: ndcube.NDCube, psf_transform: regularizepsf.ArrayPSFTransform, max_workers: int | None = None, saturation_threshold: float = 55000, saturation_dilation: int = 3, neighborhood_width: int = 7) ndcube.NDCube[source]#
Correct the PSF.
- Parameters:
data (NDCube) – The input image
psf_transform (ArrayPSFTransform) – The PSF transform that corresponds to the input images
max_workers (int | None) – The maximum number of concurrent processes to use when performing the PSF transform
saturation_threshold (float) – Pixels brighter than this threshold are filled with their neighborhood average before PSF correction and then refilled with the raw value after correction to avoid producing artifacts
saturation_dilation (int) – A nonnegative number of times to morphologically dilate the saturation mask before application
neighborhood_width (int) – An odd positive number indicating the size of the neighborhood used for filling saturated pixels
- Returns:
The corrected image
- Return type:
NDCube
- punchbowl.level1.psf.correct_psf_task(data_object: ndcube.NDCube, model_path: str | punchbowl.util.DataLoader | None = None, max_workers: int | None = None) ndcube.NDCube[source]#
Prefect Task to correct the PSF of an image.
- Parameters:
data_object (NDCube) – data to operate on
model_path (str) – path to the PSF model to use in the correction
max_workers (int) – the maximum number of worker threads to use
- Returns:
modified version of the input with the PSF corrected
- Return type:
NDCube