Skip to content

cosmic_ray_remove_easyspec

Cosmic-ray (and optional gain) correction via CR_and_gain_corrections.

Category Cosmic-ray rejection
Backend easyspec - wraps the EasySpec reduction library (optional extra reduction)
Version 1.0.1
Reads -
Writes image

Parameters

Parameter Default Required Description
target_path None - Science FITS; falls back to ctx.image.
gain None - Detector gain (e-/ADU); null reads it from the FITS header.
gain_header_entry 'GAIN' - Header keyword for the gain when 'gain' is null.
readnoise None - Read noise (electrons); null reads it from the FITS header.
readnoise_header_entry 'RDNOISE' - Header keyword for the read noise when 'readnoise' is null.
sigclip 5.0 - Sigma threshold for cosmic-ray detection (easyspec default 5).

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("cosmic_ray_remove_easyspec", ctx, {
    "target_path": None,
    "gain": None,
    "gain_header_entry": "GAIN",
    "readnoise": None,
    "readnoise_header_entry": "RDNOISE",
    "sigclip": 5.0
})
spectro run cosmic_ray_remove_easyspec --input spectrum.fits \
  --param target_path=none \
  --param gain=none \
  --param gain_header_entry=GAIN \
  --param readnoise=none \
  --param readnoise_header_entry=RDNOISE \
  --param sigclip=5.0
{
  "tool": "cosmic_ray_remove_easyspec",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "target_path": null,
      "gain": null,
      "gain_header_entry": "GAIN",
      "readnoise": null,
      "readnoise_header_entry": "RDNOISE",
      "sigclip": 5.0
    }
  }
}

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

References

  • easyspec.cleaning.cleaning.CR_and_gain_corrections.
  • van Dokkum 2001, PASP 113, 1420 — L.A.Cosmic.