fits_ccddata_writer#
- astropy.nddata.fits_ccddata_writer(ccd_data, filename, hdu_mask='MASK', hdu_uncertainty='UNCERT', hdu_flags=None, key_uncertainty_type='UTYPE', as_image_hdu=False, hdu_psf='PSFIMAGE', **kwd)[source]#
Write CCDData object to FITS file.
- Parameters:
- ccd_data
CCDData Object to write.
- filename
python:str Name of file.
- hdu_mask, hdu_uncertainty, hdu_flags, hdu_psf
python:strorpython:None, optional If it is a string append this attribute to the HDUList as
ImageHDUwith the string as extension name. For flags stored as aFlagCollection, each flag array will be saved as a separate ImageHDU with extension names of the formhdu_flags + '_' + flag_name. IfNonethis attribute is not appended. Default is'MASK'for mask,'UNCERT'for uncertainty,'PSFIMAGE'for psf, andNonefor flags.- key_uncertainty_type
python:str, optional The header key name for the class name of the uncertainty (if any) that is used to store the uncertainty type in the uncertainty hdu. Default is
UTYPE.Added in version 3.1.
- as_image_hdubool
If this option is
True, the first item of the returnedHDUListis aImageHDU, instead of the defaultPrimaryHDU.- kwd
All additional keywords are passed to
astropy.io.fits
- ccd_data
- Raises:
ValueErrorIf
self.maskis set but not andarray.If
self.uncertaintyis set but not aStdDevUncertainty.If
self.uncertaintyis set but has another unit thenself.data.If
self.flagsis set but not andarrayorFlagCollection.