Skip to content

Commit

Permalink
JP-2928: Update MIRI MRS test data (#8936)
Browse files Browse the repository at this point in the history
  • Loading branch information
melanieclarke authored Nov 6, 2024
2 parents b613783 + 3cb6359 commit e898f2a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 48 deletions.
34 changes: 24 additions & 10 deletions jwst/regtest/test_miri_mrs_dedicated_mbkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,41 @@ def run_pipeline(rtdata_module):

rtdata = rtdata_module

rtdata.get_asn("miri/mrs/miri_mrs_mbkg_0304_spec3_asn.json")
rtdata.get_asn("miri/mrs/jw01031-c1004_20241028t205539_spec3_subset_asn.json")

MasterBackgroundStep.call(rtdata.input, save_results=True, suffix='master_background')
MasterBackgroundStep.call(rtdata.input, save_results=True, suffix='mbsub',
save_background=True)

return rtdata


@pytest.mark.bigdata
@pytest.mark.parametrize("exp_seq", ["exp1", "exp2", "exp3"])
def test_miri_mrs_dedicated_mbkg(run_pipeline, fitsdiff_default_kwargs,
exp_seq):
@pytest.mark.parametrize("exposure", [1, 2, 3, 4])
@pytest.mark.parametrize("suffix", ["mbsub", "c1004_masterbg2d"])
def test_miri_mrs_dedicated_mbkg(run_pipeline, fitsdiff_default_kwargs, exposure, suffix):
"""Run a test for MIRI MRS data with dedicated background exposures."""
rtdata = run_pipeline
output_file = f"jw01031001001_02101_0000{exposure}_mirifulong_{suffix}.fits"
rtdata.output = output_file

# Get the truth file
rtdata.get_truth(os.path.join("truth/test_miri_mrs_dedicated_mbkg", output_file))

# Compare the results
diff = FITSDiff(rtdata.output, rtdata.truth, **fitsdiff_default_kwargs)
assert diff.identical, diff.report()


@pytest.mark.bigdata
def test_miri_mrs_dedicated_masterbg1d(run_pipeline, fitsdiff_default_kwargs):
rtdata = run_pipeline
rtdata.output = "miri_mrs_seq1_long_34_" + exp_seq + \
"_master_background.fits"

# Check 1D masterbg output product: created with root name from nod 1
output_file = "jw01031006001_02101_00001_mirifulong_c1004_masterbg1d.fits"
rtdata.output = output_file

# Get the truth file
rtdata.get_truth(os.path.join(
"truth/test_miri_mrs_dedicated_mbkg",
"miri_mrs_seq1_long_34_" + exp_seq + "_master_background.fits"))
rtdata.get_truth(os.path.join("truth/test_miri_mrs_dedicated_mbkg", output_file))

# Compare the results
diff = FITSDiff(rtdata.output, rtdata.truth, **fitsdiff_default_kwargs)
Expand Down
36 changes: 0 additions & 36 deletions jwst/regtest/test_miri_mrs_nod_masterbg.py

This file was deleted.

4 changes: 2 additions & 2 deletions jwst/regtest/test_miri_mrs_tso.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def run_spec2(rtdata_module):
rtdata = rtdata_module

# Setup the inputs
file_name = 'jw80600018001_02101_00003_mirifushort_rateints.fits'
file_name = 'jw01556001001_04102_00001-seg001_mirifushort_rateints.fits'
rtdata.get_data(INPUT_PATH + '/' + file_name)

# Run the pipeline
Expand All @@ -37,7 +37,7 @@ def run_spec2(rtdata_module):
def test_spec2(rtdata_module, run_spec2, fitsdiff_default_kwargs, suffix):
"""Test ensuring the calwebb_tso-spec2 is operating appropriately for MIRI MRS TSO data"""
rtdata = rtdata_module
output = f"jw80600018001_02101_00003_mirifushort_{suffix}.fits"
output = f"jw01556001001_04102_00001-seg001_mirifushort_{suffix}.fits"
rtdata.output = output

rtdata.get_truth(f"{TRUTH_PATH}/{output}")
Expand Down

0 comments on commit e898f2a

Please sign in to comment.