try:
z_nme = [i for i in ds.dims.keys() if "depth" in i][0]
except IndexError:
# This means that there is no depth dependence of the data (surface data)
z_nme = None
x_nme = "x" # could be an argument / metadata
y_nme = "y"
ds = ds.rename({x_nme: point.x, y_nme: point.y})
if z_nme:
ds = ds.rename({z_nme: point.z})
# setting z_c/z_f/x_c/etc to be the same as in domcfg
points = [point.x, point.y]
if z_nme:
points += [point.z]
for xyz in points:
ds.coords[xyz] = domcfg[xyz]
However a better solution could be found to handle the same problem along x and y.
Due to the fact that surface data do not have a depth dimension, xnemogcm raises an error at line: https://github.com/rcaneill/xnemogcm/blob/d792269bd86f51fa7631b5d544491b3fb156e232/xnemogcm/nemo.py#L41
A simple fix is replacing lines 41 to 47 by:
However a better solution could be found to handle the same problem along x and y.