|
26 | 26 | "import matplotlib.pyplot as plt\n", |
27 | 27 | "import numpy as np\n", |
28 | 28 | "import pandas as pd\n", |
| 29 | + "import pooch\n", |
29 | 30 | "import xarray as xr\n", |
30 | 31 | "from c3s_eqc_automatic_quality_control import diagnostics, download, plot\n", |
31 | 32 | "\n", |
|
123 | 124 | "source": [ |
124 | 125 | "def add_bounds(ds):\n", |
125 | 126 | " # From https://github.com/COSIMA/ocean-regrid/blob/master/nemo_grid.py\n", |
126 | | - " dg = xr.open_dataset(\n", |
127 | | - " (\n", |
128 | | - " \"https://icdc.cen.uni-hamburg.de/thredds/dodsC/ftpthredds/\"\n", |
129 | | - " \"EASYInit/oras5/ORCA025/mesh/mesh_mask.nc\"\n", |
130 | | - " ),\n", |
131 | | - " chunks={},\n", |
132 | | - " ).isel(t=0, z=0)\n", |
| 127 | + " url = (\n", |
| 128 | + " \"https://icdc.cen.uni-hamburg.de/thredds/fileServer/ftpthredds/\"\n", |
| 129 | + " \"EASYInit/oras5/ORCA025/mesh/mesh_mask.nc\"\n", |
| 130 | + " )\n", |
| 131 | + " known_hash = \"ba88418bc8055972b675ceedbd4345b3827f0ede8cef04d53c97b66a5c7a46a7\"\n", |
| 132 | + " fname = pooch.retrieve(url, known_hash)\n", |
| 133 | + " dg = xr.open_dataset(fname, chunks={}).isel(t=0, z=0)\n", |
133 | 134 | "\n", |
134 | 135 | " # These are the top righ-hand corner of t cells.\n", |
135 | 136 | " glamf = dg.glamf\n", |
|
328 | 329 | "metadata": {}, |
329 | 330 | "outputs": [], |
330 | 331 | "source": [ |
| 332 | + "month_order = [10, 11, 12, 1, 2]\n", |
331 | 333 | "datasets = {\"Reanalysis\": ds_reanalysis, \"Seasonal Forecast\": ds_seasonal}\n", |
332 | 334 | "for product, ds in datasets.items():\n", |
333 | 335 | " (da,) = ds.data_vars.values()\n", |
| 336 | + " da = da.sel(month=month_order)\n", |
334 | 337 | " if \"realization\" in da.dims:\n", |
335 | 338 | " da = da.mean(\"realization\", keep_attrs=True)\n", |
336 | 339 | "\n", |
337 | | - " _ = plot.projected_map(da.mean(\"year\", keep_attrs=True), col=\"month\", col_wrap=3)\n", |
| 340 | + " _ = plot.projected_map(\n", |
| 341 | + " da.mean(\"year\", keep_attrs=True), col=\"month\", col_wrap=3, robust=True\n", |
| 342 | + " )\n", |
338 | 343 | " plt.suptitle(f\"{product = }\")\n", |
339 | 344 | " plt.show()\n", |
340 | 345 | "\n", |
|
0 commit comments