equivalent_width

specutils.analysis.equivalent_width(spectrum, continuum=1, regions=None, mask_interpolation=<class 'specutils.manipulation.resample.LinearInterpolatedResampler'>)[source]

Computes the equivalent width of a region of the spectrum.

Applies to the whole spectrum by default, but can be limited to a specific feature (like a spectral line) if a region is given.

Parameters:
spectrumSpectrum1D

The spectrum object overwhich the equivalent width will be calculated.

regions: `~specutils.SpectralRegion` or list of `~specutils.SpectralRegion`

Region within the spectrum to calculate the equivalent width. If regions is None, computation is performed over entire spectrum.

continuum1 or Quantity, optional

Value to assume is the continuum level. For the special value 1 (without units), 1 in whatever the units of the spectrum.flux will be assumed, otherwise units are required and must be the same as the spectrum.flux.

mask_interpolationNone or LinearInterpolatedResampler

Interpolator class used to fill up the gaps in the spectrum’s flux array after an excise operation to ensure the mask shape can always be applied when the spectrum mask is not None. If set to None, the masked spectral bins are excised from the data without interpolation and the bin edges of the adjacent bins are extended to fill the gap.

Returns:
ewQuantity

Equivalent width calculation, in the same units as the spectrum’s spectral_axis.

Notes

To do a standard equivalent width measurement, the spectrum should be continuum-normalized to whatever continuum is before this function is called.