webbpsf_ext.image_manip.convolve_image

webbpsf_ext.image_manip.convolve_image(hdul_sci_image, hdul_psfs, return_hdul=False, output_sampling=None, crop_zeros=True)[source]

Convolve image with various PSFs

Takes an extended image, breaks it up into subsections, then convolves each subsection with the nearest neighbor PSF. The subsection sizes and locations are determined from PSF ‘sci’ positions.

Parameters
  • hdul_sci_image (HDUList) –

    Image to convolve. Requires header info of:
    • APERNAME : SIAF aperture that images is placed in

    • PIXELSCL : Pixel scale of image (arcsec/pixel)

    • OSAMP : Oversampling relative to detector pixels

    • CFRAME : Coordinate frame of image (‘sci’, ‘tel’, ‘idl’, ‘det’)

    • XCEN : Image x-position corresponding to aperture reference location

    • YCEN : Image y-position corresponding to aperture reference location

    • XIND_REF, YIND_REF : Alternative for (XCEN, YCEN)

  • hdul_psfs (HDUList) – Multi-extension FITS. Each HDU element is a different PSF for some location within some field of view. Must have same pixel scale as hdul_sci_image.

Keyword Arguments
  • return_hdul (bool) – Return as an HDUList, otherwise return as an image.

  • output_sampling (None or int) – Sampling output relative to detector. If None, then return same sampling as input image.

  • crop_zeros (bool) – For large images that are zero-padded, this option will first crop off the extraneous zeros (but accounting for PSF size to not tuncate resulting convolution at edges), then place the convolved subarray image back into a full frame of zeros. This process can improve speeds by a factor of a few, with no resulting differences. Should always be set to True; only provided as an option for debugging purposes.