Skip to content

Commit 06c6c50

Browse files
committed
Fix return for LegacyCoordinates
1 parent 0f62f17 commit 06c6c50

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

glue/core/coordinate_helpers.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,8 @@ def pixel2world_single_axis(wcs, *pixel, world_axis=None):
6363
result = result.reshape(pixel_shape)
6464
else:
6565
result = wcs.pixel_to_world_values(*pixel)
66-
67-
if len(pixel) > 1:
68-
result = result[world_axis]
66+
if len(pixel) > 1:
67+
result = result[world_axis]
6968

7069
return np.broadcast_to(result, original_shape)
7170

@@ -121,9 +120,8 @@ def world2pixel_single_axis(wcs, *world, pixel_axis=None):
121120
result = result.reshape(world_shape)
122121
else:
123122
result = wcs.world_to_pixel_values(*world)
124-
125-
if len(world) > 1:
126-
result = result[pixel_axis]
123+
if len(world) > 1:
124+
result = result[pixel_axis]
127125

128126
return np.broadcast_to(result, original_shape)
129127

glue/core/coordinates.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ def __init__(self):
9090
super().__init__(pixel_n_dim=10, world_n_dim=10)
9191

9292
def pixel_to_world_values(self, *pixel):
93-
if self.pixel_n_dim == 1:
93+
if len(pixel) == 1:
9494
return pixel[0]
9595
else:
9696
return pixel
9797

9898
def world_to_pixel_values(self, *world):
99-
if self.world_n_dim == 1:
99+
if len(world) == 1:
100100
return world[0]
101101
else:
102102
return world

0 commit comments

Comments
 (0)