scopesim.optics.image_plane_utils.add_imagehdu_to_imagehdu

scopesim.optics.image_plane_utils.add_imagehdu_to_imagehdu#

scopesim.optics.image_plane_utils.add_imagehdu_to_imagehdu(image_hdu: ImageHDU, canvas_hdu: ImageHDU, spline_order: int = 1, wcs_suffix: str = '', conserve_flux: bool = True) ImageHDU#

Re-project one fits.ImageHDU onto another fits.ImageHDU.

..assumption:: of equal grid coordinate lengths

Parameters:
  • image_hdu (fits.ImageHDU) – The ImageHDU which will be reprojected onto canvas_hdu

  • canvas_hdu (fits.ImageHDU) – The ImageHDU onto which the image_hdu should be projected. This must include a valid WCS

  • spline_order (int, optional) – Default is 1. The order of the spline interpolator used by the scipy.ndimage functions

  • wcs_suffix (str or WCS) – To determine which WCS to use. “” for sky HDUs and “D” for ImagePlane HDUs. Can also be astropy.wcs.WCS object.

  • conserve_flux (bool) – Default is True. Used when zooming and rotating to keep flux constant.

Returns:

canvas_hdu

Return type:

fits.ImageHDU