Skip to content

Commit f6ba9c8

Browse files
committed
expand coverage for NIR instruments
1 parent af594d3 commit f6ba9c8

19 files changed

+229
-105
lines changed

jwst/regtest/test_miri_mrs_tso.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88
INPUT_PATH = 'miri/mrs'
99
TRUTH_PATH = 'truth/test_miri_mrs_tso'
1010

11+
# Mark all tests in this module
12+
pytestmark = [pytest.mark.bigdata]
13+
1114

1215
@pytest.fixture(scope='module')
13-
def run_spec2(rtdata_module):
16+
def run_spec2(rtdata_module, resource_tracker):
1417
"""Run the Spec2Pipeline on a single exposure"""
1518
rtdata = rtdata_module
1619

@@ -29,7 +32,12 @@ def run_spec2(rtdata_module):
2932
]
3033
# FIXME: Handle warnings properly.
3134
# Example: RuntimeWarning: invalid value encountered in add
32-
Step.from_cmdline(args)
35+
with resource_tracker.track():
36+
Step.from_cmdline(args)
37+
38+
39+
def test_log_tracked_resources_spec2(log_tracked_resources, run_spec2):
40+
log_tracked_resources()
3341

3442

3543
@pytest.mark.bigdata

jwst/regtest/test_nircam_dhs.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33

44
from jwst.stpipe import Step
55

6+
# Mark all tests in this module
7+
pytestmark = [pytest.mark.bigdata]
8+
69

710
@pytest.fixture(scope="module")
8-
def run_detector1pipeline(rtdata_module):
11+
def run_detector1pipeline(rtdata_module, resource_tracker):
912
"""Run calwebb_detector1 on NIRCam imaging long data"""
1013
rtdata = rtdata_module
1114
rtdata.get_data("nircam/dhs/sub164stripe4_dhs_mock_dark.fits")
@@ -23,10 +26,14 @@ def run_detector1pipeline(rtdata_module):
2326
"--steps.jump.save_results=True",
2427
"--steps.jump.rejection_threshold=50.0",
2528
]
26-
Step.from_cmdline(args)
29+
with resource_tracker.track():
30+
Step.from_cmdline(args)
31+
32+
33+
def test_log_tracked_resources_det1(log_tracked_resources, run_detector1pipeline):
34+
log_tracked_resources()
2735

2836

29-
@pytest.mark.bigdata
3037
@pytest.mark.parametrize("suffix", ["dq_init", "saturation", "superbias",
3138
"refpix", "linearity",
3239
"dark_current", "jump", "rate", "rateints"])

jwst/regtest/test_nircam_tsgrism.py

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,30 @@
55
from jwst.lib.set_telescope_pointing import add_wcs
66
from jwst.stpipe import Step
77

8+
# Mark all tests in this module
9+
pytestmark = [pytest.mark.bigdata]
10+
811

912
@pytest.fixture(scope="module")
10-
def run_pipelines(rtdata_module):
13+
def run_pipelines(rtdata_module, resource_tracker):
1114
"""Run stage 2-3 tso pipelines on NIRCAM TSO grism data."""
1215
rtdata = rtdata_module
1316

14-
# Run tso-spec2 pipeline on the _rateints file, saving intermediate products
15-
rtdata.get_data("nircam/tsgrism/jw01366002001_04103_00001-seg001_nrcalong_rateints.fits")
16-
args = ["calwebb_spec2", rtdata.input,
17-
"--steps.flat_field.save_results=True",
18-
"--steps.extract_2d.save_results=True",
19-
"--steps.srctype.save_results=True"
20-
]
21-
Step.from_cmdline(args)
22-
23-
# Get the level3 association json file (though not its members) and run
24-
# the tso3 pipeline on all _calints files listed in association
25-
rtdata.get_data("nircam/tsgrism/jw01366-o002_20230107t004627_tso3_00001_asn.json")
26-
args = ["calwebb_tso3", rtdata.input]
27-
Step.from_cmdline(args)
17+
with resource_tracker.track():
18+
# Run tso-spec2 pipeline on the _rateints file, saving intermediate products
19+
rtdata.get_data("nircam/tsgrism/jw01366002001_04103_00001-seg001_nrcalong_rateints.fits")
20+
args = ["calwebb_spec2", rtdata.input,
21+
"--steps.flat_field.save_results=True",
22+
"--steps.extract_2d.save_results=True",
23+
"--steps.srctype.save_results=True"
24+
]
25+
Step.from_cmdline(args)
26+
27+
# Get the level3 association json file (though not its members) and run
28+
# the tso3 pipeline on all _calints files listed in association
29+
rtdata.get_data("nircam/tsgrism/jw01366-o002_20230107t004627_tso3_00001_asn.json")
30+
args = ["calwebb_tso3", rtdata.input]
31+
Step.from_cmdline(args)
2832

