get_hdu#

get_hdu(input_, hdu_idx=_Unset.UNSET, concatenate_jwst_header=True)[source]#

Get an HDU object from a path, HDUList, or an HDU object.

Parameters:
  • input (str | Path | HDUList | ImageHDU | PrimaryHDU) – The input to get the HDU object from.

  • hdu_idx (int | _Unset, optional, default=_UNSET) – The index of the HDU object to get.

  • concatenate_jwst_header (bool, optional, default=True) – Whether to concatenate the header of the JWST primary HDU with the header of the image HDU if concatenate_jwst_header is True.

Returns:

hdu – The HDU object.

Return type:

ImageHDU | PrimaryHDU