From d62a13371870bf5f6e5fd69593d2fc63b275ad4e Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 6 Nov 2024 17:22:13 -0500 Subject: [PATCH] replace pipeline Step.__call__ use with run --- romancal/pipeline/exposure_pipeline.py | 22 +++++++++++----------- romancal/pipeline/mosaic_pipeline.py | 14 +++++++------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/romancal/pipeline/exposure_pipeline.py b/romancal/pipeline/exposure_pipeline.py index 6fb029620..3dde01e25 100644 --- a/romancal/pipeline/exposure_pipeline.py +++ b/romancal/pipeline/exposure_pipeline.py @@ -124,12 +124,12 @@ def process(self, input): log.info(f"Processing a WFI exposure {input_filename}") self.dq_init.suffix = "dq_init" - result = self.dq_init(input) + result = self.dq_init.run(input) if input_filename: result.meta.filename = input_filename - result = self.saturation(result) + result = self.saturation.run(result) # Test for fully saturated data if is_fully_saturated(result): @@ -155,16 +155,16 @@ def process(self, input): results.append(result) return results - result = self.refpix(result) - result = self.linearity(result) - result = self.dark_current(result) - result = self.rampfit(result) - result = self.assign_wcs(result) + result = self.refpix.run(result) + result = self.linearity.run(result) + result = self.dark_current.run(result) + result = self.rampfit.run(result) + result = self.assign_wcs.run(result) if result.meta.exposure.type == "WFI_IMAGE": - result = self.flatfield(result) - result = self.photom(result) - result = self.source_catalog(result) + result = self.flatfield.run(result) + result = self.photom.run(result) + result = self.source_catalog.run(result) tweakreg_input.append(result) log.info( f"Number of models to tweakreg: {len(tweakreg_input), n_members}" @@ -185,7 +185,7 @@ def process(self, input): # Now that all the exposures are collated, run tweakreg # Note: this does not cover the case where the asn mixes imaging and spectral # observations. This should not occur on-prem - result = self.tweakreg(results) + result = self.tweakreg.run(results) log.info("Roman exposure calibration pipeline ending...") diff --git a/romancal/pipeline/mosaic_pipeline.py b/romancal/pipeline/mosaic_pipeline.py index f34b8c53c..0276225fe 100644 --- a/romancal/pipeline/mosaic_pipeline.py +++ b/romancal/pipeline/mosaic_pipeline.py @@ -72,11 +72,11 @@ def process(self, input): if file_type == "asn": input = ModelLibrary(input, on_disk=self.on_disk) self.flux.suffix = "flux" - result = self.flux(input) + result = self.flux.run(input) self.skymatch.suffix = "skymatch" - result = self.skymatch(result) + result = self.skymatch.run(result) self.outlier_detection.suffix = "outlier_detection" - result = self.outlier_detection(result) + result = self.outlier_detection.run(result) # # check to see if the product name contains a skycell name & if true get the skycell record product_name = input.asn["products"][0]["name"] @@ -131,9 +131,9 @@ def process(self, input): wcs_file = asdf.open(self.resample.output_wcs) self.suffix = "i2d" self.output_file = input.asn["products"][0]["name"] - result = self.resample(result) + result = self.resample.run(result) self.sourcecatalog.output_file = self.output_file - result_catalog = self.sourcecatalog(result) + result_catalog = self.sourcecatalog.run(result) else: log.info("resampling a mosaic file is not yet supported") exit(0) @@ -141,9 +141,9 @@ def process(self, input): else: self.resample.suffix = "i2d" self.output_file = input.asn["products"][0]["name"] - result = self.resample(result) + result = self.resample.run(result) self.sourcecatalog.output_file = self.output_file - result_catalog = self.sourcecatalog(result) # noqa: F841 + result_catalog = self.sourcecatalog.run(result) # noqa: F841 self.suffix = "i2d" if input_filename: result.meta.filename = self.output_file