NDData¶
-
class
astropy.nddata.
NDData
(data, uncertainty=None, mask=None, wcs=None, meta=None, unit=None)[source] [edit on github]¶ Bases:
astropy.nddata.NDDataBase
A 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, orNDData
The actual data contained in this
NDData
object. If possible, data will not be copied`data`, so you should make copy thedata
before 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
False
where the data is valid andTrue
when it is not (like Numpy masked arrays). Ifdata
is a numpy masked array, providingmask
here 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 :
UnitBase
instance or str, optionalThe units of the data. If data is an
Quantity
thenunit
is set to the unit of the data; is a unit is also explicitly provided an error is raised.Notes
The data in a
NDData
object 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
data
mask
meta
unit
wcs
Attributes Documentation
-
data
¶
-
mask
¶
-
meta
¶
-
unit
¶
-
wcs
¶
-