Skip to content

Commit

Permalink
Merge pull request #2120 from desihub/nightqa_v24
Browse files Browse the repository at this point in the history
Night_qa: get_surveys_night_expids() : protect against missing OBSTYPE keyword
  • Loading branch information
sbailey authored Sep 20, 2023
2 parents 7a17923 + 56fd73f commit 28fe73a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions py/desispec/night_qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ def get_surveys_night_expids(
expids, tileids, surveys = [], [], []
for i in range(len(fns)):
hdr = fitsio.read_header(fns[i], "SPEC")
# AR protect against corrupted exposures...
# AR see https://github.com/desihub/desispec/issues/2119
if "OBSTYPE" not in hdr:
log.warning("OBSTYPE keyword missing in {}; ignoring that exposure".format(fns[i]))
continue
if hdr["OBSTYPE"] == "SCIENCE":
survey = "unknown"
# AR look for the fiberassign file
Expand Down

0 comments on commit 28fe73a

Please sign in to comment.