NDData¶
-
class
astropy.nddata.NDData(data, uncertainty=None, mask=None, wcs=None, meta=None, unit=None)[source] [edit on github]¶ Bases:
astropy.nddata.NDDataBaseA basic class for array-based data.
The key distinction from raw numpy arrays is the presence of additional metadata such as uncertainties, a mask, units, and/or a coordinate system.
Parameters: data :
ndarray,ndarray-like, orNDDataThe actual data contained in this
NDDataobject. If possible, data will not be copied`data`, so you should make copy thedatabefore passing it in if that’s the desired behavior.uncertainty : any type, optional
Uncertainty on the data. The uncertainty must have a string attribute named
uncertainty_type, but there is otherwise no restriction.mask :
ndarray-like, optionalMask for the data. The values must be
Falsewhere the data is valid andTruewhen it is not (like Numpy masked arrays). Ifdatais a numpy masked array, providingmaskhere will causes the mask from the masked array to be ignored.wcs : undefined, optional
WCS-object containing the world coordinate system for the data.
meta :
dict-like object, optionalMetadata for this object. Must be dict-like but no further restriction is placed on meta.
unit :
UnitBaseinstance or str, optionalThe units of the data. If data is an
Quantitythenunitis set to the unit of the data; is a unit is also explicitly provided an error is raised.Notes
The data in a
NDDataobject should be accessed through the data attribute.For example:
>>> from astropy.nddata import NDData >>> x = NDData([1,2,3]) >>> x.data array([1, 2, 3])
Attributes Summary
datamaskmetaunitwcsAttributes Documentation
-
data¶
-
mask¶
-
meta¶
-
unit¶
-
wcs¶
-