diff --git a/examples/notebooks/velocity.ipynb b/examples/notebooks/velocity.ipynb index 5f86db4830..75f4907f48 100644 --- a/examples/notebooks/velocity.ipynb +++ b/examples/notebooks/velocity.ipynb @@ -6,8 +6,6 @@ "metadata": {}, "source": [ "You will need to install the following packages:\n", - "- `ipyleaflet`\n", - "- `requests`\n", "- `xarray`\n", "- `netcdf4`\n", "- `geemap`" @@ -20,7 +18,16 @@ "metadata": {}, "outputs": [], "source": [ - "from ipyleaflet import TileLayer, basemaps\n", + "# %pip install geemap xarray netcdf4" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "2", + "metadata": {}, + "outputs": [], + "source": [ "from ipyleaflet.velocity import Velocity\n", "import xarray as xr\n", "import geemap" @@ -29,17 +36,17 @@ { "cell_type": "code", "execution_count": null, - "id": "2", + "id": "3", "metadata": {}, "outputs": [], "source": [ - "center = [44.33956524809713, -130.60546875000003]\n", + "center = [44.339565, -130.605468]\n", "zoom = 3\n", "m = geemap.Map(\n", " center=center,\n", " zoom=zoom,\n", " interpolation=\"nearest\",\n", - " basemap=basemaps.CartoDB.DarkMatter,\n", + " basemap=\"CartoDB.DarkMatter\",\n", " add_google_map=False,\n", " ee_initialize=False,\n", ")\n", @@ -49,26 +56,18 @@ { "cell_type": "code", "execution_count": null, - "id": "3", + "id": "4", "metadata": {}, "outputs": [], "source": [ - "import os\n", - "\n", - "if not os.path.exists(\"wind_global.nc\"):\n", - " url = \"https://github.com/benbovy/xvelmap/raw/master/notebooks/wind_global.nc\"\n", - " import requests\n", - "\n", - " r = requests.get(url)\n", - " wind_data = r.content\n", - " with open(\"wind_global.nc\", \"wb\") as f:\n", - " f.write(wind_data)" + "url = \"https://github.com/gee-community/geemap/raw/master/examples/data/wind_global.nc\"\n", + "geemap.download_file(url, \"wind_global.nc\")" ] }, { "cell_type": "code", "execution_count": null, - "id": "4", + "id": "5", "metadata": {}, "outputs": [], "source": [ @@ -79,7 +78,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5", + "id": "6", "metadata": {}, "outputs": [], "source": [ @@ -100,14 +99,6 @@ ")\n", "m.add_layer(wind)" ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "6", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { @@ -115,6 +106,18 @@ "display_name": "Python 3", "language": "python", "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.8" } }, "nbformat": 4,