Skip to content

Commit

Permalink
[docs] update nrb_cube.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
maawoo committed Jun 22, 2022
1 parent ec78c7a commit d474c77
Showing 1 changed file with 25 additions and 150 deletions.
175 changes: 25 additions & 150 deletions docs/examples/nrb_cube.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,30 @@
},
{
"cell_type": "markdown",
"id": "0dbebc0e-9154-462e-bea4-fee821eba0b1",
"id": "3f6989e9-a130-4a30-94ad-7aee6872200a",
"metadata": {},
"source": [
"**Sentinel-1 Normalised Radar Backscatter** \n",
"Sentinel-1 Normalised Radar Backscatter (S1-NRB) is a newly developed Analysis Ready Data (ARD) product for the European Space Agency that offers high-quality, radiometrically terrain corrected (RTC) Synthetic Aperture Radar (SAR) backscatter and is designed to be compliant with the CEOS ARD for Land (CARD4L) [NRB specification](https://ceos.org/ard/files/PFS/NRB/v5.5/CARD4L-PFS_NRB_v5.5.pdf).\n",
"You can find more detailed information about the S1-NRB product [here](https://sentinel.esa.int/web/sentinel/sentinel-1-ard-normalised-radar-backscatter-nrb-product). \n",
"This example notebook will give a short demonstration of how S1-NRB products can be explored as on-the-fly data cubes with little effort by utilizing the STAC metadata provided with each product. It is not intended to demonstrate how to process the S1-NRB products in the first place. For this information please refer to the [usage instructions](https://s1-nrb.readthedocs.io/en/docs/general/usage.html).\n",
"\n",
"**SpatioTemporal Asset Catalog (STAC)** \n",
"All S1-NRB products include metadata in JSON format compliant with the [SpatioTemporal Asset Catalog (STAC)](https://stacspec.org/) specification. \n",
"STAC uses several sub-specifications ([Item](https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md), [Collection](https://github.com/radiantearth/stac-spec/blob/master/collection-spec/collection-spec.md) & [Catalog](https://github.com/radiantearth/stac-spec/blob/master/catalog-spec/catalog-spec.md)) to create a hierarchical structure that enables efficient querying and access of large volumes of geospatial data."
"A lightning talk related to this topic has been given during the [Cloud-Native Geospatial Outreach Event 2022](https://medium.com/radiant-earth-insights/cloud-native-geospatial-outreach-2022-recap-and-videos-2a0e80085db7), which can be found [here](https://www.youtube.com/watch?v=NOwjDvB9-0k).\n",
"\n",
"Follow [this link](https://nbviewer.org/github/SAR-ARD/S1_NRB/blob/main/docs/examples/nrb_cube.ipynb) for a better visualization of this notebook!"
]
},
{
"cell_type": "markdown",
"id": "3f6989e9-a130-4a30-94ad-7aee6872200a",
"metadata": {},
"source": [
"**This example notebook will give a short demonstration of how S1-NRB products can be explored as on-the-fly data cubes with little effort by utilizing the STAC metadata provided with each product. It is not intended to demonstrate how to process the S1-NRB products in the first place. For this information please refer to the [usage instructions](https://s1-nrb.readthedocs.io/en/docs/general/usage.html).**"
]
"**Sentinel-1 Normalised Radar Backscatter**\n",
"Sentinel-1 Normalised Radar Backscatter (S1-NRB) is a newly developed Analysis Ready Data (ARD) product for the European Space Agency that offers high-quality, radiometrically terrain corrected (RTC) Synthetic Aperture Radar (SAR) backscatter and is designed to be compliant with the CEOS ARD for Land (CARD4L) [NRB specification](https://ceos.org/ard/files/PFS/NRB/v5.5/CARD4L-PFS_NRB_v5.5.pdf).\n",
"You can find more detailed information about the S1-NRB product [here](https://sentinel.esa.int/web/sentinel/sentinel-1-ard-normalised-radar-backscatter-nrb-product).\n",
"\n",
"**SpatioTemporal Asset Catalog (STAC)**\n",
"All S1-NRB products include metadata in JSON format compliant with the [SpatioTemporal Asset Catalog (STAC)](https://stacspec.org/) specification.\n",
"STAC uses several sub-specifications ([Item](https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md), [Collection](https://github.com/radiantearth/stac-spec/blob/master/collection-spec/collection-spec.md) & [Catalog](https://github.com/radiantearth/stac-spec/blob/master/catalog-spec/catalog-spec.md)) to create a hierarchical structure that enables efficient querying and access of large volumes of geospatial data."
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "markdown",
Expand All @@ -56,34 +61,14 @@
"id": "8785c0a0-ddad-4c87-87e7-8c71513dd5a9",
"metadata": {},
"source": [
"After following the [installation instructions](https://s1-nrb.readthedocs.io/en/latest/general/installation.html) you need to install a few additional packages into the activated conda environment to reproduce all steps presented in the following example notebook.\n",
"After following the [installation instructions](https://s1-nrb.readthedocs.io/en/latest/general/installation.html) you need to install an additional package into the activated conda environment:\n",
"\n",
"```bash\n",
"conda activate nrb_env \n",
"conda install jupyterlab stackstac rioxarray xarray_leaflet\n",
"conda install stackstac\n",
"```"
]
},
{
"cell_type": "markdown",
"id": "5d24fac3-d2e3-4982-b4c8-534b5ab80c00",
"metadata": {},
"source": [
"Instead of importing all packages now, they will successively be imported throughout the notebook:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "0c715895-9ddf-4025-af17-14e057a1e94f",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import stackstac\n",
"from S1_NRB.metadata.stac import make_catalog"
]
},
{
"cell_type": "markdown",
"id": "1a281480-43f3-4602-a684-34eb0477c0e9",
Expand Down Expand Up @@ -120,6 +105,10 @@
}
],
"source": [
"import numpy as np\n",
"import stackstac\n",
"from S1_NRB.metadata.stac import make_catalog\n",
"\n",
"nrb_catalog = make_catalog(directory='./NRB_thuringia', silent=True)"
]
},
Expand Down Expand Up @@ -1025,130 +1014,16 @@
{
"cell_type": "markdown",
"id": "25b1a9eb-f4b9-49c5-ac0c-645d08cab3f4",
"metadata": {},
"source": [
"As you can see in the output above, the collection of S1-NRB scenes was successfully loaded as an `xarray.DataArray`. The metadata attributes included in all STAC Items are now available as coordinate arrays (see [here](https://docs.xarray.dev/en/stable/user-guide/terminology.html#term-Coordinate) for clarification of Xarray's terminology) and can be utilized during analysis. This will be explored in the next section."
]
},
{
"cell_type": "markdown",
"id": "55505416-0ffb-4ed9-a7c7-cd94aa4b08ac",
"metadata": {
"tags": []
},
"source": [
"## Data Exploration\n",
"\n",
"*coming soon*"
]
},
{
"cell_type": "markdown",
"id": "6536fadd-4f22-42d8-b7bc-4f38f478f00b",
"metadata": {},
"source": [
"### Spatial"
]
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
"name": "#%% md\n"
}
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
},
{
"cell_type": "markdown",
"id": "cc3d212e-7486-45f1-aa06-7c5db8a2ee79",
"metadata": {},
"source": [
"### Temporal"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7f902aac-4b27-4425-9db0-5ec66fc30844",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "5ad47a84-ce79-442c-af53-d4be0cd9c745",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "5c5bc5c0-a29a-4194-a688-11b9bbfa0f8d",
"metadata": {},
"source": [
"### Bands / Attributes"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a5199074-ef3e-4fad-ad4f-87def08f1d4e",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "f2c6d2a9-5a13-46e4-8a3c-8058d1d78d0c",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"id": "4215bd35-f134-41f9-9212-406cf8ed6c89",
"metadata": {
"tags": []
},
"source": [
"## Example Analysis\n",
"As you can see in the output above, the collection of S1-NRB scenes was successfully loaded as an `xarray.DataArray`. The metadata attributes included in all STAC Items are now available as coordinate arrays (see [here](https://docs.xarray.dev/en/stable/user-guide/terminology.html#term-Coordinate) for clarification of Xarray's terminology) and can be utilized during analysis.\n",
"\n",
"*coming soon*"
"It is now possible to explore and analyse the S1-NRB data cube. The most important tools in this regard are the already mentioned xarray and dask. Both are widely used and a lot of tutorials and videos can be found online, e.g. in the xarray Docs ([1](https://docs.xarray.dev/en/stable/user-guide/index.html), [2](https://docs.xarray.dev/en/stable/tutorials-and-videos.html)) or the [Pangeo Tutorial Gallery](https://gallery.pangeo.io/repos/pangeo-data/pangeo-tutorial-gallery/index.html)."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "06aa88a1-9315-48a9-b232-8dcfc7816035",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "07a87606-3fca-43d6-8742-36a4860ead05",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit d474c77

Please sign in to comment.