Skip to content

Commit

Permalink
Roms chunk fix (#41)
Browse files Browse the repository at this point in the history
* Add multiplier setting for vdatum to control transformation direction

* Start trying to fix roms rotation chunks

* More unified chunks

* cleanup
  • Loading branch information
mpiannucci authored Jul 12, 2024
1 parent f6c22cd commit 164761c
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions xreds/extensions/roms.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def transform_dataset(self, ds: xr.Dataset, config: dict) -> xr.Dataset:
)
return ds

default_da = default_da.unify_chunks()

# Start with u
u_name = "u_sur" if "u_sur" in ds else "u"
u = ds[u_name]
Expand Down Expand Up @@ -125,7 +127,17 @@ def transform_dataset(self, ds: xr.Dataset, config: dict) -> xr.Dataset:
v_rotated.name = f"{v_name}_rotated"
v_rotated.attrs["long_name"] = "v velocity rotated from ROMS grid"

ds[f"{u_name}_rotated"] = u_rotated
ds[f"{v_name}_rotated"] = v_rotated
ds[f"{u_name}_rotated"] = u_rotated.chunk(
dict(
xi_rho=default_da.chunksizes['xi_rho'],
eta_rho=default_da.chunksizes['eta_rho']
)
).unify_chunks()
ds[f"{v_name}_rotated"] = v_rotated.chunk(
dict(
xi_rho=default_da.chunksizes['xi_rho'],
eta_rho=default_da.chunksizes['eta_rho']
)
).unify_chunks()

return ds

0 comments on commit 164761c

Please sign in to comment.