-
Notifications
You must be signed in to change notification settings - Fork 25
QA frame script #424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
QA frame script #424
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ba9e693
starting this branch
profxj 03b239d
working
profxj ea157b2
polishing
profxj 247c084
good to go (except a test)
profxj 17f2350
qa_frame advances
profxj 02d2b7c
more docs
profxj 3eee0b9
tests
profxj eaf6c78
changes and qa.rst fix
profxj 9492c4e
edits to SB
profxj 03010aa
reduce frame windows
profxj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,16 @@ | ||
#!/usr/bin/env python | ||
# | ||
# See top-level LICENSE.rst file for Copyright information | ||
# | ||
# -*- coding: utf-8 -*- | ||
|
||
""" | ||
This script generates QA related to a production | ||
""" | ||
|
||
import desispec.scripts.qa_frame as qa_frame | ||
|
||
|
||
if __name__ == '__main__': | ||
args = qa_frame.parse() | ||
qa_frame.main(args) |
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
|
@@ -13,6 +13,7 @@ Contents | |
pipeline.rst | ||
dev.rst | ||
coadd.rst | ||
qa.rst | ||
changes.rst | ||
api.rst | ||
|
||
|
This file contains hidden or 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,108 @@ | ||
.. _qa: | ||
|
||
***************** | ||
Quality Assurance | ||
***************** | ||
|
||
Overview | ||
======== | ||
|
||
The DESI spectroscopic pipeline includes a series of | ||
routines that monitor the quality of the pipeline products | ||
and may be used to inspect outputs across exposures, nights, | ||
or a full production. | ||
|
||
|
||
Scripts | ||
======= | ||
|
||
desi_qa_frame | ||
+++++++++++++ | ||
|
||
Generate the QA for an input frame file. | ||
The code can be written anywhere and the | ||
output is written to its "proper" location. | ||
|
||
usage | ||
----- | ||
|
||
Here is the usage:: | ||
|
||
usage: desi_qa_frame [-h] --frame_file FRAME_FILE [--reduxdir PATH] | ||
[--make_plots] | ||
|
||
Generate Frame Level QA [v1.0] | ||
|
||
optional arguments: | ||
-h, --help show this help message and exit | ||
--frame_file FRAME_FILE | ||
Frame filename. Full path is not required nor desired. | ||
--reduxdir PATH Override default path ($DESI_SPECTRO_REDUX/$SPECPROD) | ||
to processed data. | ||
--make_plots Generate QA figs too? | ||
|
||
|
||
examples | ||
-------- | ||
|
||
Generate the QA YAML file:: | ||
|
||
desi_qa_frame --frame_file=frame-r7-00000077.fits | ||
|
||
Generate the QA YAML file and figures:: | ||
|
||
desi_qa_frame --frame_file=frame-r7-00000077.fits --make_plots | ||
|
||
desi_qa_prod | ||
++++++++++++ | ||
|
||
This script is used to both generate and analyze the | ||
QA outputs for a complete production. | ||
|
||
usage | ||
----- | ||
|
||
Here is the usage:: | ||
|
||
usage: desi_qa_prod [-h] --specprod_dir SPECPROD_DIR | ||
[--make_frameqa MAKE_FRAMEQA] [--slurp] [--remove] | ||
[--clobber] [--channel_hist CHANNEL_HIST] | ||
|
||
Generate/Analyze Production Level QA [v1.2] | ||
|
||
optional arguments: | ||
-h, --help show this help message and exit | ||
--specprod_dir SPECPROD_DIR | ||
Path containing the exposures/directory to use | ||
--make_frameqa MAKE_FRAMEQA | ||
Bitwise flag to control remaking the QA files (1) and | ||
figures (2) for each frame in the production | ||
--slurp slurp production QA files into one? | ||
--remove remove frame QA files? | ||
--clobber clobber existing QA files? | ||
--channel_hist CHANNEL_HIST | ||
Generate channel histogram(s) | ||
|
||
|
||
|
||
frameqa | ||
------- | ||
|
||
One generates the frame QA, the YAML and/or figure files | ||
with the --make_frameqa flag:: | ||
|
||
desi_qa_prod --make_frameqa=1 # Generate all the QA YAML files | ||
desi_qa_prod --make_frameqa=2 # Generate all the QA figure files | ||
desi_qa_prod --make_frameqa=3 # Generate YAML and figures | ||
|
||
The optional --remove and --clobber flags can be used to remove/clobber | ||
the QA files. | ||
|
||
slurp | ||
----- | ||
|
||
By using the --slurp flag, one generates a full | ||
YAML file of all the QA outputs:: | ||
|
||
desi_qa_prod --slurp # Collate all the QA YAML files | ||
desi_qa_prod --slurp --remove # Collate and remove the individual files |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it appears that you could just directly jump to
i.e. no need to loop over
get_exposures(night)
if you already know the exposure number you are looking for. Unfortunately you do still need to loop over nights since we don't have a mapping from exposure -> night.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I still need to catch cases when the exposure folder exists
but not the frame file. Have done so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I prefer my way (headed back to it).
This way the error throws that the exposure folder was found
but no frame file in it.