2933
return rtdata
3034

@@ -41,7 +45,10 @@ def run_pipeline_offsetSR(request, rtdata_module):
4145
return rtdata
4246

4347

44-
@pytest.mark.bigdata
48+
def test_log_tracked_resources_pipelines(log_tracked_resources, run_pipelines):
49+
log_tracked_resources()
50+
51+
4552
def test_nircam_tsgrism_stage2_offsetSR(run_pipeline_offsetSR, fitsdiff_default_kwargs):
4653
"""
4754
Test coverage for offset special requirement specifying nonzero offset in X.
@@ -58,7 +65,6 @@ def test_nircam_tsgrism_stage2_offsetSR(run_pipeline_offsetSR, fitsdiff_default_
5865
assert diff.identical, diff.report()
5966

6067

61-
@pytest.mark.bigdata
6268
@pytest.mark.parametrize("suffix", ["calints", "extract_2d", "flat_field",
6369
"o002_crfints", "srctype", "x1dints"])
6470
def test_nircam_tsgrism_stage2(run_pipelines, fitsdiff_default_kwargs, suffix):
@@ -74,7 +80,6 @@ def test_nircam_tsgrism_stage2(run_pipelines, fitsdiff_default_kwargs, suffix):
7480
assert diff.identical, diff.report()
7581

7682

77-
@pytest.mark.bigdata
7883
def test_nircam_tsgrism_stage3_x1dints(run_pipelines, fitsdiff_default_kwargs):
7984
rtdata = run_pipelines
8085
rtdata.input = "jw01366-o002_20230107t004627_tso3_00001_asn.json"
@@ -85,7 +90,6 @@ def test_nircam_tsgrism_stage3_x1dints(run_pipelines, fitsdiff_default_kwargs):
8590
assert diff.identical, diff.report()
8691

8792

88-
@pytest.mark.bigdata
8993
def test_nircam_tsgrism_stage3_whtlt(run_pipelines):
9094
rtdata = run_pipelines
9195
rtdata.input = "jw01366-o002_20230107t004627_tso3_00001_asn.json"
@@ -99,7 +103,6 @@ def test_nircam_tsgrism_stage3_whtlt(run_pipelines):
99103
assert len(setdiff(table, table_truth)) == 0
100104

101105

102-
@pytest.mark.bigdata
103106
def test_nircam_setpointing_tsgrism(rtdata, fitsdiff_default_kwargs):
104107
"""
105108
Regression test of the set_telescope_pointing script on a level-1b NIRCam file.

jwst/regtest/test_nircam_tsimg.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
from jwst.lib.set_telescope_pointing import add_wcs
55
from jwst.stpipe import Step
66

7+
# Mark all tests in this module
8+
pytestmark = [pytest.mark.bigdata]
9+
710

811
@pytest.fixture(scope="module")
9-
def run_pipelines(rtdata_module):
12+
def run_pipelines(rtdata_module, resource_tracker):
1013
"""Run stage 2 and 3 pipelines on NIRCam TSO image data."""
1114

1215
rtdata = rtdata_module
@@ -24,11 +27,16 @@ def run_pipelines(rtdata_module):
2427
# the tso3 pipeline on all _calints files listed in association
2528
rtdata.get_data("nircam/tsimg/jw01068-o006_20240401t151322_tso3_00002_asn.json")
2629
args = ["calwebb_tso3", rtdata.input]
27-
Step.from_cmdline(args)
30+
with resource_tracker.track():
31+
Step.from_cmdline(args)
2832

2933
return rtdata
3034

3135

36+
def test_log_tracked_resources_tsimg(log_tracked_resources, run_pipelines):
37+
log_tracked_resources()
38+
39+
3240
@pytest.mark.bigdata
3341
@pytest.mark.parametrize("suffix", ["calints", "o006_crfints"])
3442
def test_nircam_tsimg_stage2(run_pipelines, fitsdiff_default_kwargs, suffix):

jwst/regtest/test_nircam_wfss_contam.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33

44
from jwst.regtest import regtestdata as rt
55

6+
# Mark all tests in this module
7+
pytestmark = [pytest.mark.bigdata]
8+
69

710
@pytest.fixture(scope='module')
8-
def run_wfss_contam(rtdata_module):
11+
def run_wfss_contam(rtdata_module, resource_tracker):
912
"""Run the wfss_contam step"""
1013
rtdata = rtdata_module
1114

