Skip to content

Commit

Permalink
Harden AP against NaNs in files from offline pipeline.
Browse files Browse the repository at this point in the history
  • Loading branch information
Planner committed Jan 29, 2023
1 parent 5a11542 commit 2a1d85d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ desisurvey change log
0.19.1 (unreleased)
-------------------

* No changes yet.
* Harden AP against NaNs in offline pipeline EFFTIMEs; zero such cases.

0.19.0 (2022-05-13)
-------------------
Expand Down
8 changes: 7 additions & 1 deletion py/desisurvey/scripts/collect_etc.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,13 @@ def update_donefrac_from_offline(exps, offlinefn):
offlinetimetypes = np.zeros(len(offline), dtype='U80')
offlinetimetypes[:] = 'DARK'
offlinetimetypes[mo] = timetypes
offline_eff_time = offline['EFFTIME_SPEC']
offline_eff_time = offline['EFFTIME_SPEC'].copy()
mbad = ~np.isfinite(offline_eff_time)
if np.any(mbad[mo]):
badrecords = offline[mo][mbad[mo]]
log.warning('SOME EXPOSURES HAVE NaN EFFTIME, USING ZERO!!')
log.warning(' '.join([str(x) for x in badrecords['TILEID']]))
offline_eff_time[mbad] = 0
if ((len(np.unique(exps['EXPID'])) != len(exps)) or
(len(np.unique(offline['EXPID'])) != len(offline))):
raise ValueError('weird duplicate EXPID in exps or offline')
Expand Down

0 comments on commit 2a1d85d

Please sign in to comment.