Skip to content

Commit

Permalink
restructure test_miri_mrs_badpix_selfcal_bkg to allow it to be okified (
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram authored Nov 20, 2024
2 parents 57f6148 + 5a2d0cd commit ac642ca
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions jwst/regtest/test_miri_mrs_badpix_selfcal.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,19 @@ def test_miri_mrs_badpix_selfcal(run_pipeline_selfcal, fitsdiff_default_kwargs):
assert not os.path.isfile(fname)


@pytest.mark.parametrize("basename", (
[f"{OUTSTEM_BKG}_badpix_selfcal.fits",] +
[f"{OUTSTEM_BKG}_badpix_selfcal_bkg_{idx}.fits" for idx in range(4)]))
@pytest.mark.bigdata
def test_miri_mrs_badpix_selfcal_bkg(run_pipeline_background, fitsdiff_default_kwargs):
def test_miri_mrs_badpix_selfcal_bkg(basename, run_pipeline_background, fitsdiff_default_kwargs):
"""Run a test for MIRI MRS data with dedicated background exposures."""

rtdata = run_pipeline_background

# Get the truth file
rtdata.get_truth(f"truth/test_miri_mrs_badpix_selfcal/{OUTSTEM_BKG}_badpix_selfcal.fits")
rtdata.output = basename
rtdata.get_truth(f"truth/test_miri_mrs_badpix_selfcal/{basename}")

# Compare the results
# Compare the results and check the bkg files in the background case, but not in the selfcal case
diff = FITSDiff(rtdata.output, rtdata.truth, **fitsdiff_default_kwargs)
assert diff.identical, diff.report()

# check the bkg files in the background case, but not in the selfcal case
for idx in range(4):
fname = f"{OUTSTEM_BKG}_badpix_selfcal_bkg_{idx}.fits"
truth = rtdata.get_truth(f"truth/test_miri_mrs_badpix_selfcal/{fname}")
diff = FITSDiff(fname, truth, **fitsdiff_default_kwargs)
assert diff.identical, diff.report()

0 comments on commit ac642ca

Please sign in to comment.