Skip to content

Commit

Permalink
make code more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
mcara committed Dec 3, 2024
1 parent d21754b commit d20777f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/stcal/resample/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -1445,12 +1445,16 @@ def update_time(self, model):
self._exptime_start.append(model["start_time"])
self._exptime_end.append(model["end_time"])

if (exposure_time := model["exposure_time"]) is not None:
self._total_exposure_time += exposure_time

t, success = get_tmeasure(model)
self._total_exposure_time += model["exposure_time"]
self._measurement_time_success.append(success)
self._total_measurement_time += t
if t is not None:
self._total_measurement_time += t

self._duration += model["duration"]
if (duration := model["duration"]) is not None:
self._duration += duration

def finalize_time_info(self):
""" Perform final computations for the total time and update relevant
Expand Down

0 comments on commit d20777f

Please sign in to comment.