Skip to content

Instantly share code, notes, and snippets.

@raphaeldussin
Last active December 8, 2020 22:06
Show Gist options
  • Save raphaeldussin/92234b0811b893da5e1ba24c9f7cb09f to your computer and use it in GitHub Desktop.
Save raphaeldussin/92234b0811b893da5e1ba24c9f7cb09f to your computer and use it in GitHub Desktop.
opening a ROMS zarr store
import xarray as xr
from xgcm import Grid
CCS2 = xr.open_zarr(CCS2_store, consolidated=True)
# Create xgcm grid object
grid_ccs2 = Grid(CCS2, coords={'X': {'center': 'xh', 'outer': 'xq'},
'Y': {'center': 'yh', 'outer': 'yq'},
'Z': {'center': 's_rho', 'outer': 's_w'}},
periodic=False)
# Add depths of layers and interfaces to dataset
CCS2 = compute_depth_layers(CCS2, grid_ccs2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment