OneDSpectrumMixin¶
-
class
specutils.spectra.spectrum_mixin.OneDSpectrumMixin[source]¶ Bases:
objectAttributes Summary
Converts the stored data and unit information into a quantity.
Returns a Quantity array with the values of the spectral axis.
Returns the units of the spectral axis.
Converts the spectral axis array to the given velocity space unit given the rest value.
Methods Summary
new_flux_unit(self, unit[, equivalencies, …])Converts the flux data to the specified unit.
with_spectral_unit(self, unit[, …])Returns a new spectrum with a different spectral axis unit.
with_velocity_convention(self, …)Attributes Documentation
-
flux¶ Converts the stored data and unit information into a quantity.
- Returns
QuantitySpectral data as a quantity.
-
rest_value¶
-
spectral_axis¶ Returns a Quantity array with the values of the spectral axis.
-
spectral_axis_unit¶ Returns the units of the spectral axis.
-
spectral_wcs¶
-
velocity¶ Converts the spectral axis array to the given velocity space unit given the rest value.
These aren’t input parameters but required Spectrum attributes
- Parameters
- unitstr or ~`astropy.units.Unit`
The unit to convert the dispersion array to.
- rest~`astropy.units.Quantity`
Any quantity supported by the standard spectral equivalencies (wavelength, energy, frequency, wave number).
- type{“doppler_relativistic”, “doppler_optical”, “doppler_radio”}
The type of doppler spectral equivalency.
- Returns
- ~`astropy.units.Quantity`
The converted dispersion array in the new dispersion space.
-
velocity_convention¶
Methods Documentation
-
new_flux_unit(self, unit, equivalencies=None, suppress_conversion=False)[source]¶ Converts the flux data to the specified unit. This is an in-place change to the object.
- Parameters
- unitstr or
Unit The unit to conver the flux array to.
- equivalencieslist of equivalencies
Custom equivalencies to apply to conversions. Set to spectral_density by default.
- suppress_conversionbool
Set to true if updating the unit without converting data values.
- unitstr or
- Returns
Spectrum1DA new spectrum with the converted flux array
-
with_spectral_unit(self, unit, velocity_convention=None, rest_value=None)[source]¶ Returns a new spectrum with a different spectral axis unit.
- Parameters
- unit
Unit Any valid spectral unit: velocity, (wave)length, or frequency. Only vacuum units are supported.
- velocity_convention‘relativistic’, ‘radio’, or ‘optical’
The velocity convention to use for the output velocity axis. Required if the output type is velocity. This can be either one of the above strings, or an
astropy.unitsequivalency.- rest_value
Quantity A rest wavelength or frequency with appropriate units. Required if output type is velocity. The spectrum’s WCS should include this already if the input type is velocity, but the WCS’s rest wavelength/frequency can be overridden with this parameter.
- unit
-