Skip to content

measure_radial_velocity

Measure a radial velocity from the Doppler shift of a single line.

Category Radial velocity
Backend scipy - implemented here on top of scipy primitives
Version 1.1.0
Reads ctx.spectrum (a Spectrum1D)
Writes metrics.radial_velocity_kms, line_fits

A positive velocity means the source is receding (redshift). For an absolute velocity, apply barycentric_correction to the spectrum first. profile='voigt' is slower but the right choice when neither pure Gaussian (Doppler-dominated) nor pure Lorentzian (collisionally-dominated) fits the data.

Parameters

Parameter Default Required Description
rest_wavelength_angstrom None yes Laboratory (rest) wavelength of the line in Å.
line_label None - Key of an existing fit in ctx.line_fits; null fits a new line.
window_angstrom 20.0 - Half-width of the fit window when fitting a new line (Å).
profile 'gaussian' - Line-profile model used when fitting a new centroid; one of ['gaussian', 'lorentzian', 'voigt'].

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("measure_radial_velocity", ctx, {
    "rest_wavelength_angstrom": "<value>",
    "line_label": None,
    "window_angstrom": 20.0,
    "profile": "gaussian"
})
spectro run measure_radial_velocity --input spectrum.fits \
  --param rest_wavelength_angstrom=<value> \
  --param line_label=none \
  --param window_angstrom=20.0 \
  --param profile=gaussian
{
  "tool": "measure_radial_velocity",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "rest_wavelength_angstrom": "<value>",
      "line_label": null,
      "window_angstrom": 20.0,
      "profile": "gaussian"
    }
  }
}

Every algorithm is an MCP tool of the same name; describe_algorithm returns this page's metadata as JSON.

References

  • Classical Doppler relation: v = c · (λ_obs − λ_rest) / λ_rest.
  • Line centroid via scipy.optimize.curve_fit on the selected profile (Gaussian / Lorentzian / Voigt — see fit_gaussian_line, fit_lorentzian_line, fit_voigt_line for the standalone bricks).
  • cross_correlate_rv - Measure radial velocity by cross-correlation against a template spectrum.
  • fit_keplerian_orbit - Fit a single-companion Keplerian RV curve to a velocity time series.
  • redshift_lines - Redshift z by per-line Gaussian fits against a list of rest-frame anchors.
  • rv_precision_bouchy - Compute the fundamental photon-noise limit on RV precision (Bouchy 2001).