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

Fix logic in MIRI LRS spec3 regtest #7497

Merged
merged 1 commit into from
Mar 14, 2023
Merged
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
15 changes: 9 additions & 6 deletions jwst/regtest/test_miri_lrs_slit_spec3.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def run_pipeline(jail, rtdata_module, request):

# Get the spec3 ASN and its members
rtdata.get_asn("miri/lrs/jw01530-o005_20221202t204827_spec3_00001_asn.json")
root_file = "jw01530-o005_t004_miri_p750l_"
rtdata.get_truth("truth/test_miri_lrs_slit_spec3/jw01530-o005_t004_miri_p750l_s2d.fits")

args = [
Expand All @@ -46,6 +47,8 @@ def run_pipeline(jail, rtdata_module, request):
elif request.param == "user_wcs+shape1":
output_shape = ','.join(map(str, (d + 1 for d in dm.data.shape[::-1])))
args.append(f"--steps.resample_spec.output_shape={output_shape}")
output_file = root_file + 'shape1.fits'
args.append(f"--steps.resample_spec.output_file={output_file}")

# Run the calwebb_spec3 pipeline; save results from intermediate steps
Step.from_cmdline(args)
Expand All @@ -60,16 +63,16 @@ def test_miri_lrs_slit_spec3(run_pipeline, rtdata_module, fitsdiff_default_kwarg

# Run the pipeline and retrieve outputs
rtdata = rtdata_module
output = f"jw01530-o005_t004_miri_p750l_{suffix}.fits"

if rtdata.custom_wcs_mode == 'user_wcs+shape1' and suffix == "s2d":
output = f"jw01530-o005_t004_miri_p750l_shape1_{suffix}.fits"
else:
output = f"jw01530-o005_t004_miri_p750l_{suffix}.fits"
rtdata.output = output

# Get the truth files
rtdata.get_truth(f"truth/test_miri_lrs_slit_spec3/{output}")

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

if rtdata.custom_wcs_mode == 'user_wcs+shape1' and suffix == "s2d":
assert not diff.identical
else:
assert diff.identical, diff.report()
assert diff.identical, diff.report()