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_psf
ArrayLike|PathLike The source point spread function (PSF), passed as either an array or a path to a FITS file.
- target_psf
ArrayLike|PathLike The target PSF, which should be broader than the source. The shape and pixel scale of
source_psfandtarget_psfmust match.- out_path
PathLike|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_r
float, optional The regularisation parameter for the Wiener filter. By default,
pypher_r=3e-3; for further details seepypher.- oversample
int, 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.- pixscale
float, optional The pixel scale of the input PSFs, by default 0.04.
- tmp_dir
PathLike|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.
- source_psf
- Returns:
ArrayLikeThe homogenisation kernel. When convolved with
source_psf, this should reproducetarget_psf.