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

adding memory tests for detector 1 and the jump step #8888

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/8888.regtest.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Memory usage tests for NRS detector1 data, which includes snowball flagging, and memory usage test for jump step.
28 changes: 28 additions & 0 deletions jwst/regtest/test_nirspec_irs2_detector1.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

from jwst.stpipe import Step

from stcal.testing_helpers import MemoryThreshold


@pytest.fixture(scope="module")
def run_detector1pipeline(rtdata_module):
Expand Down Expand Up @@ -94,3 +96,29 @@ def test_nirspec_irs2_detector1_with_clean_flicker_noise(
fitsdiff_default_kwargs["atol"] = 1e-4
diff = FITSDiff(rtdata.output, rtdata.truth, **fitsdiff_default_kwargs)
assert diff.identical, diff.report()


@pytest.mark.bigdata
def test_mem_usage(rtdata_module):
"""Determine the memory usage of Detector1 and the jump step"""
# set up the input data
rtdata = rtdata_module
rtdata.get_data("nirspec/irs2/jw01335004001_03101_00002_nrs2_uncal.fits")
args = ["jwst.pipeline.Detector1Pipeline", rtdata.input,
"--steps.dark_current.save_results=True"]

# run Detecto21 while tracking memory usage
expected_mem = '15 GB'
with MemoryThreshold(expected_mem):
Step.from_cmdline(args)

# run jump while tracking memory usage
expected_mem = '5 GB'
rtdata.output = "jw01335004001_03101_00002_nrs2_dark_current.fits"
# the truth is set up so there is no error when calling rdata.output, no comparison is made
rtdata.get_truth("nirspec/irs2/jw01335004001_03101_00002_nrs2_uncal.fits")
args = ["jump", rtdata.output]
with MemoryThreshold(expected_mem):
Step.from_cmdline(args)


Loading