Skip to content

Commit

Permalink
add wcs to model used in compare_asdf tests
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed Oct 17, 2023
1 parent a46953d commit 8e3083c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions romancal/regtest/test_regtestdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,23 @@
from roman_datamodels import datamodels as rdm
from roman_datamodels import maker_utils

from romancal.assign_wcs.assign_wcs_step import load_wcs
from romancal.regtest.regtestdata import compare_asdf


def _add_wcs(tmp_path, model):
dfn = tmp_path / "wcs_distortion.asdf"
distortion_model = rdm.DistortionRefModel(maker_utils.mk_distortion())
distortion_model.save(dfn)
load_wcs(model, {"distortion": dfn})


@pytest.mark.parametrize("modification", [None, "small", "large"])
def test_compare_asdf(tmp_path, modification):
fn0 = tmp_path / "test0.asdf"
fn1 = tmp_path / "test1.asdf"
l2 = rdm.ImageModel(maker_utils.mk_level2_image(shape=(100, 100)))
_add_wcs(tmp_path, l2)
l2.save(fn0)
atol = 0.0001
if modification == "small":
Expand Down

0 comments on commit 8e3083c

Please sign in to comment.