Skip to content

equivalent_width

Measure a line's equivalent width without assuming a profile shape.

Category Line fitting
Backend numpy - implemented here on top of numpy primitives
Version 1.1.0
Reads ctx.spectrum (a Spectrum1D)
Writes metrics.equivalent_width_angstrom, metrics.equivalent_width_error_angstrom, metrics.equivalent_width_angstrom[label], metrics.equivalent_width_error_angstrom[label]

EW = ∫(1 − F/Fc) dλ over [centre − window, centre + window] with Fc a straight line through the outer continuum_fraction of the window on each side (trapezoidal integration on the actual wavelengths). metrics['equivalent_width_angstrom'] is kept as the flat key (last call wins) ; v1.1.0 also writes metrics['equivalent_width_angstrom[

Parameters

Parameter Default Required Description
line_center_angstrom None yes Line centre in Å (required).
window_angstrom 20.0 - Half-width of the integration window on each side (Å).
continuum_fraction 0.3 - Fraction of each window edge used to anchor the continuum.
label '' - Suffix for the per-label metric keys equivalent_width_angstrom[

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("equivalent_width", ctx, {
    "line_center_angstrom": "<value>",
    "window_angstrom": 20.0,
    "continuum_fraction": 0.3,
    "label": ""
})
spectro run equivalent_width --input spectrum.fits \
  --param line_center_angstrom=<value> \
  --param window_angstrom=20.0 \
  --param continuum_fraction=0.3 \
  --param label=
{
  "tool": "equivalent_width",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "line_center_angstrom": "<value>",
      "window_angstrom": 20.0,
      "continuum_fraction": 0.3,
      "label": ""
    }
  }
}

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

References

  • Vollmann & Eversberg 2006, Astron. Nachr. 327, 862 — statistical error of an equivalent width, Eq. 7: σ(EW) = √(1 + F̄c/F̄)·(Δλ − EW)/(S/N).
  • Gray 2005, The Observation and Analysis of Stellar Photospheres, 3rd ed., Cambridge UP — ch. 12, equivalent widths and continuum placement.
  • compare_line_fits - Fit one spectral line with every profile in turn and pick the best one.
  • fit_gaussian_line - Fit a single Gaussian (plus a linear continuum) to one spectral line.
  • fit_lorentzian_line - Fit a single Lorentzian (plus a linear continuum) to one spectral line.
  • fit_voigt_line - Fit a single Voigt profile (plus a linear continuum) to one spectral line.
  • vr_ratio - Violet/Red intensity ratio of a double-peaked emission line.