Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

closes #34 . Enable diagnosing variables on inner grid #57

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions xnemogcm/nemo.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,22 @@ def nemo_preprocess(ds, domcfg, point_type=None):
except IndexError:
# This means that there is no depth dependence of the data (surface data)
z_nme = None
x_nme = "x"
y_nme = "y"
to_rename.update({x_nme: point.x, y_nme: point.y})
# get the name of the variable along i e.g. x, x_grid_U, x_grid_U_inner etc
try:
x_nme = [i for i in ds.dims.keys() if "x_grid" in i]
except IndexError:
# This means that the i-dimension must have the name 'x'
x_nme = ["x"]
rcaneill marked this conversation as resolved.
Show resolved Hide resolved
# get the name of the variable along j e.g. y, y_grid_U, y_grid_U_inner etc
try:
y_nme = [i for i in ds.dims.keys() if "y_grid" in i]
except IndexError:
# This means that the j-dimension must have the name 'y'
y_nme = ["y"]
rcaneill marked this conversation as resolved.
Show resolved Hide resolved

for x, y in zip(x_nme, y_nme):
to_rename.update({x: point.x, y: point.y})
rcaneill marked this conversation as resolved.
Show resolved Hide resolved

points = [point.x, point.y]
if z_nme:
to_rename.update({z_nme: point.z})
Expand Down
Loading