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); run wavelength_to_doppler first 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 the doppler_name coordinate, which is normalized to km/s on entry.

  • integration_name (str) – Name of the variable to integrate over spectrum, by default "flux".

  • doppler_name (str) – Name of the Doppler-velocity coordinate in spectrum, 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 (in SG_xpixel) of the window kept around the line peak, by default None. Only used together with vmax.

Returns:

Dataset containing the moments.

Return type:

Dataset