pyimcom.utils.piffutils

Functions

piff_to_legendre(psf_file, chipnum[, stamp_size, ...])

Convert a PSF file from piff to a Legendre polynomial expansion.

Module Contents

piff_to_legendre(psf_file, chipnum, stamp_size=128, oversamp=6, legendre_order=5, normbox=None)[source]

Convert a PSF file from piff to a Legendre polynomial expansion.

Parameters:
  • psf_file (str) – The path to the PSF file.

  • chipnum (int) – The sca/chip number at which to draw the PSF.

  • stamp_size (int, optional) – The size of the PSF stamp. Default is 128.

  • oversamp (int, optional) – The oversampling factor for the PSF stamp. Default is 6.

  • legendre_order (int, optional) – Polynomial order for Legendre polynomial expansion. Default is 5.

  • normbox (int, optional) – If given, normalizes the PSF to integrate to 1 in the specified box size (which may be different from the region size used in Piff; we envision it will be larger if the PSF has far wings that are not re-fit by Piff, e.g., from a physical model or fit to scattered light in stacked bright stars, etc.).

Returns:

coeffs – The coefficients of the Legendre polynomial expansion.

Return type:

np.ndarray of shape ((legendre order + 1)**2, stamp_size*oversamp, stamp_size*oversamp)