scopesim.optics.image_plane_utils.rescale_imagehdu

scopesim.optics.image_plane_utils.rescale_imagehdu#

scopesim.optics.image_plane_utils.rescale_imagehdu(imagehdu: ImageHDU, pixel_scale: float | Quantity, wcs_suffix: str = '', conserve_flux: bool = True, spline_order: int = 1) ImageHDU#

Scale the .data array by the ratio of pixel_scale [deg] and CDELTn.

pixel_scale should NOT be passed as a Quantity!

Parameters:
  • imagehdu (fits.ImageHDU)

  • pixel_scale (float or Quantity) – the desired pixel scale of the scaled ImageHDU, as applicable to the WCS identified by wcs_suffix (by default “ “). If float the units are assumed to be the same as CUNITa; if a Quantity, the unit need to be convertible.

  • wcs_suffix (str) – identifier of the WCS to use for rescaling, By default, this is “ “.

  • conserve_flux (bool)

  • spline_order (int) – [1..5] Order of the spline interpolation used by scipy.ndimage.rotate

Returns:

imagehdu

Return type:

fits.ImageHDU