Skip to content

Commit

Permalink
Merge pull request #250 from w-k-jones/fix_2d_latlon_interp_list
Browse files Browse the repository at this point in the history
Fix 2d coordinate interpolation
  • Loading branch information
w-k-jones authored Feb 23, 2023
2 parents 5ece4f5 + b78f1e0 commit 819bba5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tobac/utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,15 @@ def add_coordinates(t, variable_cube):

if variable_cube.coord_dims(coord) == (hdim_1, hdim_2):
f = interp2d(dimvec_2, dimvec_1, variable_cube.coord(coord).points)
coordinate_points = [f(a, b) for a, b in zip(t["hdim_2"], t["hdim_1"])]
coordinate_points = np.asarray(
[f(a, b) for a, b in zip(t["hdim_2"], t["hdim_1"])]
)

if variable_cube.coord_dims(coord) == (hdim_2, hdim_1):
f = interp2d(dimvec_1, dimvec_2, variable_cube.coord(coord).points)
coordinate_points = [f(a, b) for a, b in zip(t["hdim_1"], t["hdim_2"])]
coordinate_points = np.asarray(
[f(a, b) for a, b in zip(t["hdim_1"], t["hdim_2"])]
)

# interpolate 3D coordinates:
# mainly workaround for wrf latitude and longitude (to be fixed in future)
Expand Down

0 comments on commit 819bba5

Please sign in to comment.