cwitools.utils.match_hdu_type

cwitools.utils.match_hdu_type(fits_in, data, header)

Return a HDU or HDUList with data/header matching the type of the input

Parameters:
  • fits_in (HDU or HDUList) – An astropy ImageHDU, PrimaryHDU or HDUList.
  • data (numpy.ndarray) – The data for the new object
  • header (astropy FITS Header) – The header for the new object
Returns:

An object of the same type as the input, with the new data

and header.

Return type:

HDU/HDUList