@@ -24,11 +27,17 @@ def run_wfss_contam(rtdata_module):
2427
'--skip=False',
2528
]
2629
}
27-
rtdata = rt.run_step_from_dict(rtdata, **step_params)
30+
with resource_tracker.track():
31+
rtdata = rt.run_step_from_dict(rtdata, **step_params)
2832
return rtdata
2933

30-
@pytest.mark.skip(reason='Test too slow until stdatamodels PR#165 merged')
31-
@pytest.mark.bigdata
34+
35+
@pytest.mark.skip(reason='Test too slow until contam is updated')
36+
def test_log_tracked_resources_tsimg(log_tracked_resources, run_wfss_contam):
37+
log_tracked_resources()
38+
39+
40+
@pytest.mark.skip(reason='Test too slow until contam is updated')
3241
@pytest.mark.parametrize(
3342
'suffix',
3443
['simul', 'contam', 'wfsscontamstep']

jwst/regtest/test_nircam_wfss_spec2.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44

55
from jwst.stpipe import Step
66

7+
# Mark all tests in this module
8+
pytestmark = [pytest.mark.bigdata]
9+
710

811
@pytest.fixture(scope="module")
9-
def run_pipeline(rtdata_module):
12+
def run_pipeline(rtdata_module, resource_tracker):
1013
"""Run the calwebb_spec2 pipeline on a single NIRSpec WFSS exposure."""
1114

1215
rtdata = rtdata_module
@@ -27,12 +30,16 @@ def run_pipeline(rtdata_module):
2730
"--steps.extract_2d.wfss_nbright=20",
2831
"--steps.srctype.save_results=true",
2932
"--steps.flat_field.save_results=true"]
30-
Step.from_cmdline(args)
33+
with resource_tracker.track():
34+
Step.from_cmdline(args)
3135

3236
return rtdata
3337

3438

35-
@pytest.mark.bigdata
39+
def test_log_tracked_resources_spec2(log_tracked_resources, run_pipeline):
40+
log_tracked_resources()
41+
42+
3643
@pytest.mark.parametrize("suffix", [
3744
"assign_wcs", "bsub", "extract_2d", "flat_field", "srctype",
3845
"cal", "x1d"])

jwst/regtest/test_niriss_ami3.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@
33

44
from jwst.stpipe import Step
55

6+
# Mark all tests in this module
7+
pytestmark = [pytest.mark.bigdata]
8+
69

710
@pytest.fixture(scope="module")
8-
def run_pipeline(rtdata_module):
11+
def run_pipeline(rtdata_module, resource_tracker):
912
"""Run calwebb_ami3 on NIRISS AMI data."""
1013
rtdata = rtdata_module
1114
rtdata.get_asn("niriss/ami/ami3_test_asn.json")
1215

1316
# Run the calwebb_ami3 pipeline on the association
1417
args = ["calwebb_ami3", rtdata.input]
15-
Step.from_cmdline(args)
18+
with resource_tracker.track():
19+
Step.from_cmdline(args)
1620

1721
return rtdata
1822

@@ -32,7 +36,10 @@ def run_step_with_cal(rtdata_module):
3236
return rtdata
3337

3438

35-
@pytest.mark.bigdata
39+
def test_log_tracked_resources_ami3(log_tracked_resources, run_pipeline):
40+
log_tracked_resources()
41+
42+
3643
@pytest.mark.parametrize("obs, suffix", [("012", "ami-oi"), ("015", "psf-ami-oi")])
3744
def test_niriss_ami3_exp(run_pipeline, obs, suffix, fitsdiff_default_kwargs):
3845
"""Check exposure-level results of calwebb_ami3"""
@@ -47,7 +54,6 @@ def test_niriss_ami3_exp(run_pipeline, obs, suffix, fitsdiff_default_kwargs):
4754
assert diff.identical, diff.report()
4855

4956

50-
@pytest.mark.bigdata
5157
def test_niriss_ami3_product(run_pipeline, fitsdiff_default_kwargs):
5258
"""Check final products of calwebb_ami3"""
5359
rtdata = run_pipeline
@@ -61,7 +67,6 @@ def test_niriss_ami3_product(run_pipeline, fitsdiff_default_kwargs):
6167
assert diff.identical, diff.report()
6268

6369

64-
@pytest.mark.bigdata
6570
@pytest.mark.parametrize("suffix", ("ami-oi", "amimulti-oi", "amilg"))
6671
def test_niriss_ami3_cal(run_step_with_cal, suffix, fitsdiff_default_kwargs):
6772
rtdata = run_step_with_cal

0 commit comments

Comments
 (0)