Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rcal-457 Add test for spectral preview files #1021

Merged
merged 7 commits into from
Nov 21, 2023
44 changes: 44 additions & 0 deletions romancal/regtest/test_wfi_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
""" Roman tests for flat field correction """
import copy
import os
import subprocess

import numpy as np
import pytest
Expand Down Expand Up @@ -509,3 +511,45 @@ def test_processing_pipeline_all_saturated(rtdata, ignore_asdf_paths):
assert model.meta.cal_step.assign_wcs == "SKIPPED"
assert model.meta.cal_step.flat_field == "SKIPPED"
assert model.meta.cal_step.photom == "SKIPPED"


@pytest.mark.bigdata
@pytest.mark.soctests
@metrics_logger("DMS281")
def test_level2_image_preview(rtdata, ignore_asdf_paths):
"""Tests for flat field image preview requirements DMS 281"""
input_data = "r0000501001001001001_01101_0001_WFI01_cal.asdf"
rtdata.get_data(f"WFI/grism/{input_data}")
rtdata.input = input_data

# Test Pipeline
output = "r0000501001001001001_01101_0001_WFI01_cal_thumb.png"
rtdata.output = output
args = [
"roman_static_preview",
"thumbnail",
rtdata.input,
]
subprocess.run(args)
assert os.path.exists(rtdata.output) is True


@pytest.mark.bigdata
@pytest.mark.soctests
@metrics_logger("DMS278")
def test_level2_grism_preview(rtdata, ignore_asdf_paths):
"""Tests for flat field grism preview requirements DMS 278"""
input_data = "r0000501001001001001_01101_0001_WFI01_cal.asdf"
rtdata.get_data(f"WFI/grism/{input_data}")
rtdata.input = input_data

# Test Pipeline
output = "r0000501001001001001_01101_0001_WFI01_cal_thumb.png"
rtdata.output = output
args = [
"roman_static_preview",
"thumbnail",
rtdata.input,
]
subprocess.run(args)
assert os.path.exists(rtdata.output) is True