fitsmgmt.io.load_ccd
fitsmgmt.io.load_ccd(
path,
extension=None,
trimsec=None,
ccddata=True,
use_wcs=True,
unit=None,
extension_uncertainty='UNCERT',
extension_mask='MASK',
extension_flags=None,
full=False,
key_uncertainty_type='UTYPE',
memmap=False,
**kwd,
)Load one FITS image, with optional uncertainty and mask extensions.
Parameters
path : path - like-
FITS file to load.
extension :int,str, or (str,int) = None-
FITS extension: a zero-based index, an
EXTNAMEstring, or an(EXTNAME, EXTVER)tuple.Noneselects the first extension with data. Default:None. trimsec :str= None-
FITS-style section to apply after loading the selected image. Default:
None. ccddata :bool= True-
Return
~astropy.nddata.CCDDatawhenTrue(default). WhenFalse, return only the image array unlessfull=True. use_wcs :bool= True-
Build the WCS with
~astropy.io.fits.getheaderinstead of Astropy’s CCDData reader. This keeps TPV WCS usable but can be slower. Used only for the Astropy/CCDData path. Default:True. unit :~astropy.units.Unit= None-
Override the image unit. If omitted,
BUNITis used when present; otherwise Astropy falls back to ADU. Used for CCDData loading only. full :bool= False-
Return
(data, unc, mask, flag)for raw loading, or(ccd, uncertainty, mask, flags)whenccddata=True. Missing extensions produceNone. Default:False. extension_uncertainty : extension selector orNone= 'UNCERT'-
Extensions used to initialize the corresponding CCDData components or raw arrays. Defaults are
"UNCERT","MASK", andNone. Flags are not supported by Astropy’s CCDData reader. extension_mask : extension selector orNone= 'UNCERT'-
Extensions used to initialize the corresponding CCDData components or raw arrays. Defaults are
"UNCERT","MASK", andNone. Flags are not supported by Astropy’s CCDData reader. extension_flags : extension selector orNone= 'UNCERT'-
Extensions used to initialize the corresponding CCDData components or raw arrays. Defaults are
"UNCERT","MASK", andNone. Flags are not supported by Astropy’s CCDData reader. key_uncertainty_type :str= 'UTYPE'-
Header key naming the uncertainty class. Used only for CCDData loading. Default:
"UTYPE". memmap :bool= False-
Whether Astropy should memory-map FITS data. Default:
False(the opposite of Astropy’s default configuration). ****kwd** : = {}-
Additional keywords passed to
~astropy.nddata.CCDData.readin the Astropy path. They are ignored by the directfitsiopath used whenccddata=Falseandfitsiois installed.
Returns
:~astropy.nddata.CCDData,~numpy.ndarray, or tuple-
The selected image, or the full tuple requested by
full.
Notes
When fitsio is installed and ccddata=False, the direct reader uses extension, trimsec, full, and the three extension selectors; WCS, unit, uncertainty-class, and memory-map options do not apply in that branch.