Skip to content

Commit faefbda

Browse files
committed
bugfix for ndarray is not C-contignous error
1 parent 89d15ab commit faefbda

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/pyaps3/objects.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def getdelay(self, dout=None, outFile=None, wvl=np.pi*4., writeStations=True):
264264
# Define a linear interpolating function on the 3D grid: ((x, y, z), data)
265265
# We do the weird trick of [::-1,:,:] because Latu has to be in increasing order
266266
# for the RegularGridInterpolator method of scipy.interpolate
267-
linearint = si.RegularGridInterpolator(
267+
linear_interp_func = si.RegularGridInterpolator(
268268
(Latu[::-1], Lonu,kh),
269269
self.Delfn_1m[::-1,:,:],
270270
method='linear',
@@ -307,7 +307,9 @@ def getdelay(self, dout=None, outFile=None, wvl=np.pi*4., writeStations=True):
307307

308308
# Make the bilinear interpolation
309309
D = self.dem[m,:]
310-
val = linearint(np.vstack((lati, loni, D)).T)*np.pi*4.0/(cinc*wvl)
310+
val = linear_interp_func(
311+
np.ascontiguousarray(np.vstack((lati, loni, D)).T)
312+
) * np.pi * 4.0 / (cinc * wvl)
311313
val[xx] = np.nan
312314

313315
# save output

0 commit comments

Comments
 (0)