Skip to content

Commit

Permalink
moved code for GMOS LS recipes to ql, and kept sq recipes by importin…
Browse files Browse the repository at this point in the history
…g those functions
  • Loading branch information
chris-simpson committed Oct 30, 2019
1 parent f17af4b commit 990c0e1
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 83 deletions.
Empty file.
26 changes: 26 additions & 0 deletions geminidr/gmos/recipes/ql/recipes_ARC_LS_SPECT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""
Recipes available to data with tags ['GMOS', 'SPECT', 'LS', 'ARC'].
These are GMOS longslit arc-lamp calibrations.
Default is "reduce".
"""
recipe_tags = set(['GMOS', 'SPECT', 'LS', 'ARC'])


def makeProcessedArc(p):
p.prepare()
p.addDQ(static_bpm=None)
p.addVAR(read_noise=True)
p.overscanCorrect()
p.biasCorrect()
p.ADUToElectrons()
p.addVAR(poisson_noise=True)
p.mosaicDetectors()
p.makeIRAFCompatible()
p.writeOutputs() # for now, to speed up diagnostics of the next step
p.determineWavelengthSolution()
p.determineDistortion()
p.storeProcessedArc()
p.writeOutputs()


_default = makeProcessedArc
24 changes: 24 additions & 0 deletions geminidr/gmos/recipes/ql/recipes_FLAT_LS_SPECT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""
Recipes available to data with tags ['GMOS', 'SPECT', 'LS', 'FLAT'].
These are GMOS longslit observations.
Default is "reduce".
"""
recipe_tags = set(['GMOS', 'SPECT', 'LS', 'FLAT'])


def makeProcessedFlat(p):
p.prepare()
p.addDQ(static_bpm=None)
p.addVAR(read_noise=True)
p.overscanCorrect()
p.biasCorrect()
p.ADUToElectrons()
p.addVAR(poisson_noise=True)
p.stackFrames()
p.normalizeFlat()
p.thresholdFlatfield()
p.makeIRAFCompatible()
p.storeProcessedFlat()


_default = makeProcessedFlat
60 changes: 60 additions & 0 deletions geminidr/gmos/recipes/ql/recipes_LS_SPECT.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
"""
Recipes available to data with tags ['GMOS', 'SPECT', 'LS'].
These are GMOS longslit observations.
Default is "reduce".
"""
recipe_tags = set(['GMOS', 'SPECT', 'LS'])


def reduce(p):
"""
todo: add docstring
Parameters
----------
p : :class:`geminidr.core.primitives_gmos_longslit.GMOSLongslit`
"""
p.prepare()
p.addDQ(static_bpm=None)
p.addVAR(read_noise=True)
p.overscanCorrect()
p.biasCorrect()
p.ADUToElectrons()
p.addVAR(poisson_noise=True)
p.flatCorrect()
p.distortionCorrect()
p.findSourceApertures()
p.skyCorrectFromSlit()
p.traceApertures()
p.extract1DSpectra()
p.linearizeSpectra()
p.writeOutputs()

def reduceStandard(p):
"""
todo: add docstring
Parameters
----------
p : :class:`geminidr.core.primitives_gmos_longslit.GMOSLongslit`
"""
p.prepare()
p.addDQ(static_bpm=None)
p.addVAR(read_noise=True)
p.overscanCorrect()
p.biasCorrect()
p.ADUToElectrons()
p.addVAR(poisson_noise=True)
p.flatCorrect()
p.distortionCorrect()
p.findSourceApertures(max_apertures=1)
p.skyCorrectFromSlit()
p.traceApertures()
p.extract1DSpectra()
p.linearizeSpectra() # TODO: needed?
p.calculateSensitivity()
p.writeOutputs()

_default = reduce
18 changes: 1 addition & 17 deletions geminidr/gmos/recipes/sq/recipes_ARC_LS_SPECT.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,6 @@
"""
recipe_tags = set(['GMOS', 'SPECT', 'LS', 'ARC'])


def makeProcessedArc(p):
p.prepare()
p.addDQ(static_bpm=None)
p.addVAR(read_noise=True)
p.overscanCorrect()
p.biasCorrect()
p.ADUToElectrons()
p.addVAR(poisson_noise=True)
p.mosaicDetectors()
p.makeIRAFCompatible()
p.writeOutputs() # for now, to speed up diagnostics of the next step
p.determineWavelengthSolution()
p.determineDistortion()
p.storeProcessedArc()
p.writeOutputs()

from ..ql.recipes_ARC_LS_SPECT import makeProcessedArc

_default = makeProcessedArc
16 changes: 1 addition & 15 deletions geminidr/gmos/recipes/sq/recipes_FLAT_LS_SPECT.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,6 @@
"""
recipe_tags = set(['GMOS', 'SPECT', 'LS', 'FLAT'])


def makeProcessedFlat(p):
p.prepare()
p.addDQ(static_bpm=None)
p.addVAR(read_noise=True)
p.overscanCorrect()
p.biasCorrect()
p.ADUToElectrons()
p.addVAR(poisson_noise=True)
p.stackFrames()
p.normalizeFlat()
p.thresholdFlatfield()
p.makeIRAFCompatible()
p.storeProcessedFlat()

from ..ql.recipes_FLAT_LS_SPECT import makeProcessedFlat

_default = makeProcessedFlat
52 changes: 1 addition & 51 deletions geminidr/gmos/recipes/sq/recipes_LS_SPECT.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,6 @@
"""
recipe_tags = set(['GMOS', 'SPECT', 'LS'])


def reduce(p):
"""
todo: add docstring
Parameters
----------
p : :class:`geminidr.core.primitives_gmos_longslit.GMOSLongslit`
"""
p.prepare()
p.addDQ(static_bpm=None)
p.addVAR(read_noise=True)
p.overscanCorrect()
p.biasCorrect()
p.ADUToElectrons()
p.addVAR(poisson_noise=True)
p.flatCorrect()
p.distortionCorrect()
p.findSourceApertures()
p.skyCorrectFromSlit()
p.traceApertures()
p.extract1DSpectra()
p.linearizeSpectra()
p.writeOutputs()

def reduceStandard(p):
"""
todo: add docstring
Parameters
----------
p : :class:`geminidr.core.primitives_gmos_longslit.GMOSLongslit`
"""
p.prepare()
p.addDQ(static_bpm=None)
p.addVAR(read_noise=True)
p.overscanCorrect()
p.biasCorrect()
p.ADUToElectrons()
p.addVAR(poisson_noise=True)
p.flatCorrect()
p.distortionCorrect()
p.findSourceApertures(max_apertures=1)
p.skyCorrectFromSlit()
p.traceApertures()
p.extract1DSpectra()
p.linearizeSpectra() # TODO: needed?
p.calculateSensitivity()
p.writeOutputs()
from ..ql.recipes_LS_SPECT import reduce, reduceStandard

_default = reduce

0 comments on commit 990c0e1

Please sign in to comment.