diff --git a/CHANGES.rst b/CHANGES.rst index 14dffba59..2d3daac62 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,7 +1,12 @@ -0.16.2 (unreleased) +0.16.2 (2024-08-23) =================== -- +pipeline +-------- + +- Added ``suffix`` to the spec of ExposurePipeline with a + default value of ``cal``. Removed explicit setting of ``suffix`` + so that it can be passed as an argument to ``strun``. [#1378] 0.16.1 (2024-08-13) =================== diff --git a/README.md b/README.md index bc0eaae68..8cf41a1dc 100644 --- a/README.md +++ b/README.md @@ -169,6 +169,7 @@ an [issue](https://github.com/spacetelescope/romancal/issues). | 0.15.1 | 24Q3_B14 | 058 | May 2024 | Release for Build 24Q3_B14 (Build 14) | | 0.16.0 | 24Q4_B15 | 063 | Aug 2024 | Release for Build 24Q3_B15 (Build 15) | | 0.16.1 | 24Q4_B15 | 063 | Aug 2024 | Release for Build 24Q3_B15 (Build 15) | +| 0.16.2 | 24Q4_B15 | 063 | Aug 2024 | Release for Build 24Q3_B15 (Build 15) | Note: CRDS_CONTEXT values flagged with an asterisk in the above table are estimates diff --git a/romancal/pipeline/exposure_pipeline.py b/romancal/pipeline/exposure_pipeline.py index 0ba0aeafa..7e61969d0 100644 --- a/romancal/pipeline/exposure_pipeline.py +++ b/romancal/pipeline/exposure_pipeline.py @@ -47,6 +47,7 @@ class ExposurePipeline(RomanPipeline): spec = """ save_calibrated_ramp = boolean(default=False) save_results = boolean(default=False) + suffix = string(default="cal") """ # Define aliases to steps @@ -149,8 +150,6 @@ def process(self, input): ]: result.meta.cal_step[step_str] = "SKIPPED" - # Set suffix for proper output naming - self.suffix = "cal" results.append(result) return results @@ -177,9 +176,6 @@ def process(self, input): result.meta.cal_step.photom = "SKIPPED" result.meta.cal_step.source_detection = "SKIPPED" result.meta.cal_step.tweakreg = "SKIPPED" - self.suffix = "cal" - - self.setup_output(result) self.output_use_model = True results.append(result) @@ -193,10 +189,6 @@ def process(self, input): return results - def setup_output(self, input): - """Determine the proper file name suffix to use later""" - self.suffix = "cal" - def create_fully_saturated_zeroed_image(self, input_model): """ Create zeroed-out image file @@ -226,8 +218,5 @@ def create_fully_saturated_zeroed_image(self, input_model): ]: fully_saturated_model.meta.cal_step[step_str] = "SKIPPED" - # Set suffix for proper output naming - self.suffix = "cal" - # Return zeroed-out image file return fully_saturated_model diff --git a/romancal/regtest/test_wfi_pipeline.py b/romancal/regtest/test_wfi_pipeline.py index 72b6a4b9d..ad5a1e39e 100644 --- a/romancal/regtest/test_wfi_pipeline.py +++ b/romancal/regtest/test_wfi_pipeline.py @@ -517,7 +517,11 @@ def test_elp_input_dm(rtdata, ignore_asdf_paths): @pytest.mark.bigdata def test_processing_pipeline_all_saturated(rtdata, ignore_asdf_paths): - """Tests for fully saturated data skipping steps in the pipeline""" + """Tests for fully saturated data skipping steps in the pipeline + + Note that this test mimics how the pipeline is run in OPS. + Any changes to this test should be coordinated with OPS. + """ input_data = "r0000101001001001001_01101_0001_WFI01_ALL_SATURATED_uncal.asdf" rtdata.get_data(f"WFI/image/{input_data}") rtdata.input = input_data @@ -547,3 +551,47 @@ def test_processing_pipeline_all_saturated(rtdata, ignore_asdf_paths): assert model.meta.cal_step.assign_wcs == "SKIPPED" assert model.meta.cal_step.flat_field == "SKIPPED" assert model.meta.cal_step.photom == "SKIPPED" + + +@pytest.mark.bigdata +def test_pipeline_suffix(rtdata, ignore_asdf_paths): + """ + Tests passing suffix to the pipeline + + Note that this test mimics how the pipeline is run in OPS. + + Any changes to this test should be coordinated with OPS. + """ + input_data = "r0000101001001001001_01101_0001_WFI01_uncal.asdf" + rtdata.get_data(f"WFI/image/{input_data}") + + output = "r0000101001001001001_01101_0001_WFI01_star.asdf" + rtdata.output = output + + args = [ + "roman_elp", + rtdata.input, + "--steps.tweakreg.skip=True", + "--suffix=star", + ] + ExposurePipeline.from_cmdline(args) + rtdata.get_truth(f"truth/WFI/image/{output}") + + diff = compare_asdf(rtdata.output, rtdata.truth, **ignore_asdf_paths) + assert diff.identical, diff.report() + + # Ensure step completion is as expected + model = rdm.open(rtdata.output) + + assert model.meta.cal_step.dq_init == "COMPLETE" + assert model.meta.cal_step.saturation == "COMPLETE" + assert model.meta.cal_step.linearity == "COMPLETE" + assert model.meta.cal_step.dark == "COMPLETE" + assert model.meta.cal_step.jump == "COMPLETE" + assert model.meta.cal_step.ramp_fit == "COMPLETE" + assert model.meta.cal_step.assign_wcs == "COMPLETE" + assert model.meta.cal_step.flat_field == "COMPLETE" + assert model.meta.cal_step.photom == "COMPLETE" + assert model.meta.cal_step.source_detection == "COMPLETE" + assert model.meta.cal_step.tweakreg == "INCOMPLETE" + assert model.meta.filename == output