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
Night qa: add 1200s morning dark #1947
Conversation
@akremin : with running a sanity test on 20210514, where there are no morning dark, I realize that the 300s dark exposure is not processed for that night (expid=88312). I am wondering: desispec/py/desispec/night_qa.py Lines 136 to 181 in b584b55
I relied on the processing_tables to say if I find something or not; ie here for 20210514, I consider there is no 300s dark image.
However, I could implement there the same logic that I did for the desispec/py/desispec/night_qa.py Lines 184 to 234 in b584b55
ie browse the exposure_tables instead to identify the dark image, and if it is not processed, then the code would process it on-the-fly.
Would that make sense? |
This looks great Anand. I wasn't sure but apparently the trick to set os.environ["SPECPROD"] works:
|
A few changes that I'll take care of: We should not hardcode a specific SPECPROD, even "daily". The standard night_qa runs with SPECPROD=daily already, and any testing in other productions should setup symlinks etc. (e.g. with copyprod) to have it pickup the correct nightly bias. I know that we've tripped on this before (running preproc outside of daily and being surprised that it was different due to getting the bias from $DESI_SPECTRO_CALIB instead of the nightlybias that doesn't exist in the test prod), but I think hardcoding a production name is even worse. Let's directly call Let's not have it also spawn processing for the afternoon 300s dark. In that case, the pipeline is supposed to have done it already, and if it really is missing I'd rather have QA tell us that rather than try to correct for it. This doesn't help us for past nights before the pipeline was processing the 300s dark by default, but in general I want to avoid having QA spawn significant processing that should be the responsibility of the pipeline. Post-Iron we can further update our workflow to have the regular pipeline process the last dark by default, but this is a pragmatic solution for now. |
test failures are due to "Big-endian buffer not supported on little-endian compiler" fixed in main via desimodel update. I re-ran a test night of nightqa with latest version of branch on perlmutter and it generated the morningdark*.pdf fine. Merging. |
Sorry I missed this Anand. For the record I agree with what Stephen said above. It's unfortunate for older nights, but we should leave it to the pipeline to do most/all of the processing. Otherwise this script will become too long and computationally intensive. |
This PR adds the 1200s morning dark (temporary) processing + plot to the night_qa.
It is a follow-up of this PR #1945 (also see this slack thread: https://desisurvey.slack.com/archives/C01HNN87Y7J/p1670887277610869).
The code looks for the latest 1200s dark image of the night.
As the 1200s morning dark are not currently processed by the daily pipeline, this PR script does the processing on-the-fly in a temporary folder, so that night_qa can generate the plots.
On a cori-haswell interactive node, it runs in 2min, so it should not make the
desi_night_qa
script too long to run.The call to
desi_preproc
is here:desispec/py/desispec/night_qa.py
Lines 481 to 488 in b584b55
@julienguy suggested: "Make sure to have the env. variable
SPECPROD=daily
set in order to use the nightly bias (and because of that this has to be run after the daily prod)."I am not super-certain of how the environment variables are propagated in such a call with
os.system(cmd)
.Please let me know if there is a better way to proceed here.
This is the test case for EXPID=157181 on 20221209:
All petals, camera here: morningdark-20221209.pdf
I then also added a "Morning DARK" section in the
nightqa-NIGHT.html
page; see for instance here:https://data.desi.lbl.gov/desi/users/raichoor/tmpdir/20221209/nightqa-20221209.html