Skip to content

mask_range

Flag every sample inside a wavelength window as masked.

Category Transforms
Backend numpy - implemented here on top of numpy primitives
Version 1.0.0
Reads ctx.spectrum (a Spectrum1D)
Writes spectrum, metrics.n_masked

Parameters

Parameter Default Required Description
wavelength_min None yes Lower bound of the range to mask (Å).
wavelength_max None yes Upper bound of the range to mask (Å).

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("mask_range", ctx, {
    "wavelength_min": "<value>",
    "wavelength_max": "<value>"
})
spectro run mask_range --input spectrum.fits \
  --param wavelength_min=<value> \
  --param wavelength_max=<value>
{
  "tool": "mask_range",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "wavelength_min": "<value>",
      "wavelength_max": "<value>"
    }
  }
}

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

  • clip_sigma - Remove outlier samples (cosmic rays, hot pixels) by iterative sigma clipping.
  • combine_spectra_arithmetic - Add, subtract, multiply or divide ctx.spectrum by a reference.
  • extract_region - Crop a spectrum to the wavelength window [wavelength_min, wavelength_max].