clip_cosmic_rays¶
Detect and replace cosmic-ray hits on ctx.image.
| Category | Cosmic-ray rejection |
| Backend | scipy - implemented here on top of scipy primitives |
| Version | 1.0.0 |
| Reads | ctx.image (an ImageFrame) |
| Writes | image, metrics.n_cosmic_rays |
L.A.Cosmic detects cosmic-ray cores by Laplacian edge detection and replaces the affected pixels with a local median. The fallback path uses a 3x3 median filter as the reference: any pixel whose excess over the median exceeds sigma standard deviations is replaced by that local median.
Parameters¶
| Parameter | Default | Required | Description |
|---|---|---|---|
sigma |
5.0 |
- | Detection threshold in noise units. |
gain |
1.0 |
- | Detector gain in electrons/ADU (used by L.A.Cosmic). |
readnoise |
6.0 |
- | Detector read noise in electrons (used by L.A.Cosmic). |
Use it¶
The CLI loads a single 1-D spectrum with --input; this algorithm needs
ctx.image (an ImageFrame). Run it from Python or as a step of a pipeline preset.
References¶
- van Dokkum 2001, PASP 113, 1420 — L.A.Cosmic
- McCully et al. — astroscrappy (https://github.com/astropy/astroscrappy)
Related algorithms¶
cosmic_ray_remove_easyspec- Cosmic-ray (and optional gain) correction viaCR_and_gain_corrections.