reproject_and_convolve#

niriss_tools.isophotal.reproject_and_convolve(ref_path, orig_images, psfs, out_dir, psf_target, oversample=3, save_unconvolved=True, new_wcs_kw=None, reproject_image_kw=None, psf_method='pypher', psf_match_kw=None, convolve_method='fft', new_names=None)[source]#

Align, reproject, and PSF match one or more images to a reference.

Parameters:
ref_pathPathLike

The path of the image to use as a reference. All other images will be matched to the North-aligned reprojection of this image, at the same pixel scale.

orig_imagesPathLike | list[PathLike]

The locations of one or more images, to be matched to the reference image.

psfsArrayLike | PathLike | None | list[ArrayLike | PathLike | None]

The corresponding PSF for each image in orig_image. If any PSF is None, the convolution step will be skipped for that image.

out_dirPathLike

The directory to which the output (reprojected and convolved) images will be written.

psf_targetArrayLike | PathLike

The PSF to which all of the input images will be matched. In most circumstances, this will be the PSF of ref_path, but it does not need to be (e.g. if matching to the resolution of a ground-based IFU).

oversampleint, optional

The factor by which the source and target PSF should be oversampled before computing the matching kernel, using scipy.ndimage.zoom. By default, oversample=3.

save_unconvolvedbool, optional

Whether the reprojected (but unconvolved) images should also be saved, by default True.

new_wcs_kwdict | None, optional

Any additional keyword arguments to pass through to gen_new_wcs, by default None.

reproject_image_kwdict | None, optional

Any additional keyword arguments to pass through to reproject_image, by default None.

psf_method{“pypher” or “photutils”}, optional

The method used to generate the PSF-matching homogenisation kernel, by default "pypher".

psf_match_kwdict | None, optional

Any additional keyword arguments to pass through to niriss_tools.isophotal.match_photutils or niriss_tools.isophotal.match_pypher, depending on psf_method. By default None.

convolve_method{“fft”, “direct”}, optional

The method used to convolve the reprojected images with the homogenisation kernel. By default "fft".

new_namesstr | list[str] | None, optional

The new base names for each original image, by default None.

Returns:
list[PathLike]

The paths corresponding to the convolved images.