Skip to content

Commit

Permalink
set flux step status for each input
Browse files Browse the repository at this point in the history
  • Loading branch information
stscieisenhamer committed Mar 25, 2024
1 parent ea3faf2 commit 870a6bf
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions romancal/flux/flux_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ def process(self, input):
)

for model in input_models:
apply_flux_correction(model)
try:
apply_flux_correction(model)
model.meta.cal_step.flux = 'COMPLETE'
except ValueError:
model.meta.cal_step.flux = 'SKIPPED'

if single_model:
return input_models[0]
Expand Down Expand Up @@ -101,12 +105,9 @@ def apply_flux_correction(model):
# Check for units. Must be election/second. Otherwise, it is unknown how to
# convert.
if model.data.unit != LV2_UNITS:
log.debug(
"Input data is not in units of %s. Flux correction will not be done.",
LV2_UNITS,
)
log.debug("Input data units are %s", model.data.unit)
return
message = f'Input data units {model.data.unit} is not the expected units of %s. Flux correction will not be done.'
log.debug(message)
raise ValueError(message)

# Apply the correction
# The end goal in units is to have MJy/sr. The scale is in MJy/sr also.
Expand Down

0 comments on commit 870a6bf

Please sign in to comment.