File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1313from numpy .testing import assert_equal
1414
1515import astropy
16- from astropy .wcs .wcsapi import SlicedLowLevelWCS
16+ from astropy .wcs .wcsapi import BaseHighLevelWCS
1717from astropy .wcs .wcsapi .fitswcs import SlicedFITSWCS
1818from astropy .wcs .wcsapi .low_level_api import BaseLowLevelWCS
1919from astropy .wcs .wcsapi .wrappers .sliced_wcs import sanitize_slices
@@ -145,11 +145,11 @@ def assert_wcs_are_equal(wcs1, wcs2):
145145 assert wcs1 .pixel_bounds == wcs2 .pixel_bounds
146146 if wcs1 .pixel_shape is not None :
147147 random_idx = np .random .randint (wcs1 .pixel_shape ,size = [10 ,wcs1 .pixel_n_dim ])
148- # SlicedLowLevelWCS vs HighLevelWCS don't have the same pixel_to_world method
149- if isinstance ( wcs1 , SlicedLowLevelWCS ):
150- np . testing . assert_array_equal (wcs1 . pixel_to_world_values ( * random_idx . T ), wcs2 . pixel_to_world_values ( * random_idx . T ))
151- else :
152- np .testing .assert_array_equal (wcs1 . pixel_to_world (* random_idx .T ), wcs2 . pixel_to_world (* random_idx .T ))
148+ # SlicedLowLevelWCS vs BaseHighLevelWCS don't have the same pixel_to_world method
149+ low_level_wcs = wcs1
150+ if isinstance (wcs1 , BaseHighLevelWCS ):
151+ low_level_wcs = wcs1 . low_level_wcs
152+ np .testing .assert_array_equal (low_level_wcs . pixel_to_world_values (* random_idx .T ), low_level_wcs . pixel_to_world_values (* random_idx .T ))
153153
154154def create_sliced_wcs (wcs , item , dim ):
155155 """
You can’t perform that action at this time.
0 commit comments