Skip to content

normalize_edges

Normalise a spectrum using a continuum fitted only on its line-free edges.

Category Continuum
Backend numpy - implemented here on top of numpy primitives
Version 1.0.1
Reads ctx.spectrum (a Spectrum1D)
Writes spectrum, metrics.continuum_median

Polynomial of degree order fitted through the outer edge_fraction of samples at each end, evaluated over the full axis and divided out. Non-finite (NaN/inf) edge samples are masked before the fit ; the brick fails when fewer than order + 2 finite edge samples remain. Uncertainties are divided by |continuum| like the flux.

Parameters

Parameter Default Required Description
edge_fraction 0.15 - Fraction of the spectrum, at each end, used to fit the continuum.
order 1 - Polynomial order of the edge continuum fit (1 = linear).

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("normalize_edges", ctx, {
    "edge_fraction": 0.15,
    "order": 1
})
spectro run normalize_edges --input spectrum.fits \
  --param edge_fraction=0.15 \
  --param order=1
{
  "tool": "normalize_edges",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "edge_fraction": 0.15,
      "order": 1
    }
  }
}

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

References

  • Tody 1986, Proc. SPIE 627, 733 — the IRAF data reduction and analysis system (continuum fitting with sample windows, onedspec.continuum).
  • Gray 2005, The Observation and Analysis of Stellar Photospheres, 3rd ed., Cambridge UP — ch. 12, continuum placement for line measurement.