-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding QA recipe libraries for GNIRS and F2
- Loading branch information
1 parent
64acbc0
commit 998669d
Showing
2 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |