fits_ccddata_reader#

astropy.nddata.fits_ccddata_reader(filename, hdu=0, unit=None, hdu_uncertainty='UNCERT', hdu_mask='MASK', hdu_flags=None, key_uncertainty_type='UTYPE', hdu_psf='PSFIMAGE', **kwd)[source]#

Generate a CCDData object from a FITS file.

Parameters:
filenamestr

Name of fits file.

hduint, str, tuple of (str, int), optional

Index or other identifier of the Header Data Unit of the FITS file from which CCDData should be initialized. If zero and no data in the primary HDU, it will search for the first extension HDU with data. The header will be added to the primary HDU. Default is 0.

unitUnit, optional

Units of the image data. If this argument is provided and there is a unit for the image in the FITS header (the keyword BUNIT is used as the unit, if present), this argument is used for the unit. Default is None.

hdu_uncertaintystr or None, optional

FITS extension from which the uncertainty should be initialized. If the extension does not exist the uncertainty of the CCDData is None. Default is 'UNCERT'.

hdu_maskstr or None, optional

FITS extension from which the mask should be initialized. If the extension does not exist the mask of the CCDData is None. Default is 'MASK'.

hdu_flagsstr or None, optional

Currently not implemented. Default is None.

key_uncertainty_typestr, optional

The header key name where the class name of the uncertainty is stored in the hdu of the uncertainty (if any). Default is UTYPE.

New in version 3.1.

hdu_psfstr or None, optional

FITS extension from which the psf image should be initialized. If the extension does not exist the psf of the CCDData is None.

kwd

Any additional keyword parameters are passed through to the FITS reader in astropy.io.fits; see Notes for additional discussion.

Notes

FITS files that contained scaled data (e.g. unsigned integer images) will be scaled and the keywords used to manage scaled data in astropy.io.fits are disabled.