Skip to content

Commit

Permalink
replace pipeline Step.__call__ use with run
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed Nov 18, 2024
1 parent c92c48c commit d62a133
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
22 changes: 11 additions & 11 deletions romancal/pipeline/exposure_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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}"
Expand All @@ -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...")

Expand Down
14 changes: 7 additions & 7 deletions romancal/pipeline/mosaic_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -131,19 +131,19 @@ 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)

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
Expand Down

0 comments on commit d62a133

Please sign in to comment.