diff --git a/CHANGES.rst b/CHANGES.rst index 94479e5c81..cf2e98f52a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -70,6 +70,9 @@ resample image shape and the bounding box both for ``SCI`` image as well as for the ``ERR`` and ``VARIANCE_*`` images. [#7774] +- Update the following exposure time keywords: XPOSURE (EFFEXPTM), + DURATION and TELAPSE. [#7793] + residual_fringe --------------- diff --git a/jwst/resample/resample.py b/jwst/resample/resample.py index 3b3b5d9eb5..45e739b72b 100644 --- a/jwst/resample/resample.py +++ b/jwst/resample/resample.py @@ -363,10 +363,12 @@ def update_exposure_times(self, output_model): """Modify exposure time metadata in-place""" total_exposure_time = 0. exposure_times = {'start': [], 'end': []} + duration = 0.0 for exposure in self.input_models.models_grouped: total_exposure_time += exposure[0].meta.exposure.exposure_time exposure_times['start'].append(exposure[0].meta.exposure.start_time) exposure_times['end'].append(exposure[0].meta.exposure.end_time) + duration += exposure[0].meta.exposure.duration # Update some basic exposure time values based on output_model output_model.meta.exposure.exposure_time = total_exposure_time @@ -374,6 +376,14 @@ def update_exposure_times(self, output_model): output_model.meta.exposure.end_time = max(exposure_times['end']) output_model.meta.resample.product_exposure_time = total_exposure_time + # Update other exposure time keywords: + # XPOSURE (identical to the total effective exposure time, EFFEXPTM) + xposure = total_exposure_time + output_model.meta.exposure.effective_exposure_time = xposure + # DURATION (identical to TELAPSE, elapsed time) + output_model.meta.exposure.duration = duration + output_model.meta.exposure.elapsed_exposure_time = duration + @staticmethod def drizzle_arrays(insci, inwht, input_wcs, output_wcs, outsci, outwht, outcon, uniqid=1, xmin=0, xmax=0, ymin=0, ymax=0,