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 issue with bounding box when creating WCS for tests. #181

Merged
merged 29 commits into from
Aug 2, 2023
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9441dd4
Add methods necessary for resample.
mairanteodoro Jul 6, 2023
f0013aa
Small changes to accommodate both JWST and RST datamodels.
mairanteodoro Jul 7, 2023
66ea089
Add CHANGES.rst entry.
mairanteodoro Jul 7, 2023
48e3d60
Add PR number to CHANGES.rst entry.
mairanteodoro Jul 7, 2023
66ba3fe
use protocols
nden Jul 9, 2023
3906abf
temp
nden Jul 9, 2023
3467f81
add dependencies
nden Jul 9, 2023
13c342f
add CI testing to alignment branch
nden Jul 9, 2023
42423d3
add CI testing to alignment branch
nden Jul 9, 2023
b8b8cc0
fix test
nden Jul 10, 2023
fa86a3e
Add setting of number_extended_events (#178)
mwregan2 Jul 7, 2023
0eea0e5
Rename variables with FITS keywords names.
mairanteodoro Jul 10, 2023
7c136a7
Style reformating.
mairanteodoro Jul 10, 2023
cc7d689
Update docs to include stcal.alignment.
mairanteodoro Jul 12, 2023
f4f379d
Revert "Rename variables with FITS keywords names."
mairanteodoro Jul 12, 2023
afa9e7a
Updates to address most comments.
mairanteodoro Jul 12, 2023
0cd3621
Fix misplaced comment.
mairanteodoro Jul 12, 2023
a8839a9
Code refactoring and additional unit test.
mairanteodoro Jul 13, 2023
47f785b
Silencing style check warning F403.
mairanteodoro Jul 13, 2023
424fd38
Small style refactoring.
mairanteodoro Jul 13, 2023
d67e0b9
Set minimum asdf version.
mairanteodoro Jul 13, 2023
1229f02
Update matplotlib's inventory URL.
mairanteodoro Jul 13, 2023
500479a
Set lower version for gwcs.
mairanteodoro Jul 13, 2023
eeccb1b
Bump astropy version to >= 5.1.
mairanteodoro Jul 13, 2023
7e6dbf3
Fix docs style issues.
mairanteodoro Jul 14, 2023
d52c609
Style check fix.
mairanteodoro Jul 14, 2023
bc7fdbc
Fix issue with bounding boxes in tests.
mairanteodoro Jul 18, 2023
6fe6df8
Fix issue with bounding boxes in tests.
mairanteodoro Jul 18, 2023
b97a839
Merge branch 'stcal-alignment' of github.com:mairanteodoro/stcal into…
mairanteodoro Jul 18, 2023
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
17 changes: 6 additions & 11 deletions tests/test_alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def _create_wcs_object_without_distortion(
wcs_obj = WCS(pipeline)

wcs_obj.bounding_box = (
(-0.5, shape[0] - 0.5),
(-0.5, shape[0] - 0.5),
(0, shape[0] - 1),
(0, shape[0] - 1),
)

return wcs_obj
Expand Down Expand Up @@ -158,26 +158,21 @@ def test_wcs_from_footprints():
dm_1 = _create_wcs_and_datamodel(fiducial_world, shape, pscale)
wcs_1 = dm_1.meta.wcs

# shift fiducial by one pixel in both directions and create a new WCS
# shift fiducial by the size of a pixel projected onto the sky in both directions
# and create a new WCS
fiducial_world = (
fiducial_world[0] - 0.000028,
fiducial_world[1] - 0.000028,
)
dm_2 = _create_wcs_and_datamodel(fiducial_world, shape, pscale)
wcs_2 = dm_2.meta.wcs

# check overlapping pixels have approximate the same world coordinate
assert all(np.isclose(wcs_1(0, 1), wcs_2(1, 2)))
assert all(np.isclose(wcs_1(1, 0), wcs_2(2, 1)))
assert all(np.isclose(wcs_1(0, 0), wcs_2(1, 1)))
assert all(np.isclose(wcs_1(1, 1), wcs_2(2, 2)))

wcs = wcs_from_footprints([dm_1, dm_2])

# check that center of calculated WCS matches the
# expected position onto wcs_1 and wcs_2
assert all(np.isclose(wcs(2, 2), wcs_1(0.5, 0.5)))
assert all(np.isclose(wcs(2, 2), wcs_2(1.5, 1.5)))
assert all(np.isclose(wcs(2, 2), wcs_1(1, 1)))
assert all(np.isclose(wcs(2, 2), wcs_2(2, 2)))


def test_validate_wcs_list():
Expand Down
Loading