Skip to content

Commit

Permalink
adding QA recipe libraries for GNIRS and F2
Browse files Browse the repository at this point in the history
  • Loading branch information
KathleenLabrie committed Oct 25, 2022
1 parent 64acbc0 commit 998669d
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
54 changes: 54 additions & 0 deletions geminidr/f2/recipes/qa/recipes_LS_SPECT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"""
Recipes available to data with tags ['F2', 'SPECT', LS'].
Default is "reduceScience".
"""
recipe_tags = {'F2', 'SPECT', 'LS'}

def reduceScience(p):
"""
To be updated as development continues: This recipe processes F2 longslit
spectroscopic data, currently up to basic extraction (no telluric correction).
Parameters
----------
p : :class:`geminidr.f2.primitives_f2_longslit.F2Longslit`
"""
p.prepare()
p.addDQ()
p.nonlinearityCorrect() # non-linearity correction tbd even for gemini iraf
p.ADUToElectrons()
p.addVAR(poisson_noise=True, read_noise=True)
p.darkCorrect()
p.flatCorrect()
p.attachWavelengthSolution()
p.addToList(purpose='forSky')
p.getList(purpose='forSky')
p.separateSky()
p.associateSky()
p.skyCorrect()
p.distortionCorrect()
p.findApertures()
p.measureIQ(display=True)

# side stream to generate 1D spectra from individual frame, pre-stack
p.traceApertures(outstream='prestack')
p.extractSpectra(stream='prestack')
p.plotSpectraForQA(stream='prestack')
# The GUI polls for new data every 3 seconds. The next steps can be
# quicker than that leading to the second plotSpectra to hijack this one.
# Hijacking issues were highlighted in integration tests.
sleep(3)

# continuing with the main stream of 2D pre-stack
p.adjustWCSToReference()
p.resampleToCommonFrame()
p.stackFrames()
p.findApertures()
p.measureIQ(display=True)
p.traceApertures()
p.extractSpectra()
p.plotspectraForQA()


_default = reduceScience
53 changes: 53 additions & 0 deletions geminidr/gnirs/recipes/qa/recipes_LS_SPECT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
"""
Recipes available to data with tags ['GNIRS', 'SPECT', LS'].
Default is "reduceScience".
"""
recipe_tags = {'GNIRS', 'SPECT', 'LS'}

def reduceScience(p):
"""
To be updated as development continues: This recipe processes GNIRS longslit
spectroscopic data, currently up to basic spectral extraction without telluric correction.
Parameters
----------
p : :class:`geminidr.gnirs.primitives_gnirs_longslit.GNIRSLongslit`
"""
p.prepare()
p.addDQ()
# p.nonlinearityCorrect() # non-linearity correction tbd
p.ADUToElectrons()
p.addVAR(poisson_noise=True, read_noise=True)
p.flatCorrect()
p.attachWavelengthSolution()
p.addToList(purpose='forSky')
p.getList(purpose='forSky')
p.separateSky()
p.associateSky()
p.skyCorrect()
p.distortionCorrect()
p.findApertures()
p.measureIQ(display=True)

# side stream to generate 1D spectra from individual frame, pre-stack
p.traceApertures(outstream='prestack')
p.extractSpectra(stream='prestack')
p.plotSpectraForQA(stream='prestack')
# The GUI polls for new data every 3 seconds. The next steps can be
# quicker than that leading to the second plotSpectra to hijack this one.
# Hijacking issues were highlighted in integration tests.
sleep(3)

# continuing with the main stream of 2D pre-stack
p.adjustWCSToReference()
p.resampleToCommonFrame()
p.stackFrames()
p.findApertures()
p.measureIQ(display=True)
p.traceApertures()
p.extractSpectra()
p.plotSpectraForQA()


_default = reduceScience

0 comments on commit 998669d

Please sign in to comment.