Spectrum#
- class sunkit_spex.spectrum.Spectrum(
- data,
- *,
- spectral_axis=None,
- spectral_axis_index=None,
- wcs=None,
- **kwargs,
Bases:
NDCubeSpectrum container for data which share a common spectral axis.
Note that “1D” in this case refers to the fact that there is only one spectral axis.
Spectrumcan contain ND data wheredatahave a shape with dimension greater than 1.Notes
A stripped down version of
Spectrum1Dfromspecutils.- Parameters:
data (
Quantity) – The data for this spectrum. This can be a simpleQuantity, or an existingSpectrumorNDCubeobject.uncertainty (
NDUncertainty) – Contains uncertainty information along with propagation rules for spectrum arithmetic. Can take a unit, but if none is given, will use the unit defined in the data.spectral_axis (
QuantityorSpectralAxis) – Dispersion information with the same shape as the dimension specified by spectral_axis_index or shape plus one if specifying bin edges.spectral_axis_index (
intdefault 0) – The dimension of the data which represents the spectral information default to first dimension index 0.mask (
ndarray-like) – Array where values in the flux to be masked are those thatastype(bool)converts to True. (For example, integer arrays are not masked where they are 0, and masked for any other value.)meta (dict) – Arbitrary container for any user-specific information to be carried around with the spectrum container object.
Examples
>>> import numpy as np >>> import astropy.units as u >>> from sunkit_spex.spectrum import Spectrum >>> spec = Spectrum(np.arange(1, 11)*u.watt,spectral_axis=np.arange(1, 12)*u.keV) >>> spec <sunkit_spex.spectrum.spectrum.Spectrum object at ... NDCube ------ Shape: (10,) Physical Types of Axes: [('em.energy',)] Unit: W Data Type: float64
Attributes Summary
Attributes Documentation
- spectral_axis#
- spectral_axis_index#