Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 27, 2023
1 parent a1daf63 commit eaed136
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
19 changes: 11 additions & 8 deletions romancal/pipeline/exposure_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@

# step imports
from romancal.assign_wcs import AssignWcsStep
#from romancal.associations.exceptions import AssociationNotValidError
#from romancal.associations.load_as_asn import LoadAsLevel2Asn

# from romancal.associations.exceptions import AssociationNotValidError
# from romancal.associations.load_as_asn import LoadAsLevel2Asn
from romancal.dark_current import DarkCurrentStep
from romancal.datamodels import ModelContainer
from romancal.dq_init import dq_init_step
from romancal.flatfield import FlatFieldStep
from romancal.jump import jump_step
Expand All @@ -24,7 +26,6 @@
from romancal.saturation import SaturationStep
from romancal.source_detection import SourceDetectionStep
from romancal.tweakreg import TweakRegStep
from romancal.datamodels import ModelContainer

from ..stpipe import RomanPipeline

Expand Down Expand Up @@ -151,14 +152,16 @@ def process(self, input):
result = self.jump(result)
result = self.rampfit(result)
result = self.assign_wcs(result)

if result.meta.exposure.type == "WFI_IMAGE":
result = self.flatfield(result)
result = self.photom(result)
result = self.source_detection(result)
if (file_type == "asn"):
if file_type == "asn":
tweakreg_input.append(result)
log.info(f"Number of models to tweakreg: {len(tweakreg_input._models), n_members}")
log.info(
f"Number of models to tweakreg: {len(tweakreg_input._models), n_members}"
)
else:
log.info("Flat Field step is being SKIPPED")
log.info("Photom step is being SKIPPED")
Expand All @@ -182,11 +185,11 @@ def process(self, input):
if file_type == "asdf":
mc_result = self.tweakreg([result])
result = mc_result._models.pop()
if file_type == "asn" :
if file_type == "asn":
result = self.tweakreg(tweakreg_input)

log.info("Roman exposure calibration pipeline ending...")

return results

def setup_output(self, input):
Expand Down
26 changes: 13 additions & 13 deletions romancal/regtest/test_wfi_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,19 +357,19 @@ def test_level2_grism_processing_pipeline(rtdata, ignore_asdf_paths):
assert model.meta.cal_step.saturation == "COMPLETE"

pipeline.log.info(
"DMS278 MSG: Testing WFI Level 2 Data Generation - Spectroscopy in Level 2 spectroscopic"
" output......." + passfail(model.meta.cal_step.dq_init == "COMPLETE") +
passfail(model.meta.cal_step.saturation == "COMPLETE" )+
passfail(model.meta.cal_step.refpix == "COMPLETE") +
passfail(model.meta.cal_step.linearity == "COMPLETE") +
passfail(model.meta.cal_step.jump == "COMPLETE") +
passfail(model.meta.cal_step.ramp_fit == "COMPLETE") +
passfail(model.meta.cal_step.assign_wcs == "COMPLETE") +
passfail(model.meta.cal_step.flat_field == "SKIPPED") +
passfail(model.meta.cal_step.photom == "SKIPPED") +
passfail(model.meta.cal_step.source_detection == "SKIPPED") +
passfail(model.meta.cal_step.tweakreg == "SKIPPED")

"DMS278 MSG: Testing WFI Level 2 Data Generation - Spectroscopy in Level 2 spectroscopic"
" output......."
+ passfail(model.meta.cal_step.dq_init == "COMPLETE")
+ passfail(model.meta.cal_step.saturation == "COMPLETE")
+ passfail(model.meta.cal_step.refpix == "COMPLETE")
+ passfail(model.meta.cal_step.linearity == "COMPLETE")
+ passfail(model.meta.cal_step.jump == "COMPLETE")
+ passfail(model.meta.cal_step.ramp_fit == "COMPLETE")
+ passfail(model.meta.cal_step.assign_wcs == "COMPLETE")
+ passfail(model.meta.cal_step.flat_field == "SKIPPED")
+ passfail(model.meta.cal_step.photom == "SKIPPED")
+ passfail(model.meta.cal_step.source_detection == "SKIPPED")
+ passfail(model.meta.cal_step.tweakreg == "SKIPPED")
)
assert model.meta.cal_step.dq_init == "COMPLETE"
assert model.meta.cal_step.saturation == "COMPLETE"
Expand Down

0 comments on commit eaed136

Please sign in to comment.