desihub / desispec

DESI spectral pipeline
BSD 3-Clause "New" or "Revised" License
35 stars 24 forks source link

create_petalnz_pdf(): look for redrock*fits instead of zmtl*fits #2151

Closed araichoor closed 8 months ago

araichoor commented 8 months ago

With this PR, the night_qacreate_petalnz_pdf() now parses the redrock*fits files to identify the processed petals, instead of the zmtl*fits file.

It addresses https://desisurvey.slack.com/archives/C01HNN87Y7J/p1703203812637849. I.e. when we archived+mtl-updated a tile, then realized a petal was bad, so we re-process the tile, with creating a "dummy" zmtl*fits file (but no redrock or other files). The create_petalnz_pdf() function was looking for zmtl*fits files to parse the existing petals. Here it would find the "dummy" zmtl*fits file, but then crash as there s no redrock*fits file.

I ve successfully run on night here: https://data.desi.lbl.gov/desi/users/raichoor/nightqa_dev/nightqa_v25/20231209/.

sbailey commented 8 months ago

Thanks for the quick fix. As a maintenance detail, I changed fn.replace('redrock', 'zmtl') to desispec.io.util.replace_prefix(fn, "redrock", "zmtl") which will replace only the prefix of the filename, but not other places where "redrock" might appear, e.g. in a SPECPROD="test_redrock" path.