solar_long_slit¶
Long-slit solar reduction from a raw 2-D frame: geometric rectification, hot-pixel rejection, band extraction (the Sun fills the slit), wavelength calibration on the Fraunhofer lines (no lamp needed), continuum normalisation and BeSS export. The instrument geometry and the exposure metadata are variables, so one profile per spectrograph serves every solar spectrum.
| Kind | reduction |
| Status | draft - draft: conventions still open for discussion |
| Version | 1.0.0 |
| Source | package:spectro-kernel-recipes |
| Requires | spectro-kernel >=0.7 |
Conventions¶
Extraction sums the brightest row +/- 40 rows; continuum normalised on 6400-6500 Angstrom; a 3rd-order dispersion solution on at least six Fraunhofer lines.
References¶
- Howell 2006, Handbook of CCD Astronomy, 2nd ed., ch. 5 - long-slit reduction
- Tody 1986, Proc. SPIE 627, 733 - the IRAF reduction tasks this chain mirrors
Variables¶
The instrument- or observer-dependent values. Provide them with a profile
file, --set name=value, or variables={...} in Python.
| Variable | Type | Required / default | Description |
|---|---|---|---|
tilt_deg |
float | default 0.0 |
slit tilt (deg); 0 = none |
slant_deg |
float | default 0.0 |
line slant (deg); 0 = none |
smile_radius |
float | default 0.0 |
smile radius (px); 0 = none |
reference_row |
int | required | row the geometry is measured on |
approx_wavelength_min_angstrom |
float | required | approximate wavelength of pixel 0 |
approx_dispersion_angstrom_per_pixel |
float | required | approximate dispersion |
instrument |
str | required | |
observer |
str | required | |
site |
str | required | |
date_obs_utc |
str | required | ISO-8601 start of exposure (UTC) |
exposure_seconds |
float | required |
Steps¶
| # | Algorithm | Parameters |
|---|---|---|
| 1 | correct_tilt_affine |
tilt_deg='${tilt_deg}' |
| 2 | correct_slant_affine |
slant_deg='${slant_deg}', pivot_row='${reference_row}' |
| 3 | correct_smile_polynomial |
reference_row='${reference_row}', smile_radius='${smile_radius}', polynomial_order=4 |
| 4 | outlier_rejection_mad_adaptive |
kernel_size=3, threshold=3.0 |
| 5 | extract_spectrum_sum |
dispersion_axis=1, half_width=40 |
| 6 | wavelength_calibration_solar |
approx_wavelength_min_angstrom='${approx_wavelength_min_angstrom}', approx_dispersion_angstrom_per_pixel='${approx_dispersion_angstrom_per_pixel}', poly_order=3, min_lines_for_fit=6 |
| 7 | normalize_to_region |
wave_lo=6400.0, wave_hi=6500.0 |
| 8 | export_fits_bess |
object_name='Sun', instrument='${instrument}', site='${site}', observer='${observer}', date_obs_utc='${date_obs_utc}', exposure_seconds='${exposure_seconds}', vhelio_kms=0.0 |
Run it¶
# profile.yaml holds your instrument values:
# tilt_deg: 0.0
# slant_deg: 0.0
# smile_radius: 0.0
# reference_row: 0
# approx_wavelength_min_angstrom: 0.0
# approx_dispersion_angstrom_per_pixel: 0.0
# instrument: <instrument>
# observer: <observer>
# site: <site>
# date_obs_utc: <date_obs_utc>
# exposure_seconds: 0.0
spectro pipeline solar_long_slit --input spectrum.fits --profile profile.yaml
spectro preset show solar_long_slit # variables and steps
from spectro_kernel import WorkContext
from spectro_kernel.pipeline import PipelineBuilder
variables = {"tilt_deg": 0.0, "slant_deg": 0.0, "smile_radius": 0.0, "reference_row": 0, "approx_wavelength_min_angstrom": 0.0, "approx_dispersion_angstrom_per_pixel": 0.0, "instrument": "<instrument>", "observer": "<observer>", "site": "<site>", "date_obs_utc": "<date_obs_utc>", "exposure_seconds": 0.0}
pipeline = PipelineBuilder().from_preset("solar_long_slit", variables).build()
result = pipeline.execute(ctx) # ctx holds the spectrum / frames
print(result.history[-1]) # pipeline:<name> vX.Y.Z + variables
{
"tool": "run_preset",
"arguments": {
"session_id": "<session_id>",
"preset_name": "solar_long_slit",
"variables": {
"tilt_deg": 0.0,
"slant_deg": 0.0,
"smile_radius": 0.0,
"reference_row": 0,
"approx_wavelength_min_angstrom": 0.0,
"approx_dispersion_angstrom_per_pixel": 0.0,
"instrument": "<instrument>",
"observer": "<observer>",
"site": "<site>",
"date_obs_utc": "<date_obs_utc>",
"exposure_seconds": 0.0
}
}
}