Skip to content

Commit

Permalink
move very slow test to it's own module
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed Jan 30, 2025
1 parent 86bdb84 commit 6d8364e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 32 deletions.
32 changes: 0 additions & 32 deletions jwst/regtest/test_niriss_soss.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,6 @@ def run_tso_spec3(rtdata_module, run_tso_spec2):
Step.from_cmdline(args)


@pytest.fixture(scope="module")
def run_atoca_extras(rtdata_module):
"""Run stage 2 pipeline on NIRISS SOSS data using enhanced modes via parameter settings."""
rtdata = rtdata_module

# Run spec2 pipeline on the second _rateints file, using wavegrid generated from first segment.
rtdata.get_data("niriss/soss/seg001_wavegrid.fits")
rtdata.get_data("niriss/soss/atoca_extras_rateints.fits")
args = ["calwebb_spec2", rtdata.input,
"--steps.extract_1d.soss_modelname=atoca_extras",
"--steps.extract_1d.soss_wave_grid_in=seg001_wavegrid.fits",
"--steps.extract_1d.soss_bad_pix=model",
"--steps.extract_1d.soss_rtol=1.e-3",
]
Step.from_cmdline(args)


@pytest.mark.bigdata
@pytest.mark.parametrize("suffix", ["calints", "flat_field", "srctype", "x1dints"])
def test_niriss_soss_stage2(rtdata_module, run_tso_spec2, fitsdiff_default_kwargs, suffix):
Expand Down Expand Up @@ -113,21 +96,6 @@ def test_niriss_soss_stage3_whtlt(run_tso_spec3, rtdata_module, diff_astropy_tab
assert diff_astropy_tables(rtdata.output, rtdata.truth)


@pytest.mark.bigdata
@pytest.mark.parametrize("suffix", ["calints", "x1dints", "AtocaSpectra", "SossExtractModel"])
def test_niriss_soss_extras(rtdata_module, run_atoca_extras, fitsdiff_default_kwargs, suffix):
"""Regression test of ATOCA enhanced algorithm performed on NIRISS SOSS data."""
rtdata = rtdata_module

output = f"atoca_extras_{suffix}.fits"
rtdata.output = output

rtdata.get_truth(f"truth/test_niriss_soss_stages/{output}")

diff = FITSDiff(rtdata.output, rtdata.truth, **fitsdiff_default_kwargs)
assert diff.identical, diff.report()


@pytest.fixture(scope='module')
def run_extract1d_null_order2(rtdata_module):
"""
Expand Down
36 changes: 36 additions & 0 deletions jwst/regtest/test_niriss_soss_extras.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import pytest
from astropy.io.fits.diff import FITSDiff

from jwst.stpipe import Step


@pytest.fixture(scope="module")
def run_atoca_extras(rtdata_module):
"""Run stage 2 pipeline on NIRISS SOSS data using enhanced modes via parameter settings."""
rtdata = rtdata_module

# Run spec2 pipeline on the second _rateints file, using wavegrid generated from first segment.
rtdata.get_data("niriss/soss/seg001_wavegrid.fits")
rtdata.get_data("niriss/soss/atoca_extras_rateints.fits")
args = ["calwebb_spec2", rtdata.input,
"--steps.extract_1d.soss_modelname=atoca_extras",
"--steps.extract_1d.soss_wave_grid_in=seg001_wavegrid.fits",
"--steps.extract_1d.soss_bad_pix=model",
"--steps.extract_1d.soss_rtol=1.e-3",
]
Step.from_cmdline(args)


@pytest.mark.bigdata
@pytest.mark.parametrize("suffix", ["calints", "x1dints", "AtocaSpectra", "SossExtractModel"])
def test_niriss_soss_extras(rtdata_module, run_atoca_extras, fitsdiff_default_kwargs, suffix):
"""Regression test of ATOCA enhanced algorithm performed on NIRISS SOSS data."""
rtdata = rtdata_module

output = f"atoca_extras_{suffix}.fits"
rtdata.output = output

rtdata.get_truth(f"truth/test_niriss_soss_stages/{output}")

diff = FITSDiff(rtdata.output, rtdata.truth, **fitsdiff_default_kwargs)
assert diff.identical, diff.report()

0 comments on commit 6d8364e

Please sign in to comment.