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 b6ac77a commit 9d8e8aa
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)

Check warning on line 92 in romancal/pipeline/exposure_pipeline.py

View check run for this annotation

Codecov / codecov/patch

romancal/pipeline/exposure_pipeline.py#L92

Added line #L92 was not covered by tests

# 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)

Check warning on line 96 in romancal/pipeline/exposure_pipeline.py

View check run for this annotation

Codecov / codecov/patch

romancal/pipeline/exposure_pipeline.py#L94-L96

Added lines #L94 - L96 were not covered by tests
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 9d8e8aa

Please sign in to comment.