handle immutable lists in vector interpolator, re-order for sin/consine grid differences
@@ -42,9 +42,13 @@ eps = 1e-5
class VectorInterpolator:
"""."""
- def __init__(self, grid, data, lut_interp_types):
+ def __init__(self, grid_input, data_input, lut_interp_types):
self.lut_interp_types = lut_interp_types
+ # Lists and arrays are mutable, so copy first
+ grid = grid_input.copy()
+ data = data_input.copy()
+
# expand grid dimensionality as needed
[radian_locations] = np.where(self.lut_interp_types == 'd')
[degree_locations] = np.where(self.lut_interp_types == 'r')
@@ -86,6 +90,11 @@ class VectorInterpolator:
for ind in range(data.shape[0]):
data[ind,...] = data[:,ind,...]
+ # No re-order the cosin dimension
+ data = data[grid_subset_cosin_order,...]
+ # No re-order the sin dimension
+ data = data[:,grid_subset_sin_order,...]
+
# now re-arrange the axes so they're in the right order again,
# remembering that we've added a new axis
src_axes = np.arange(len(data.shape))
