diff --git a/pyproject.toml b/pyproject.toml index 0a64a84bb..590f27092 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,8 @@ dependencies = [ "asdf-astropy >=0.5.0", "astropy >=5.3.0", "crds >=11.16.16", - "gwcs >=0.21.0", + #"gwcs >=0.21.0", + "gwcs @ git+https://github.com/nden/gwcs.git@inverse-bbox", "jsonschema >=4.8", "numpy >=1.23", "photutils >=1.13.0", diff --git a/romancal/conftest.py b/romancal/conftest.py index c9fe82abd..bba0638af 100644 --- a/romancal/conftest.py +++ b/romancal/conftest.py @@ -237,10 +237,19 @@ def base_image(): """ def _base_image(shift_1=0, shift_2=0): - l2 = maker_utils.mk_level2_image(shape=(100, 100)) - l2_im = rdm.ImageModel(l2) - _create_wcs(l2_im) - l2_im.meta.wcsinfo.vparity = -1 - return l2_im + model = maker_utils.mk_level2_image(shape=(100, 100)) + model.meta.wcsinfo["vparity"] = -1 + model.meta.wcsinfo["ra_ref"] = 178.37567 + model.meta.wcsinfo["dec_ref"] = -2.674389 + model.meta.wcsinfo["v2_ref"] = 2216.3796908471754 + model.meta.wcsinfo["v3_ref"] = 130.234233411109 + model.meta.wcsinfo["v3yangle"] = -60.0 + model.meta.wcsinfo["roll_ref"] = 60.0 + img = rdm.ImageModel(model) + transform = pointing.v23tosky(img) + img.meta.wcs.set_transform('detector', 'icrs', transform) + img.meta.wcs.bounding_box = ((-0.5, 2300), (-0.5, 200)) + + return img return _base_image diff --git a/romancal/resample/tests/test_resample_step.py b/romancal/resample/tests/test_resample_step.py index dc16a8924..83512acdc 100644 --- a/romancal/resample/tests/test_resample_step.py +++ b/romancal/resample/tests/test_resample_step.py @@ -8,6 +8,7 @@ from gwcs import coordinate_frames as cf from roman_datamodels import datamodels, maker_utils +from romancal.assign_wcs import pointing from romancal.resample import ResampleStep, resample_utils @@ -337,8 +338,16 @@ def test_build_driz_weight_multiple_good_bits( def test_set_good_bits_in_resample_meta(base_image, good_bits): model = maker_utils.mk_level2_image(shape=(100, 100)) model.meta.wcsinfo["vparity"] = -1 - + model.meta.wcsinfo["ra_ref"] = 178.37567 + model.meta.wcsinfo["dec_ref"] = -2.674389 + model.meta.wcsinfo["v2_ref"] = 2216.3796908471754 + model.meta.wcsinfo["v3_ref"] = 130.234233411109 + model.meta.wcsinfo["v3yangle"] = -60.0 + model.meta.wcsinfo["roll_ref"] = 60.0 img = datamodels.ImageModel(model) + transform = pointing.v23tosky(img) + img.meta.wcs.set_transform('detector', 'icrs', transform) + img.meta.wcs.bounding_box = ((-0.5, 2300), (-0.5, 200)) img.data *= img.meta.photometry.conversion_megajanskys / img.data