Skip to content

Commit

Permalink
added stacking to GMOS LS QA and QL recipes, adjusted to match curren…
Browse files Browse the repository at this point in the history
…t integration tests.
  • Loading branch information
KathleenLabrie committed Aug 14, 2020
1 parent 0d1cc0c commit 62e9d43
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 12 deletions.
66 changes: 58 additions & 8 deletions geminidr/gmos/recipes/qa/recipes_LS_SPECT.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
recipe_tags = {'GMOS', 'SPECT', 'LS'}


def reduce(p):
def reduceScience(p):
"""
This recipe performs the standardization and corrections needed to
convert the raw input science images into a stacked image (TODO: stacking).
Expand All @@ -18,24 +18,74 @@ def reduce(p):
"""
p.prepare()
p.addDQ(static_bpm=None)
p.addDQ()
p.addVAR(read_noise=True)
p.overscanCorrect()
p.measureIQ(display=True)
p.biasCorrect()
p.ADUToElectrons()
p.addVAR(poisson_noise=True)
p.measureIQ(display=True)
p.flatCorrect()
p.QECorrect()
p.distortionCorrect()
# Some sort of stacking here, with addToList() etc
p.measureIQ(display=True)
p.findSourceApertures()
p.skyCorrectFromSlit()
p.traceApertures()
p.measureIQ(display=True)

# side stream to generate 1D spectra from individual frame, pre-stack
p.traceApertures(outstream='prestack')
p.extrac1DSpectra(instream='prestack', outstream='prestack')
p.fluxCalibrate(instream='prestack', outstream='prestack')
p.plotSpectraForQA(instream='prestack')

# continuing with main stream of 2D pre-stack.
p.addToList(purpose='forStack')
p.getList(purpose='forStack')
p.adjustWCSToReference()
p.resampleToCommonFrame()
p.stackFrames()
p.findSourceApertures()
p.measureIQ(display=True)
p.traceApertures()
p.extract1DSpectra()
p.linearizeSpectra()
p.fluxCalibrate()
p.plotSpectraForQA()
p.writeOutputs()


_default = reduce
_default = reduceScience


def reduceStandard(p):
"""
todo: add docstring
Parameters
----------
p : :class:`geminidr.gmos.primitives_gmos_longslit.GMOSLongslit`
"""
p.prepare()
p.addDQ()
p.addVAR(read_noise=True)
p.overscanCorrect()
p.measureIQ(display=True)
p.biasCorrect()
p.ADUToElectrons()
p.addVAR(poisson_noise=True)
p.flatCorrect()
p.QECorrect()
p.distortionCorrect()
p.findSourceApertures(max_apertures=1)
p.skyCorrectFromSlit()
p.measureIQ(display=True)
p.traceApertures()
p.extract1DSpectra()
p.plotSpectraForQA()
p.addToList(purpose='forStack')
p.getList(purpose='forStack')
p.resampleToCommonFrame()
p.stackFrames()
p.plotSpectraForQA()
p.calculateSensitivity()
p.storeProcessedStandard()
13 changes: 9 additions & 4 deletions geminidr/gmos/recipes/ql/recipes_LS_SPECT.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ def reduceScience(p):
p.flatCorrect()
p.QECorrect()
p.distortionCorrect()
p.writeOutputs()
p.findSourceApertures()
p.skyCorrectFromSlit()
p.adjustWCSToReference()
p.resampleToCommonFrame()
p.stackFrames()
p.findSourceApertures()
p.traceApertures()
p.storeProcessedScience()
p.extract1DSpectra()
p.linearizeSpectra()
p.fluxCalibrate()
p.writeOutputs()
p.linearizeSpectra()
p.storeProcessedScience()


Expand Down Expand Up @@ -60,8 +63,10 @@ def reduceStandard(p):
p.skyCorrectFromSlit()
p.traceApertures()
p.extract1DSpectra()
p.linearizeSpectra() # TODO: needed?
p.resampleToCommonFrame()
p.stackFrames()
p.calculateSensitivity()
#p.linearizeSpectra() # TODO: needed?
p.storeProcessedStandard()
p.writeOutputs()

Expand Down

0 comments on commit 62e9d43

Please sign in to comment.