calculate_moments#
- muse.synthesis.utils.calculate_moments(
- spectrum,
- *,
- moment_dim='SG_xpixel',
- integration_name='flux',
- doppler_name='dopp_vel',
- vmax=None,
- vmask=None,
Compute the zeroth, first, and second moments from a spectrum.
- Parameters:
spectrum (
Dataset) – Input spectrum. Must carry a Doppler-velocity coordinate (km/s); runwavelength_to_dopplerfirst if you only have wavelengths.moment_dim (
str) – Spectral axis to integrate the line profile over, by default"SG_xpixel". The Doppler velocities used for the moments come from thedoppler_namecoordinate, which is normalized to km/s on entry.integration_name (
str) – Name of the variable to integrate overspectrum, by default"flux".doppler_name (
str) – Name of the Doppler-velocity coordinate inspectrum, by default"dopp_vel".vmax (
float|None) – Maximum absolute velocity (km/s) to include in the integration, by default None.vmask (
float|None) – Half-width (inSG_xpixel) of the window kept around the line peak, by default None. Only used together withvmax.
- Returns:
Dataset containing the moments.
- Return type: