hispecdrp.primitives.spectral_extraction.spectral_extraction_primitive
Classes
|
Extracts the 2D echelleogram into 1D spectra for each fiber and order. |
- class SpectralExtractionPrimitive(dataset=None, config=None, context=None, log_config=None, parent=None, **kwargs)[source]
Bases:
BasePrimitiveExtracts the 2D echelleogram into 1D spectra for each fiber and order. Pre-determined trace positions and profiles (for optimal extraction) must be provided.
TODO: Fix normalization to extend to effective infinity regardless of aperture size. Aperture size only determines fit window and we can round here.
- Parameters:
suffix (str) – Suffix to add to the output filename. Default is ‘specextract’.
method (str) –
- Extraction method to use. Options are:
box: Sum all pixels within a fixed aperture around the trace position.
optimal: Fit a 1D profile to the data.
cross_talk: Simultaneously fit 1D profiles for all fibers to account for cross-talk between fibers. Only applicable when multiple fibers are present.
extraction_aperture (float) – Size of the extraction aperture in pixels, centered on the trace position.
do_fibers (list[int] or None) – List of fiber numbers to extract. If None, all fibers will be extracted.
do_orders (list[int] or None) – List of order numbers to extract. If None, all orders will be extracted.
pix_range (tuple[int, int] or None) – Range of x pixels to extract. If None, the full range will be extracted.
- Returns:
output (datamodels.L1Model or list[datamodels.L1Model]) – Extracted spectra for each fiber and order.
- extract_box(input_model, output_model, tracepos_model, do_fibers, do_orders)[source]
- extract_cross_talk(input_model, output_model, tracepos_model, traceprof_model, do_fibers, do_orders)[source]
- extract_optimal(input_model, output_model, tracepos_model, traceprof_model, do_fibers, do_orders)[source]