Skip to content

Commit

Permalink
Replace xr.Dataset.dims with xr.Dataset.sizes (xarray-contrib#159)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Lukas Pilz <lukas.pilz@iup.uni-heidelberg.de>
  • Loading branch information
christopher-lw and lpilz authored Mar 15, 2024
1 parent 7e1c8d8 commit 3163abc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xwrf/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def _wrf_grid_from_dataset(ds: xr.Dataset) -> Mapping[Hashable, pyproj.CRS | np.

# Get grid specifications
trf = pyproj.Transformer.from_crs(wgs84, crs, always_xy=True)
nx = ds.dims['west_east']
ny = ds.dims['south_north']
nx = ds.sizes['west_east']
ny = ds.sizes['south_north']
e, n = trf.transform(cen_lon, cen_lat)
x0 = -(nx - 1) / 2.0 * dx + e # DL corner
y0 = -(ny - 1) / 2.0 * dy + n # DL corner
Expand Down

0 comments on commit 3163abc

Please sign in to comment.