match_pypher#

niriss_tools.isophotal.match_pypher(source_psf, target_psf, out_path=None, pypher_r=0.003, oversample=3, pixscale=0.04, tmp_dir=None)[source]#

Create a PSF-matching kernel using pypher.

Parameters:
source_psfArrayLike | PathLike

The source point spread function (PSF), passed as either an array or a path to a FITS file.

target_psfArrayLike | PathLike

The target PSF, which should be broader than the source. The shape and pixel scale of source_psf and target_psf must match.

out_pathPathLike | None, optional

The path to which the output kernel should be saved. If None (default), the kernel will not be written to a file.

pypher_rfloat, optional

The regularisation parameter for the Wiener filter. By default, pypher_r=3e-3; for further details see pypher.

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.

pixscalefloat, optional

The pixel scale of the input PSFs, by default 0.04.

tmp_dirPathLike | None, optional

The temporary directory to which the intermediate files will be written. By default None, in which case the current working directory will be used.

Returns:
ArrayLike

The homogenisation kernel. When convolved with source_psf, this should reproduce target_psf.