stellar_long_slit¶
Long-slit stellar reduction from a raw 2-D frame with an arc lamp: geometric rectification, hot-pixel rejection, sky subtraction on both sides of the trace, aperture extraction, polynomial wavelength solution from the lamp identifications, continuum normalisation and BeSS export.
| 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¶
Sky fitted column by column on 10-row bands 4 rows away from the trace; aperture of +/- 6 rows; 3rd-order dispersion solution; continuum normalised on 6400-6500 Angstrom. Lamp identifications come from match_lamp_lines or reidentify_arc_features run on the lamp frame with the same geometry.
References¶
- Howell 2006, Handbook of CCD Astronomy, 2nd ed., ch. 5 - long-slit reduction
- Horne 1986, PASP 98, 609 - sky estimate from the rows flanking the trace
- Tody 1986, Proc. SPIE 627, 733 - IRAF identify / dispcor
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 |
|
slant_deg |
float | default 0.0 |
|
smile_radius |
float | default 0.0 |
|
reference_row |
int | required | row of the stellar trace |
lamp_pixels |
list | required | pixel_positions from match_lamp_lines |
lamp_wavelengths |
list | required | wavelengths_angstrom from match_lamp_lines |
object_name |
str | required | |
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 | subtract_sky_2d |
trace_row='${reference_row}', trace_half_width=6, sky_offset=4, sky_half_width=10 |
| 6 | extract_spectrum_sum |
dispersion_axis=1, half_width=6 |
| 7 | wavelength_calibrate_polynomial |
pixel_positions='${lamp_pixels}', wavelengths_angstrom='${lamp_wavelengths}', order=3 |
| 8 | normalize_to_region |
wave_lo=6400.0, wave_hi=6500.0 |
| 9 | export_fits_bess |
object_name='${object_name}', 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
# lamp_pixels: []
# lamp_wavelengths: []
# object_name: <object_name>
# instrument: <instrument>
# observer: <observer>
# site: <site>
# date_obs_utc: <date_obs_utc>
# exposure_seconds: 0.0
spectro pipeline stellar_long_slit --input spectrum.fits --profile profile.yaml
spectro preset show stellar_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, "lamp_pixels": [], "lamp_wavelengths": [], "object_name": "<object_name>", "instrument": "<instrument>", "observer": "<observer>", "site": "<site>", "date_obs_utc": "<date_obs_utc>", "exposure_seconds": 0.0}
pipeline = PipelineBuilder().from_preset("stellar_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": "stellar_long_slit",
"variables": {
"tilt_deg": 0.0,
"slant_deg": 0.0,
"smile_radius": 0.0,
"reference_row": 0,
"lamp_pixels": [],
"lamp_wavelengths": [],
"object_name": "<object_name>",
"instrument": "<instrument>",
"observer": "<observer>",
"site": "<site>",
"date_obs_utc": "<date_obs_utc>",
"exposure_seconds": 0.0
}
}
}