extract_spectrum_sum¶
Extract a 1D spectrum from ctx.image by summing across the trace.
| Category | Extraction (2-D to 1-D) |
| Backend | numpy - implemented here on top of numpy primitives |
| Version | 2.0.0 |
| Reads | ctx.image (an ImageFrame) |
| Writes | spectrum |
This is the simple unweighted sum: useful for bright targets and as a baseline. The resulting wavelength axis is in pixel indices — pass the spectrum through wavelength_calibrate_polynomial to convert to Ångström. Pixel convention: the axis is 0-based (numpy.arange(npix), first column = pixel 0), the same convention as extract_spectrum_boxcar / extract_spectrum_optimal / extract_spectrum_easyspec / extract_sky_lateral_bands and as the pixel positions returned by match_lamp_lines / reidentify_arc_features. v2.0.0: v1 produced a 1-based axis (arange + 1), so chaining it into match_lamp_lines → wavelength_calibrate_polynomial shifted the solution by one pixel (~ +0.9 Å at 0.9 Å/px); the axis is now 0-based like every other extractor.
Parameters¶
| Parameter | Default | Required | Description |
|---|---|---|---|
dispersion_axis |
1 |
- | Axis along which the spectrum disperses (1 = horizontal rows). |
half_width |
5 |
- | Half-width of the extraction window in spatial pixels. |
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¶
- Horne 1986, PASP 98, 609 — optimal extraction (variance-weighted variant).
Related algorithms¶
detect_trace- Detect the spectral trace onctx.imageand expose it onctx.extras["trace"].extract_sky_lateral_bands- Median-combine two off-trace sky bands into a 1D pixel-axis reference.extract_spectrum_boxcar- Trace (easyspec) + pure-numpy aperture extraction onctx.image.extract_spectrum_easyspec- Trace and extract a 1D spectrum from a 2D frame via easyspec.extract_spectrum_optimal- Optimal (Horne 1986) aperture extraction ofctx.image.