Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests to aggregate.py #486

Merged
merged 14 commits into from
Nov 4, 2024
Prev Previous commit
Next Next commit
upd notebook
RondeauG committed Nov 1, 2024

Verified

This commit was signed with the committer’s verified signature.
sandhose Quentin Gliech
commit 7301303e2beb75df761f0b42dd517db4da846fce
9 changes: 1 addition & 8 deletions docs/notebooks/2_getting_started.ipynb
Original file line number Diff line number Diff line change
@@ -1189,12 +1189,6 @@
"\n",
"- `method: cos-lat` will perform an average operation over the spatial dimensions, accounting for changes in grid cell area along the 'lat' coordinate.\n",
"\n",
"\n",
"- `method: interp_centroid` will perform an interpolation towards given coordinates or towards the centroid of a region.\n",
" - `kwargs` is used to sent arguments to `.interp()`, including `lon` and `lat`.\n",
" - `region` can alternatively be used to send a gridpoint, bbox, or shapefile and compute the centroid. This argument is a dictionary that follows the same requirements as the one for `xs.extract` described previously.\n",
"\n",
"\n",
"- `method: xesmf` will perform a call to *xESMF*'s [SpatialAverager](https://pangeo-xesmf.readthedocs.io/en/latest/notebooks/Spatial_Averaging.html). This method is the most precise, especially for irregular regions, but can be much slower.\n",
" - `kwargs` is used to sent arguments to `xesmf.SpatialAverager`.\n",
" - `region` is used to send a bbox or shapefile to the `SpatialAverager`. This argument is a dictionary that follows the same requirements as the one for `xs.extract` described previously.\n",
@@ -1215,8 +1209,7 @@
"for key, ds in ds_dict.items():\n",
" ds_savg = xs.spatial_mean(\n",
" ds=ds,\n",
" method=\"interp_centroid\",\n",
" kwargs={\"method\": \"linear\", \"lon\": -74.5, \"lat\": 47},\n",
" method=\"cos-lat\",\n",
" to_domain=\"aggregated\",\n",
" )\n",
"\n",