2.5. Science Recipes
2.5.1. reduce
Process MAROON-X science echelle spectrum with tracing and extraction.
This recipe: (1) traces and identifies the fibers and orders using a 2D processed flat, (2) performs both regular (aka ‘box’) and optimal extraction to produce 1D extracted spectra, (3) computes a drift corrected wavelength solution for the science fibers, and (4) combines the science fibers and calculates the barycentric velocity correction. The result is stored on disk with a “_reduced” suffix.
Tracing and identifying fibers and orders is done on a (preferably background subtracted) 2D processed flat retrieved from the calibration database. During the stripe extraction a matching processed dark is subtracted from the science fibers, while the sim cal fiber gets its straylight removed instead.
Box extraction is the simple summation of all spatial pixels in a given fiber and order combination. Optimal extraction is by default only applied to the science fibers 2, 3 and 4.
The wavelength calibration fits the etalon lines of the sim cal fiber 5, loads the static wavelength solution from a lookup file, and applies a drift corrected solution to the science fibers by comparison with a processed wavecal etalon frame retrieved from the calibration database. The barycentric velocity correction is computed from the exposure meter flux-weighted timestamps and stored in header keywords.
Parameters
----------
p : Primitives object
A primitive set matching the recipe_tags.
def reduce(p):
p.prepare()
p.checkArm()
p.addDQ() # just placeholder until MX is in caldb
p.overscanCorrect()
p.correctImageOrientation()
p.addVAR(read_noise=True, poisson_noise=True)
p.extractStripes(dark_subtraction_skip_fibers=[5], straylight_removal_fibers=[5])
p.optimalExtraction()
p.getPeaksAndPolynomials(fibers=(5,))
p.staticWavelengthSolution()
p.applyWavelengthSolution(fibers=(2, 3, 4), ref_fiber=5)
p.combineFibers()
p.barycentricCorrection()
p.storeProcessedScience(suffix='_reduced')
2.5.2. makeSyntheticDark
Construct synthetic DDDDE darks for science exposures.
The per-pixel log-linear fit stored in a processed dark coefficients calibration, retrieved from the calibration database, is evaluated at the exposure time and ND filter setting of each science frame. This interpolates the empirical master darks to exposure times that were not directly observed. The synthetic dark is stored with a “_synth_dark” suffix.
Parameters
----------
p : Primitives object
A primitive set matching the recipe_tags.
def makeSyntheticDark(p):
p.prepare()
p.checkArm()
p.addVAR(read_noise=True, poisson_noise=True)
p.createSyntheticDark()
p.storeProcessedDark(suffix='_synth_dark')
2.5.3. applyBarycentricCorrection
Apply barycentric velocity correction to already reduced MAROON-X spectra.
Use this recipe to recompute the barycentric correction with target specific parameters (SIMBAD name, telescope coordinates, exposure meter zeropoints) after the main extraction workflow. The computed BERV values and timing information are stored as header keywords and the result is written with a “_barycor” suffix.
Parameters
----------
p : Primitives object
A primitive set matching the recipe_tags.
def applyBarycentricCorrection(p):
p.barycentricCorrection()
p.storeProcessedScience(suffix='_barycor')
2.5.4. exportReducedBundle
Bundle reduced Red and Blue arm spectra into a single output file.
Reverses the arm split performed by processBundle: the reduced Blue and Red arm files of the same observation are combined into one multi-extension bundle, which is stored with a “_reduced” suffix.
Parameters
----------
p : Primitives object
A primitive set matching the recipe_tags.
def exportReducedBundle(p):
p.separateArmStreams()
p.bundleArmStreams()
p.storeProcessedScience(suffix='_reduced')