Skip to content

Commit

Permalink
Catch the case of zero length event list in CheckforAddSimulatedWavec…
Browse files Browse the repository at this point in the history
…al (#210)
  • Loading branch information
stscirij authored Apr 6, 2022
1 parent 59c0c68 commit 5f10ea0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions calcos/calcos.py
Original file line number Diff line number Diff line change
Expand Up @@ -2640,6 +2640,10 @@ def CheckforAddSimulatedWavecal(self, association, wavecal_info, debug=False):
cosutil.printMsg("Cannot get events from data extension")
return False
f1.close()
if len(events) == 0:
if debug:
cosutil.printMsg("Don't add simulated wavecal as no events recorded")
return False
events_duration = time[-1] - time[0]
mintime = self.getMinTime(wcp_info)
if mintime is None:
Expand Down

0 comments on commit 5f10ea0

Please sign in to comment.