Skip to content

Commit

Permalink
use create zeroed model
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed Nov 19, 2024
1 parent eb808f1 commit 34110c7
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions romancal/pipeline/exposure_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,28 +91,9 @@ def process(self, input):

result = self.saturation.run(result)

# Test for fully saturated data
if is_fully_saturated(result):
# Return fully saturated image file (stopping pipeline)
log.info("All pixels are saturated. Returning a zeroed-out image.")

# Set all subsequent steps to skipped
for step_str in [
"assign_wcs",
"flat_field",
"photom",
"dark",
"refpix",
"linearity",
"ramp_fit",
"tweakreg",
]:
result.meta.cal_step[step_str] = "SKIPPED"

# Stop at this point and returned only the first model
# as a list to match prior behavior
lib.shelve(result, 0)
return [result]
result = self.create_fully_saturated_zeroed_image(result)
else:
result = self.refpix.run(result)
result = self.linearity.run(result)
Expand Down Expand Up @@ -162,13 +143,13 @@ def create_fully_saturated_zeroed_image(self, input_model):

# Set all subsequent steps to skipped
for step_str in [
"linearity",
"refpix" "linearity",
"dark",
"ramp_fit",
"assign_wcs",
"flat_field",
"photom",
"tweakreg",
"source_catalog",
]:
fully_saturated_model.meta.cal_step[step_str] = "SKIPPED"

Expand Down

0 comments on commit 34110c7

Please sign in to comment.