basic_nddata_to_fits

astroimtools.nddata_adapters.basic_nddata_to_fits(nddata, filename, overwrite=False)[source]

Write a NDData object to a FITS file.

The NDData data will be saved in a FITS extension called ‘SCI’. This simple writer will also attempt to save the NDData uncertainty and mask to an ‘ERROR’ and ‘MASK’ FITS extension, respectively.

If present, the NDData meta dictionary will be stored as the FITS header.

Parameters:
nddataNDData

An NDData object to write to a FITS file.

filenamestr

The path of the output FITS file.

overwritebool, optional

Set to True to overwrite filename if it already exists. The default is False.