Skip to content

Commit

Permalink
Fix for recent PR merges
Browse files Browse the repository at this point in the history
  • Loading branch information
ejeschke committed Dec 21, 2021
1 parent a8d65bb commit c940b8b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ginga/trcalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def get_scaled_cutout_wdht_view(shp, x1, y1, x2, y2, new_wd, new_ht):
if yi_max > max_y:
raise ValueError("Y index (%d) exceeds shape bounds (%d)" % (yi_max, max_y))

view = np.ix_(yi, xi)
view = (yi, xi)

# Calculate actual scale used (vs. desired)
scale_x = float(wd) / old_wd
Expand Down Expand Up @@ -340,7 +340,7 @@ def get_scaled_cutout_wdhtdp_view(shp, p1, p2, new_dims):
if zi_max > max_z:
raise ValueError("Z index (%d) exceeds shape bounds (%d)" % (zi_max, max_z))

view = np.ix_(yi, xi, zi)
view = (yi, xi, zi)

# Calculate actual scale used (vs. desired)
scale_x = float(wd) / old_wd
Expand Down Expand Up @@ -1140,6 +1140,9 @@ def fancy_index(d_obj, view):
arr : ndarray
The result of the fancy index as a numpy array
"""
if not isinstance(view, tuple):
view = tuple(view)

if not isinstance(view[0], slice):
# <-- indicates fancy indexing being used instead of slices

Expand Down

0 comments on commit c940b8b

Please sign in to comment.