Skip to content

Commit fd58746

Browse files
mdboomdhomeier
authored andcommitted
Add test for astropy#3904
1 parent d6f9964 commit fd58746

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎astropy/wcs/tests/test_wcs.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,3 +757,18 @@ def test_sip_tpv_agreement():
757757
assert_array_almost_equal(
758758
w_sip2.all_pix2world([w_sip.wcs.crpix], 1),
759759
w_tpv2.all_pix2world([w_tpv.wcs.crpix], 1))
760+
761+
762+
@pytest.mark.skipif('_wcs.__version__[0] < "5"',
763+
reason="TPV only works with wcslib 5.x or later")
764+
def test_tpv_copy():
765+
# See #3904
766+
767+
tpv_header = get_pkg_data_contents(
768+
os.path.join("data", "tpvonly.hdr"), encoding='binary')
769+
770+
w_tpv = wcs.WCS(tpv_header)
771+
772+
ra, dec = w_tpv.wcs_pix2world([0, 100, 200], [0, -100, 200], 0)
773+
assert ra[0] != ra[1] and ra[1] != ra[2]
774+
assert dec[0] != dec[1] and dec[1] != dec[2]

0 commit comments

Comments
 (0)