|
117 | 117 | "`````{admonition} Find more info about the libraries used in this workflow here\n", |
118 | 118 | ":class: hint dropdown\n", |
119 | 119 | "In this notebook, we will use the following Python libraries:\n", |
| 120 | + "\n", |
120 | 121 | "- [os](https://docs.python.org/3/library/os.html) - Provides a way to interact with the operating system, allowing the creation of directories and file manipulation.\n", |
| 122 | + "- [urllib.parse](https://docs.python.org/3/library/urllib.parse.html) - URL operations.\n", |
121 | 123 | "- [numpy](https://numpy.org/) - A powerful library for numerical computations in Python, widely used for array operations and mathematical functions.\n", |
122 | 124 | "- [pandas](https://pandas.pydata.org/) - A data manipulation and analysis library, essential for working with structured data in tabular form.\n", |
123 | 125 | "- [rasterio](https://rasterio.readthedocs.io/en/stable/) - A library for reading and writing geospatial raster data, providing functionalities to explore and manipulate raster datasets.\n", |
124 | 126 | "- [xarray](https://docs.xarray.dev/en/stable/) - library for working with labelled multi-dimensional arrays.\n", |
125 | 127 | "- [rioxarray](https://corteva.github.io/rioxarray/stable/) - An extension of the xarray library that simplifies working with geospatial raster data in GeoTIFF format.\n", |
126 | 128 | "- [damagescanner](https://damagescanner.readthedocs.io/en/latest/#) - A library designed for calculating flood damages based on geospatial data, particularly suited for analyzing flood impact.\n", |
127 | 129 | "- [matplotlib](https://matplotlib.org/) - A versatile plotting library in Python, commonly used for creating static, animated, and interactive visualizations.\n", |
128 | | - "- [contextily](https://contextily.readthedocs.io/en/latest/) A library for adding basemaps to plots, enhancing geospatial visualizations.\n", |
129 | | - "- [cartopy](https://scitools.org.uk/cartopy/docs/latest/) A library for geospatial data processing.\n", |
130 | | - "\n", |
131 | | - "- [planetary-computer](https://pypi.org/project/planetary-computer/) A library for interacting with the Microsoft Planetary Computer.\n", |
132 | | - "- [dask](https://www.dask.org/) A library for parallel computing and task scheduling.\n", |
133 | | - "- [pystac-client](https://pystac-client.readthedocs.io/en/stable/) A library for for working with STAC Catalogs and APIs.\n", |
134 | | - "- [shapely](https://shapely.readthedocs.io/en/stable/index.html) A library for manipulation and analysis of geometric objects.\n", |
| 130 | + "- [contextily](https://contextily.readthedocs.io/en/latest/) - A library for adding basemaps to plots, enhancing geospatial visualizations.\n", |
| 131 | + "- [cartopy](https://scitools.org.uk/cartopy/docs/latest/) - A library for geospatial data processing.\n", |
| 132 | + "- [planetary-computer](https://pypi.org/project/planetary-computer/) - A library for interacting with the Microsoft Planetary Computer.\n", |
| 133 | + "- [dask](https://www.dask.org/) - A library for parallel computing and task scheduling.\n", |
| 134 | + "- [pystac-client](https://pystac-client.readthedocs.io/en/stable/) - A library for for working with STAC Catalogs and APIs.\n", |
| 135 | + "- [adlfs](https://github.com/fsspec/adlfs) - Interface to access data from Azure-Datalake storage.\n", |
| 136 | + "- [shapely](https://shapely.readthedocs.io/en/stable/index.html) - A library for manipulation and analysis of geometric objects.\n", |
135 | 137 | "\n", |
136 | 138 | "These libraries collectively enable the download, processing, analysis, and visualization of geospatial and numerical data.\n", |
137 | 139 | "`````" |
|
146 | 148 | "source": [ |
147 | 149 | "# Packages for downloading data and managing files\n", |
148 | 150 | "import os\n", |
| 151 | + "import urllib\n", |
149 | 152 | "import pystac_client\n", |
150 | 153 | "import planetary_computer\n", |
151 | 154 | "\n", |
|
302 | 305 | "metadata": {}, |
303 | 306 | "outputs": [], |
304 | 307 | "source": [ |
305 | | - "# select first item from the search and open the dataset \n", |
| 308 | + "# select the first item from the search and open the dataset \n", |
306 | 309 | "item = next(search.items())\n", |
307 | 310 | "url = item.assets[\"index\"].href\n", |
| 311 | + "\n", |
| 312 | + "# environment variables with authentication information for the data access\n", |
| 313 | + "token = urllib.parse.urlparse(planetary_computer.sign_url(url)).query\n", |
| 314 | + "os.environ[\"AZURE_STORAGE_SAS_TOKEN\"] = token\n", |
| 315 | + "os.environ[\"AZURE_STORAGE_ANON\"] = \"false\"\n", |
| 316 | + "os.environ[\"AZURE_STORAGE_ACCOUNT_NAME\"] = \"deltaresfloodssa\"\n", |
| 317 | + "\n", |
308 | 318 | "ds = xr.open_dataset(f\"reference::{url}\", engine=\"zarr\", consolidated=False, chunks={})" |
309 | 319 | ] |
310 | 320 | }, |
|
0 commit comments