Skip to content

Commit

Permalink
Merge pull request #196 from USDA-ARS-NWRC/wind_ninja_interp
Browse files Browse the repository at this point in the history
Wind ninja interpolation
  • Loading branch information
Scott Havens committed Nov 3, 2020
2 parents 736219b + 704961d commit 36d2c16
Show file tree
Hide file tree
Showing 6 changed files with 388 additions and 12 deletions.
22 changes: 12 additions & 10 deletions smrf/distribute/wind/wind_ninja.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,20 +264,22 @@ def fill_data(self, g_vel):
iy = np.sum(np.isnan(g_vel[:, ix+1]))

# first go in the Y direction
yi = g_vel[:, ix:ix+10]
xi = self.X[0, ix:ix+10]
x = self.X[0, :ix]
if ix > 0:
yi = g_vel[:, ix:ix+10]
xi = self.X[0, ix:ix+10]
x = self.X[0, :ix]

o = np.apply_along_axis(interpx, axis=1, arr=yi, xi=xi, x=x)
g_vel[:, :ix] = o
o = np.apply_along_axis(interpx, axis=1, arr=yi, xi=xi, x=x)
g_vel[:, :ix] = o

# first go in the X direction
yi = g_vel[-iy-10:-iy, :]
xi = self.Y[-iy-10:-iy, 0]
x = self.Y[-iy:, 0]
if iy > 0:
yi = g_vel[-iy-10:-iy, :]
xi = self.Y[-iy-10:-iy, 0]
x = self.Y[-iy:, 0]

o = np.apply_along_axis(interpx, axis=0, arr=yi, xi=xi, x=x)
g_vel[-iy:, :] = o
o = np.apply_along_axis(interpx, axis=0, arr=yi, xi=xi, x=x)
g_vel[-iy:, :] = o

if np.any(np.isnan(g_vel)):
raise ValueError('WindNinja data still has NaN values')
Expand Down

0 comments on commit 36d2c16

Please sign in to comment.