diff --git a/CHANGES.rst b/CHANGES.rst index ce926ae34b..ad495e735a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -282,6 +282,9 @@ pipeline - Added a hook to skip ``photom`` step when the ``extract_1d`` step was skipped for NIRISS SOSS data [#8575]. + +- Added hook to the ``calwebb_tso3`` pipeline to skip all subsequent steps + if the ``extract_1d`` step is skipped. [#8583] pixel_replace ------------- diff --git a/jwst/pipeline/calwebb_tso3.py b/jwst/pipeline/calwebb_tso3.py index 91ad8b505d..703d4a937d 100644 --- a/jwst/pipeline/calwebb_tso3.py +++ b/jwst/pipeline/calwebb_tso3.py @@ -154,17 +154,19 @@ def process(self, input): x1d_result.int_times[row[0] - 1] = row # SOSS F277W may return None - don't bother with that - if result is not None: - if input_exptype == 'NIS_SOSS': - # SOSS data have yet to be photometrically calibrated - # Calibrate 1D spectra here. - result = self.photom(result) + if (result is None) or (result.meta.cal_step.extract_1d == "SKIPPED"): + continue - x1d_result.spec.extend(result.spec) + if input_exptype == 'NIS_SOSS': + # SOSS data have yet to be photometrically calibrated + # Calibrate 1D spectra here. + result = self.photom(result) - # perform white-light photometry on 1d extracted data - self.log.info("Performing white-light photometry ...") - phot_result_list.append(self.white_light(result)) + x1d_result.spec.extend(result.spec) + + # perform white-light photometry on 1d extracted data + self.log.info("Performing white-light photometry ...") + phot_result_list.append(self.white_light(result)) # Update some metadata from the association x1d_result.meta.asn.pool_name = input_models.meta.asn_table.asn_pool @@ -172,7 +174,11 @@ def process(self, input): # Save the final x1d Multispec model x1d_result.meta.cal_step.pixel_replace = state - self.save_model(x1d_result, suffix='x1dints') + if len(x1d_result.spec) == 0: + self.log.warning("extract_1d step could not be completed for any integrations") + self.log.warning("x1dints products will not be created.") + else: + self.save_model(x1d_result, suffix='x1dints') # Done with all the inputs input_models.close()