Skip to content

Commit

Permalink
step/data: clean up some to-dos
Browse files Browse the repository at this point in the history
  • Loading branch information
raehik committed Sep 20, 2023
1 parent f209fa9 commit 112462a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/gz21_ocean_momentum/step/data/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,14 @@ def _advections(u_v_field: xr.Dataset, grid_data: xr.Dataset):
"xu_ocean": u_v_field.coords["xu_ocean"],
"yu_ocean": u_v_field.coords["yu_ocean"],
}
# TODO got "ValueError: zero-size array to reduction operation fmin which has
# no identity" when given 0 bounding box
gradient_x = gradient_x.interp(interp_coords)
gradient_y = gradient_y.interp(interp_coords)
u, v = u_v_field["usurf"], u_v_field["vsurf"]
adv_x = u * gradient_x["usurf"] + v * gradient_y["usurf"]
adv_y = u * gradient_x["vsurf"] + v * gradient_y["vsurf"]
result = xr.Dataset({"adv_x": adv_x, "adv_y": adv_y})
# TODO check if we can simply prevent the previous operation from adding
# chunks
# TODO 2023-09-20: old note from original import: v
# check if we can simply prevent the previous operation from adding chunks
# result = result.chunk(dict(xu_ocean=-1, yu_ocean=-1))
return result

Expand Down

0 comments on commit 112462a

Please sign in to comment.