Skip to content

Commit 8df12b5

Browse files
committed
generalized loop for n exposures
1 parent 7f86222 commit 8df12b5

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

CHANGES.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ resample
3737
image shape and the bounding box both for ``SCI`` image as well as for the
3838
``ERR`` and ``VARIANCE_*`` images. [#7774]
3939

40-
- Update the following exposure time keywords according to JWST Keyword dictionary
41-
equations: XPOSURE (EFFEXPTM), EFFINTTM, DURATION and TELAPSE. [#7793]
40+
- Update the following exposure time keywords: XPOSURE (EFFEXPTM), EFFINTTM,
41+
DURATION and TELAPSE. [#7793]
4242

4343

4444
1.11.3 (2023-07-17)

jwst/resample/resample.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,11 +365,12 @@ def update_exposure_times(self, output_model):
365365
exposure_times = {'start': [], 'end': []}
366366
effinttm, duration = 0.0, 0.0
367367
for exposure in self.input_models.models_grouped:
368-
total_exposure_time += exposure[0].meta.exposure.exposure_time
369-
exposure_times['start'].append(exposure[0].meta.exposure.start_time)
370-
exposure_times['end'].append(exposure[0].meta.exposure.end_time)
371-
effinttm += exposure[0].meta.exposure.integration_time
372-
duration += exposure[0].meta.exposure.duration
368+
for n, _ in enumerate(exposure):
369+
total_exposure_time += exposure[n].meta.exposure.exposure_time
370+
exposure_times['start'].append(exposure[n].meta.exposure.start_time)
371+
exposure_times['end'].append(exposure[n].meta.exposure.end_time)
372+
effinttm += exposure[n].meta.exposure.integration_time
373+
duration += exposure[n].meta.exposure.duration
373374

374375
# Update some basic exposure time values based on output_model
375376
output_model.meta.exposure.exposure_time = total_exposure_time

0 commit comments

Comments
 (0)