centroid

specutils.analysis.centroid(spectrum, region)[source]

Calculate the centroid of a region, or regions, of the spectrum.

Parameters:
spectrum : Spectrum1D

The spectrum object overwhich the centroid will be calculated.

region: `~specutils.utils.SpectralRegion` or list of `~specutils.utils.SpectralRegion`

Region within the spectrum to calculate the centroid.

Returns:
centroid : float or list (based on region input)

Centroid of the spectrum or within the regions

Notes

The spectrum will need to be continuum subtracted before calling this method. See the analysis documentation for more information.