basic_fits_to_nddata

astroimtools.nddata_adapters.basic_fits_to_nddata(filename, exten=0)[source]

Read a single FITS extension into a NDData object.

This is an extremely simple reader that reads data from only a single FITS extension.

Note the the primary FITS header will always be included in the NDData meta dict, regardless of the value of exten.

Parameters:
filenamestr

The path to a FITS file.

extenint, optional

The FITS extension number for array to place in the NDData object. The default is 0.

Returns:
nddataNDData

An NDData object with a data attribute containing the FITS data array and a meta attribute, containing the FITS header as a python dict.