RedshiftMixin#

class specutils.spectra.spectrum_mixin.RedshiftMixin[source]#

Bases: object

Mixin to define properties and methods related to redshift and radial velocity that are common to Spectrum and SpectrumCollection.

Attributes Summary

radial_velocity

The radial velocity(s) of the objects represented by this spectrum.

redshift

The redshift(s) of the objects represented by this spectrum.

spectral_axis

Returns the SpectralCoord object.

Methods Summary

set_radial_velocity_to(radial_velocity)

This sets the radial velocity of the spectrum to be radial_velocity without changing the values of the spectral_axis.

set_redshift_to(redshift)

This sets the redshift of the spectrum to be redshift without changing the values of the spectral_axis.

shift_spectrum_to(*[, redshift, radial_velocity])

This shifts in-place the values of the spectral_axis, given either a redshift or radial velocity.

Attributes Documentation

radial_velocity#

The radial velocity(s) of the objects represented by this spectrum. May be scalar (if this spectrum’s flux is 1D) or vector. Note that the concept of “RV of a spectrum” can be ambiguous, so the interpretation is set to some extent by either the user, or operations (like template fitting) that set this attribute when they are run on a spectrum.

redshift#

The redshift(s) of the objects represented by this spectrum. May be scalar (if this spectrum’s flux is 1D) or vector. Note that the concept of “redshift of a spectrum” can be ambiguous, so the interpretation is set to some extent by either the user, or operations (like template fitting) that set this attribute when they are run on a spectrum.

spectral_axis#

Returns the SpectralCoord object.

Methods Documentation

set_radial_velocity_to(radial_velocity)[source]#

This sets the radial velocity of the spectrum to be radial_velocity without changing the values of the spectral_axis.

If you want to shift the spectral_axis based on this value, use shift_spectrum_to.

set_redshift_to(redshift)[source]#

This sets the redshift of the spectrum to be redshift without changing the values of the spectral_axis.

If you want to shift the spectral_axis based on this value, use shift_spectrum_to.

shift_spectrum_to(*, redshift=None, radial_velocity=None)[source]#

This shifts in-place the values of the spectral_axis, given either a redshift or radial velocity.

If you do not want to change the spectral_axis, use set_redshift_to or set_radial_velocity_to.