5. Primitives
This section documents all the primitives available in the MAROONX Data Reduction pipeline. These primitives are organized by functionality and processing stage.
Note
This document provides detailed information about each primitive method, including parameters, return values, and usage examples.
5.1. 2D Image Processing Primitives
Note
automodule commented out to avoid ReadTheDocs build timeout.
5.2. Echelle Extraction Primitives
5.3. Spectrum Processing Primitives
5.4. PDF Reports
Several primitives produce diagnostic PDF reports to help assess the quality of
each reduction step. Reports are enabled by default via the report boolean
parameter (default True) on each primitive and are written to the current
working directory. All plotting functions are defined in
maroonxdr/maroonx/maroonx_plots.py and use
matplotlib.backends.backend_pdf.PdfPages for PDF generation.
5.4.1. Primitives That Generate Reports
5.4.1.1. removeStrayLight
Source:
primitives_maroonx_2D.pyOutput:
{input}_backgroundfit.pdf(7 pages)Pages: raw frame, orders masked, background model (1st iteration), background subtracted, masked pixels per mesh cell, correction background model, final subtracted data
Called in:
makeProcessedFlatrecipePlotting function:
plot_backgroundfit()
5.4.1.2. fitAndApplyEtalonWls
Source:
primitives_maroonx_spectrum.pyOutput:
spline_[symmetrical_]{input}.pdfContent: etalon dispersion plots per fiber, wavelength solution residuals after spline fit
Called in:
makeDynamicWavecalrecipePlotting functions:
MXEchelleSpectrum.plot_etalon_dispersion()(method on spectrum object) andplot_residuals()
5.4.1.3. applyWavelengthSolution
Source:
primitives_maroonx_spectrum.pyOutput:
{input}_spline.pdfContent: calibration fiber offset measurements vs wavelength, per-order fit residuals, etalon residuals per fiber
Called in:
reducerecipe (ECHELLE_SPECT)Plotting functions:
plot_calibfiber_offset(),plot_etalon_residuals()
5.4.1.4. combineFibers
Source:
primitives_maroonx_spectrum.pyOutput:
{input}_fiber[6|7_symmetrical].pdfContent: one page per echelle order showing intensity comparison (fibers 2, 3, 4 + combined), sigma deviations from median, weights (1/variance), and SNR
Called in:
reducerecipe (ECHELLE_SPECT)Plotting function:
plot_fiber_combination()
5.4.1.5. barycentricCorrection
Source:
primitives_maroonx_spectrum.pyOutput:
{input}_exposuremeter.pdf(1 page)Content: dual-axis time series of PC and FRD exposure meter channels with exposure boundaries and zeropoints
Called in:
applyBarycentricCorrectionsub-recipePlotting function:
plot_exposuremeter()
5.4.2. Plotting Functions Reference
The following functions in maroonxdr/maroonx/maroonx_plots.py produce the
figures written into the PDF reports.
Function |
Description |
|---|---|
|
Returns a list of 7 Figures covering each stage of background fitting and subtraction. |
|
Returns 1 Figure with 3 subplots: residuals vs wavelength, residual RMS per order, and residuals vs normalized X position. |
|
Returns 1 Figure with 4 subplots: intensity, sigma deviations from median, weights (1/variance), and SNR. |
|
Returns 1 Figure with 3 subplots. Supports overlay mode via the |
|
Returns 1 Figure with 4 subplots. Supports incremental fill via the
|
|
Returns 1 Figure with dual y-axes (PC and FRD exposure meter channels). |
5.4.3. Disabling Reports
Reports can be disabled by passing report=False to any primitive. In a
custom recipe this is done directly:
p.removeStrayLight(report=False)
From the command line, use the DRAGONS parameter override system:
reduce @flats.list -p removeStrayLight:report=False