Skip to content

Commit

Permalink
Add dms tests
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamJamieson committed Nov 14, 2023
1 parent 3fb8783 commit bc0bb81
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions romancal/regtest/test_wfi_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from numpy.testing import assert_allclose

from romancal.assign_wcs.assign_wcs_step import AssignWcsStep
from romancal.lib.dqflags import pixel
from romancal.pipeline.exposure_pipeline import ExposurePipeline

from .regtestdata import compare_asdf
Expand All @@ -23,7 +24,7 @@ def passfail(bool_expr):

@pytest.mark.bigdata
@pytest.mark.soctests
@metrics_logger("DMS86", "DMS87", "DMS88")
@metrics_logger("DMS86", "DMS87", "DMS88", "DMS361")
def test_level2_image_processing_pipeline(rtdata, ignore_asdf_paths):
"""Tests for flat field imaging processing requirements DMS86 & DMS 87"""
input_data = "r0000101001001001001_01101_0001_WFI01_uncal.asdf"
Expand Down Expand Up @@ -92,6 +93,13 @@ def test_level2_image_processing_pipeline(rtdata, ignore_asdf_paths):
+ passfail(model.meta.cal_step.jump == "COMPLETE")
)
assert model.meta.cal_step.jump == "COMPLETE"
uneven = len({len(x) for x in model.meta.exposure.read_pattern}) > 1
pipeline.log.info(
"DMS361: Testing that jump detection detected jumps in uneven ramp in "
"Level 2 image output......."
+ passfail(uneven & np.any(model.dq & pixel["JUMP_DET"]))
)
assert uneven & np.any(model.dq & pixel["JUMP_DET"])
pipeline.log.info(
"Status of the step: linearity "
+ str(model.meta.cal_step.linearity)
Expand Down Expand Up @@ -258,7 +266,7 @@ def test_level2_image_processing_pipeline(rtdata, ignore_asdf_paths):

@pytest.mark.bigdata
@pytest.mark.soctests
@metrics_logger("DMS278", "DMS90", "DMS91", "DMS9")
@metrics_logger("DMS278", "DMS90", "DMS91", "DMS9", "DMS365")
def test_level2_grism_processing_pipeline(rtdata, ignore_asdf_paths):
"""Tests for flat field grism processing requirements DMS90, DMS91 & DMS 278"""
input_data = "r0000201001001001002_01101_0001_WFI01_uncal.asdf"
Expand Down Expand Up @@ -328,6 +336,13 @@ def test_level2_grism_processing_pipeline(rtdata, ignore_asdf_paths):
" output......." + passfail(model.meta.cal_step.jump == "COMPLETE")
)
assert model.meta.cal_step.jump == "COMPLETE"
uneven = len({len(x) for x in model.meta.exposure.read_pattern}) > 1
pipeline.log.info(
"DMS365: Testing that jump detection detected jumps in uneven ramp in "
"Level 2 image output......."
+ passfail(uneven & np.any(model.dq & pixel["JUMP_DET"]))
)
assert uneven & np.any(model.dq & pixel["JUMP_DET"])
pipeline.log.info(
"Status of the step: linearity "
+ str(model.meta.cal_step.assign_wcs)
Expand Down

0 comments on commit bc0bb81

Please sign in to comment.