Skip to content

Commit

Permalink
Update multidimensional-coords.ipynb (#6672)
Browse files Browse the repository at this point in the history
Correct typo `xc` to `yc` in `groupby_bins`.
  • Loading branch information
smartlixx authored Jun 7, 2022
1 parent 44f8d4d commit 1a0879e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doc/examples/multidimensional-coords.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
"# define a label for each bin corresponding to the central latitude\n",
"lat_center = np.arange(1, 90, 2)\n",
"# group according to those bins and take the mean\n",
"Tair_lat_mean = ds.Tair.groupby_bins(\"xc\", lat_bins, labels=lat_center).mean(\n",
"Tair_lat_mean = ds.Tair.groupby_bins(\"yc\", lat_bins, labels=lat_center).mean(\n",
" dim=xr.ALL_DIMS\n",
")\n",
"# plot the result\n",
Expand All @@ -186,7 +186,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The resulting coordinate for the `groupby_bins` operation got the `_bins` suffix appended: `xc_bins`. This help us distinguish it from the original multidimensional variable `xc`.\n",
"The resulting coordinate for the `groupby_bins` operation got the `_bins` suffix appended: `yc_bins`. This help us distinguish it from the original multidimensional variable `yc`.\n",
"\n",
"**Note**: This group-by-latitude approach does not take into account the finite-size geometry of grid cells. It simply bins each value according to the coordinates at the cell center. Xarray has no understanding of grid cells and their geometry. More precise geographic regridding for xarray data is available via the [xesmf](https://xesmf.readthedocs.io) package."
]
Expand Down

0 comments on commit 1a0879e

Please sign in to comment.