Skip to content

Commit

Permalink
MNT: update notebooks to xradar >=0.8.0 and xarray>=2024.10.0 (#95)
Browse files Browse the repository at this point in the history
* MNT: update to xradar >=0.8.0 and xarray>=2024.10.0
* FIX: add packages, fix recipe4.ipynb
  • Loading branch information
kmuehlbauer authored Nov 6, 2024
1 parent 547bdff commit bd7acab
Show file tree
Hide file tree
Showing 10 changed files with 117 additions and 81 deletions.
2 changes: 2 additions & 0 deletions ci/requirements/notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ dependencies:
- h5py
- h5netcdf
- lat_lon_parser
- libgdal-hdf5
- libgdal-netcdf
- nbconvert
- nc-time-axis
- netCDF4
Expand Down
26 changes: 11 additions & 15 deletions notebooks/classify/clutter_cloud.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@
" plt.ion()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -79,10 +72,11 @@
"metadata": {},
"outputs": [],
"source": [
"pvol = pvol.filter(lambda x: \"sweep\" in x.name)\n",
"pvol1 = pvol.match(\"sweep*\")\n",
"display(pvol1)\n",
"vol = []\n",
"for sweep in pvol.values():\n",
" vol.append(sweep.ds.pipe(wrl.georef.georeference))\n",
"for sweep in pvol1.values():\n",
" vol.append(sweep.to_dataset().pipe(wrl.georef.georeference))\n",
"vol = xr.concat(vol, dim=\"tilt\")\n",
"vol = vol.assign_coords(sweep_mode=vol.sweep_mode)\n",
"display(vol)"
Expand Down Expand Up @@ -232,18 +226,20 @@
"\n",
"ax = fig.add_subplot(131)\n",
"pm = vol.DBZH[tilt].wrl.vis.plot(ax=ax)\n",
"plt.colorbar(pm, shrink=0.5)\n",
"# plt.colorbar(pm, shrink=0.5)\n",
"plt.title(\"Radar reflectivity\")\n",
"\n",
"ax = fig.add_subplot(132)\n",
"pm = vol.sat[tilt].wrl.vis.plot(ax=ax)\n",
"plt.colorbar(pm, shrink=0.5)\n",
"# plt.colorbar(pm, shrink=0.5)\n",
"plt.title(\"Satellite cloud classification\")\n",
"\n",
"ax = fig.add_subplot(133)\n",
"pm = vol.clutter[tilt].wrl.vis.plot(ax=ax)\n",
"plt.colorbar(pm, shrink=0.5)\n",
"plt.title(\"Detected clutter\")"
"# plt.colorbar(pm, shrink=0.5)\n",
"plt.title(\"Detected clutter\")\n",
"\n",
"fig.tight_layout()"
]
}
],
Expand All @@ -258,7 +254,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.12.4"
},
"toc": {
"colors": {
Expand Down
3 changes: 1 addition & 2 deletions notebooks/fileio/backends/cfradial1_backend.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import xradar as xd\n",
"import datatree as xt\n",
"import xarray as xr\n",
"\n",
"try:\n",
Expand Down Expand Up @@ -225,7 +224,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.12.4"
}
},
"nbformat": 4,
Expand Down
5 changes: 2 additions & 3 deletions notebooks/fileio/backends/cfradial2_backend.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import xradar as xd\n",
"import datatree as xt\n",
"import xarray as xr\n",
"\n",
"try:\n",
Expand All @@ -58,7 +57,7 @@
"source": [
"fpath = \"netcdf/cfrad.20080604_002217_000_SPOL_v36_SUR_cfradial2.nc\"\n",
"f = wrl.util.get_wradlib_data_file(fpath)\n",
"vol = xt.open_datatree(f)"
"vol = xr.open_datatree(f)"
]
},
{
Expand Down Expand Up @@ -207,7 +206,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.12.4"
}
},
"nbformat": 4,
Expand Down
3 changes: 1 addition & 2 deletions notebooks/fileio/backends/furuno_backend.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import xradar as xd\n",
"import datatree as xt\n",
"import xarray as xr\n",
"\n",
"try:\n",
Expand Down Expand Up @@ -367,7 +366,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.12.4"
}
},
"nbformat": 4,
Expand Down
3 changes: 1 addition & 2 deletions notebooks/fileio/backends/gamic_backend.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import xradar as xd\n",
"import datatree as xt\n",
"import xarray as xr\n",
"\n",
"try:\n",
Expand Down Expand Up @@ -220,7 +219,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.12.4"
}
},
"nbformat": 4,
Expand Down
3 changes: 1 addition & 2 deletions notebooks/fileio/backends/iris_backend.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import xradar as xd\n",
"import datatree as xt\n",
"import xarray as xr\n",
"\n",
"try:\n",
Expand Down Expand Up @@ -213,7 +212,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.12.4"
}
},
"nbformat": 4,
Expand Down
10 changes: 1 addition & 9 deletions notebooks/fileio/backends/odim_backend.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import xradar as xd\n",
"import datatree as xt\n",
"import xarray as xr\n",
"\n",
"try:\n",
Expand Down Expand Up @@ -220,13 +219,6 @@
")\n",
"display(ts)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -240,7 +232,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.12.4"
}
},
"nbformat": 4,
Expand Down
3 changes: 1 addition & 2 deletions notebooks/fileio/backends/rainbow_backend.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import xradar as xd\n",
"import datatree as xt\n",
"import xarray as xr\n",
"\n",
"try:\n",
Expand Down Expand Up @@ -213,7 +212,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.12.4"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit bd7acab

Please sign in to comment.