NDIOMixin#
- class astropy.nddata.NDIOMixin[source]#
Bases:
object
Mixin class to connect NDData to the astropy input/output registry.
This mixin adds two methods to its subclasses,
read
andwrite
.Attributes Summary
Read and parse gridded N-dimensional data and return as an NDData-derived object.
Write this CCDData object out in the specified format.
Attributes Documentation
- read#
Read and parse gridded N-dimensional data and return as an NDData-derived object.
This function provides the NDDataBase interface to the astropy unified I/O layer. This allows easily reading a file in the supported data formats, for example:
>>> from astropy.nddata import CCDData >>> dat = CCDData.read('image.fits')
Get help on the available readers for
CCDData
using the``help()`` method:>>> CCDData.read.help() # Get help reading CCDData and list supported formats >>> CCDData.read.help('fits') # Get detailed help on CCDData FITS reader >>> CCDData.read.list_formats() # Print list of available formats
For more information see:
- Parameters:
- Returns:
- out
NDData
subclass NDData-basd object corresponding to file contents
- out
- write#
Write this CCDData object out in the specified format.
This function provides the NDData interface to the astropy unified I/O layer. This allows easily writing a file in many supported data formats using syntax such as:
>>> from astropy.nddata import CCDData >>> dat = CCDData(np.zeros((12, 12)), unit='adu') # 12x12 image of zeros >>> dat.write('zeros.fits')
Get help on the available writers for
CCDData
using the``help()`` method:>>> CCDData.write.help() # Get help writing CCDData and list supported formats >>> CCDData.write.help('fits') # Get detailed help on CCDData FITS writer >>> CCDData.write.list_formats() # Print list of available formats
For more information see: