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

Generate a CCDData object from a FITS file.

Parameters
filenamestr

Name of fits file.

hduint, optional

FITS extension from which CCDData should be initialized. If zero and and no data in the primary extension, it will search for the first extension with data. The header will be added to the primary header. 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'.

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.

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.