LowerDimensionalObject¶
- class spectral_cube.lower_dimensional_structures.LowerDimensionalObject(value: QuantityLike, unit=None, dtype=<class 'numpy.inexact'>, copy=True, order=None, subok=False, ndmin=0)[source]¶
Bases:
Quantity
,BaseNDClass
,HeaderMixinClass
Generic class for 1D and 2D objects.
Attributes Summary
Get a pure array representation of the LDO.
Get a pure
Quantity
representation of the LDO.Write this LowerDimensionalObject object out in the specified format.
Methods Summary
read
(*args, **kwargs)Copy of the numpy masked_array shrink_mask method.
to
(unit[, equivalencies, freq])Return a new
Projection
of the same class with the specified unit.Attributes Documentation
- array¶
Get a pure array representation of the LDO. Useful when multiplying and using numpy indexing tricks.
- hdu¶
- write¶
Write this LowerDimensionalObject object out in the specified format.
This allows easily writing a dataset in many supported data formats using syntax such as:
>>> data.write('data.fits', format='fits')
Get help on the available writers for LowerDimensionalObject using the``help()`` method:
>>> LowerDimensionalObject.write.help() # Get help writing LowerDimensionalObject and list supported formats >>> LowerDimensionalObject.write.help('fits') # Get detailed help on LowerDimensionalObject FITS writer >>> LowerDimensionalObject.write.list_formats() # Print list of available formats
See also: http://docs.astropy.org/en/stable/io/unified.html
- Parameters:
- *argstuple, optional
Positional arguments passed through to data writer. If supplied the first argument is the output filename.
- formatstr
File format specifier.
- **kwargsdict, optional
Keyword arguments passed through to data writer.
Methods Documentation
- shrink_mask()[source]¶
Copy of the numpy masked_array shrink_mask method. This is essentially a hack needed for matplotlib to show images.
- to(unit, equivalencies=[], freq=None)[source]¶
Return a new
Projection
of the same class with the specified unit.See
astropy.units.Quantity.to
for further details.