Skip to content

extract_region

Crop a spectrum to the wavelength window [wavelength_min, wavelength_max].

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

Parameters

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

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("extract_region", ctx, {
    "wavelength_min": "<value>",
    "wavelength_max": "<value>"
})
spectro run extract_region --input spectrum.fits \
  --param wavelength_min=<value> \
  --param wavelength_max=<value>
{
  "tool": "extract_region",
  "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.
  • mask_range - Flag every sample inside a wavelength window as masked.