diff --git a/PRR/PRR_STAC_introduction.ipynb b/PRR/PRR_STAC_introduction.ipynb
old mode 100644
new mode 100755
index 5358ac7..b83401e
--- a/PRR/PRR_STAC_introduction.ipynb
+++ b/PRR/PRR_STAC_introduction.ipynb
@@ -1,22 +1,15 @@
{
"cells": [
{
- "attachments": {},
"cell_type": "markdown",
- "id": "98522825",
+ "id": "244d8027",
"metadata": {},
"source": [
"# Generating STAC metadata for the OHC 4d Atlantic dataset\n",
"\n",
"## Introduction\n",
- "\n"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "37e5c0b6-5751-4391-af1f-7fe848dc8939",
- "metadata": {},
- "source": [
+ "\n",
+ "\n",
"This notebook has been created to show the core steps required of EarthCODE users to upload their research outcomes to the [ESA Project Results Repository (PRR)](https://eoresults.esa.int/). It focuses on generating metadata for a project with a single `netcdf` file. Checkout the other projects on the webpage for more complex examples.\n",
"\n",
"PRR provides access to data, workflows, experiments and documentation from ESA Projects organised across Collections, accessible via the [STAC API](https://github.com/radiantearth/stac-api-spec). Each Collection contains [STAC Items](https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md), with their related Assets stored within the PRR storage. Scientists/commercial companies can access the PRR via the [EarthCODE](https://earthcode.esa.int/) and [APEx](https://esa-apex.github.io/apex_documentation/) projects.\n",
@@ -35,14 +28,9 @@
"Have a look at the steps below and learn how to prepare your dataset to generate a valid STAC Collection. You will find all the steps descibed in the markdown cell, together with the example code (executable) to make this process easier. Please adjust the information in the fields required to describe your Collection and Items according to the comments, starting with : \"#\" \n",
"\n",
"\n",
- "*NOTE: Depending on the information that you put in the Assets or Items the code, you may get an error about an object not being json-serialisable. If this happens, you have to transform the problem field into an object that can be described using standard JSON. For example, transforming a numpy array into a list.*"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "a72de0f8",
- "metadata": {},
- "source": [
+ "*NOTE: Depending on the information that you put in the Assets or Items the code, you may get an error about an object not being json-serialisable. If this happens, you have to transform the problem field into an object that can be described using standard JSON. For example, transforming a numpy array into a list.*\n",
+ "\n",
+ "\n",
"## 🌊 Example: 4DATLANTIC-OHC Project\n",
"\n",
"The code below demonstrates how to perform the necessary steps using real data from the ESA Regional Initiative Project **4DATLANTIC-OHC**. The project focuses on ocean heat content and provides monthly gridded Atlantic Ocean heat content change as well as OHC trends and their uncertainties.\n",
@@ -53,28 +41,22 @@
"#### Acknowledgment \n",
"We gratefully acknowledge the **4DATLANTIC-OHC project team** for providing access to the data used in this example. \n",
"\n",
- "> This example is intended to help you understand the workflow and apply similar steps to your own Earth observation data analysis. "
- ]
- },
- {
- "cell_type": "markdown",
- "id": "f3f344c3-c98b-45c9-9991-a0c010e2e722",
- "metadata": {},
- "source": [
+ "> This example is intended to help you understand the workflow and apply similar steps to your own Earth observation data analysis. \n",
+ "\n",
"## Import necessary Python libraries\n",
"\n",
"You can create an example conda/miniconda enviroment to run the below code using:\n",
"\n",
"```bash\n",
- "conda create -n prr_stack_example pystac xarray shapely\n",
+ "conda create -c conda-forge -n prr_stack_example pystac xarray shapely xstac \n",
"conda activate prr_stack_example\n",
"```"
]
},
{
"cell_type": "code",
- "execution_count": 1,
- "id": "2b14427f",
+ "execution_count": 12,
+ "id": "df7f0d13",
"metadata": {},
"outputs": [],
"source": [
@@ -89,7 +71,7 @@
},
{
"cell_type": "markdown",
- "id": "15decbb5",
+ "id": "39f858b5",
"metadata": {},
"source": [
"## 1. Generate a root STAC collection\n",
@@ -137,18 +119,10 @@
"```"
]
},
- {
- "cell_type": "markdown",
- "id": "773c4af0-7901-4132-9b7e-66455ff34622",
- "metadata": {},
- "source": [
- "##### Example | Create Collection "
- ]
- },
{
"cell_type": "code",
"execution_count": 2,
- "id": "34928d44",
+ "id": "d8a2a61b",
"metadata": {},
"outputs": [
{
@@ -221,7 +195,7 @@
" \n",
"
\n",
" description\n",
- " \"Given the major role of the Atlantic Ocean in the climate system, it is essential to characterize the temporal and spatial variations of its heat content. The OHC product results from the space geodetic approach also called altimetry-gravimetry approach. This dataset contains variables as 3D grids of ocean heat content anomalies at 1x1 resolution and monthly time step. Error variance-covariance matrices of OHC at regional scale and annual resolution are also provided. See Experimental Dataset Description for details: https://www.aviso.altimetry.fr/fileadmin/documents/data/tools/OHC-EEI/OHCATL-DT-035-MAG_EDD_V2.0.pdf.Version. V2-0 of Dataset published 2022 in Centre National d’Etudes Spatiales. This dataset has been produced within the framework of the 4DAtlantic-Ocean heat content Project funded by ESA.\"\n",
+ " \"Given the major role of the ocean in the climate system, it is essential to characterize the temporal and spatial variations of its heat content. The OHC product results from the space geodetic approach also called altimetry-gravimetry approach. This dataset contains variables as 3D grids of ocean heat content anomalies at 1x1 resolution and monthly time step. Error variance-covariance matrices of OHC at regional scale and annual resolution are also provided. See Experimental Dataset Description for details: https://www.aviso.altimetry.fr/fileadmin/documents/data/tools/OHC-EEI/OHCATL-DT-035-MAG_EDD_V3.0.pdf. Version V3-0 of Dataset published 2025 in ODATIS-AVISO portal. This dataset has been produced within the framework of the 4DAtlantic-Ocean heat content Project funded by ESA.\"\n",
"
\n",
" \n",
" \n",
@@ -423,14 +397,14 @@
" \"type\": \"Collection\",\n",
" \"id\": collectionid,\n",
" \"stac_version\": \"1.1.0\",\n",
- " \"title\": \"Atlantic Ocean heat content change\",\n",
- " \"description\": \"Given the major role of the Atlantic Ocean in the climate system, it is essential to characterize the temporal and spatial variations of its heat content. The OHC product results from the space geodetic approach also called altimetry-gravimetry approach. This dataset contains variables as 3D grids of ocean heat content anomalies at 1x1 resolution and monthly time step. Error variance-covariance matrices of OHC at regional scale and annual resolution are also provided. See Experimental Dataset Description for details: https://www.aviso.altimetry.fr/fileadmin/documents/data/tools/OHC-EEI/OHCATL-DT-035-MAG_EDD_V2.0.pdf.Version. V2-0 of Dataset published 2022 in Centre National d’Etudes Spatiales. This dataset has been produced within the framework of the 4DAtlantic-Ocean heat content Project funded by ESA.\",\n",
+ " \"title\": \"Ocean heat content change\",\n",
+ " \"description\": \"Given the major role of the ocean in the climate system, it is essential to characterize the temporal and spatial variations of its heat content. The OHC product results from the space geodetic approach also called altimetry-gravimetry approach. This dataset contains variables as 3D grids of ocean heat content anomalies at 1x1 resolution and monthly time step. Error variance-covariance matrices of OHC at regional scale and annual resolution are also provided. See Experimental Dataset Description for details: https://www.aviso.altimetry.fr/fileadmin/documents/data/tools/OHC-EEI/OHCATL-DT-035-MAG_EDD_V3.0.pdf. Version V3-0 of Dataset published 2025 in ODATIS-AVISO portal. This dataset has been produced within the framework of the 4DAtlantic-Ocean heat content Project funded by ESA.\",\n",
" \"extent\": {\n",
" \"spatial\": {\n",
" \"bbox\": [\n",
- " [-100, \n",
+ " [-180, \n",
" -90, \n",
- " 25,\n",
+ " 180,\n",
" 90]\n",
" ]\n",
" },\n",
@@ -438,7 +412,7 @@
" \"interval\": [\n",
" [\n",
" \"2002-04-15T18:07:12Z\",\n",
- " \"2023-09-01T18:59:59Z\"\n",
+ " \"2023-09-16T18:59:59Z\"\n",
" ]\n",
" ]\n",
" }\n",
@@ -455,7 +429,7 @@
},
{
"cell_type": "markdown",
- "id": "eac26a0d",
+ "id": "76bee19f",
"metadata": {},
"source": [
"## 2. Group your dataset files into STAC Items and STAC Assets\n",
@@ -478,21 +452,11 @@
"The easiest way to generate the required STAC Items is to copy over the metadata directly from your files.\n"
]
},
- {
- "cell_type": "markdown",
- "id": "e819c745-e64a-4e47-9ee0-564c1c3545fd",
- "metadata": {},
- "source": [
- "##### Example | Open Dataset"
- ]
- },
{
"cell_type": "code",
"execution_count": 3,
- "id": "c2a28021",
- "metadata": {
- "scrolled": true
- },
+ "id": "af362c2a",
+ "metadata": {},
"outputs": [
{
"data": {
@@ -940,40 +904,40 @@
" filter: drop-shadow(1px 1px 5px var(--xr-font-color2));\n",
" stroke-width: 0.8px;\n",
"}\n",
- "
This is a container variable that describes the grid_mapping used by the data in this file. This variable does not contain any data;only information about the geographic coordinate system.
regional ocean heat content from the space geodetic approach - derived from the regional thermosteric sea level change using a regional expansion efficiency of heat coefficients
actual_range :
[-1.41594626e+10 1.38967666e+11]
[5602500 values with dtype=float64]
ohc_mask
(time)
float64
...
long_name :
ocean_heat_content_mask
units :
1
comment :
mask to apply on OHC data for masking interpolated data ( 1 for observed data and 0 for extrapolated data)
[249 values with dtype=float64]
ohc_var_covar_matrix_local
(time_covar, time_covar_2, latitude, longitude)
float64
...
units :
J2 m-4
unit_long :
square joules per meter to the power of 4
long_name :
variance covariance matrix of errors on regional ocean heat content
comment :
variance covariance matrix of errors on regional ocean heat content time-series
This is a container variable that describes the grid_mapping used by the data in this file. This variable does not contain any data;only information about the geographic coordinate system.
regional ocean heat content from the space geodetic approach - derived from the regional thermosteric sea level change using a regional expansion efficiency of heat coefficients
actual_range :
[-1.58893343e+10 2.11032010e+11]
[16718400 values with dtype=float64]
ohc_mask
(time)
float64
...
long_name :
ocean_heat_content_mask
units :
1
comment :
mask to apply on OHC data for masking interpolated data ( 1 for observed data and 0 for extrapolated data)
[258 values with dtype=float64]
ohc_var_covar_matrix_local
(time_covar, time_covar_2, latitude, longitude)
float64
...
units :
J2 m-4
unit_long :
square joules per meter to the power of 4
long_name :
variance covariance matrix of errors on regional ocean heat content
comment :
variance covariance matrix of errors on regional ocean heat content time-series
The OHC product results from the space geodetic approach also called “altimetry-gravimetry” approach. This file contains variables as 3D grids of ocean heat content anomalies at 1x1° resolution and monthly time step. Error variance-covariance matrices of OHC at regional scale and annual resolution are also provided. See Experimental Dataset Description for details.
start_date :
2002-04-15
end_date :
2022-12-16
version :
2.0
comment :
See technical documentation ATBD and EDD, and peer-review article Marti et al, 2022 https://doi.org/10.5194/essd-2021-220 for more information.
The OHC product results from the space geodetic approach also called “altimetry-gravimetry” approach. This file contains variables as 3D grids of ocean heat content anomalies at 1x1° resolution and monthly time step. Error variance-covariance matrices of OHC at regional scale and annual resolution are also provided. See Experimental Dataset Description for details.
start_date :
2002-04-15
end_date :
2023-09-16
version :
3.0
comment :
See technical documentation ATBD and EDD, and peer-review article Marti et al, 2022 https://doi.org/10.5194/essd-2021-220 for more information.
\n",
" \n",
" \n",
@@ -2864,18 +2791,18 @@
""
]
},
- "execution_count": 10,
+ "execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
- "item # Preview created Item"
+ "item"
]
},
{
"cell_type": "markdown",
- "id": "18faee04",
+ "id": "79720945",
"metadata": {},
"source": [
"# 3. Add the STAC Item to the STAC Collection\n",
@@ -2885,8 +2812,8 @@
},
{
"cell_type": "code",
- "execution_count": 11,
- "id": "a2afb86e",
+ "execution_count": 8,
+ "id": "e532b1e6",
"metadata": {},
"outputs": [
{
@@ -2963,7 +2890,7 @@
">"
]
},
- "execution_count": 11,
+ "execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
@@ -2974,31 +2901,31 @@
},
{
"cell_type": "markdown",
- "id": "f87dcb7f",
+ "id": "1639262c",
"metadata": {},
"source": [
" # 4. Save the Collection\n",
"\n",
- " Again this step is a single function call.\n"
+ " Again this step is a single function call."
]
},
{
"cell_type": "code",
- "execution_count": 12,
- "id": "eba7b73a",
+ "execution_count": 10,
+ "id": "721c7d27",
"metadata": {},
"outputs": [],
"source": [
"collection.normalize_and_save(\n",
- " root_href='example_4datlantic/', # path to the self-contained folder with STAC Collection\n",
+ " root_href='../../prr_preview/', # path to the self-contained folder with STAC Collection\n",
" catalog_type=pystac.CatalogType.SELF_CONTAINED\n",
")"
]
},
{
"cell_type": "code",
- "execution_count": 13,
- "id": "1affe3d2-28a0-4029-9a6f-a171cff8e419",
+ "execution_count": 11,
+ "id": "220ec444",
"metadata": {},
"outputs": [
{
@@ -3071,7 +2998,7 @@
" \n",
"
\n",
" description\n",
- " \"Given the major role of the Atlantic Ocean in the climate system, it is essential to characterize the temporal and spatial variations of its heat content. The OHC product results from the space geodetic approach also called altimetry-gravimetry approach. This dataset contains variables as 3D grids of ocean heat content anomalies at 1x1 resolution and monthly time step. Error variance-covariance matrices of OHC at regional scale and annual resolution are also provided. See Experimental Dataset Description for details: https://www.aviso.altimetry.fr/fileadmin/documents/data/tools/OHC-EEI/OHCATL-DT-035-MAG_EDD_V2.0.pdf.Version. V2-0 of Dataset published 2022 in Centre National d’Etudes Spatiales. This dataset has been produced within the framework of the 4DAtlantic-Ocean heat content Project funded by ESA.\"\n",
+ " \"Given the major role of the ocean in the climate system, it is essential to characterize the temporal and spatial variations of its heat content. The OHC product results from the space geodetic approach also called altimetry-gravimetry approach. This dataset contains variables as 3D grids of ocean heat content anomalies at 1x1 resolution and monthly time step. Error variance-covariance matrices of OHC at regional scale and annual resolution are also provided. See Experimental Dataset Description for details: https://www.aviso.altimetry.fr/fileadmin/documents/data/tools/OHC-EEI/OHCATL-DT-035-MAG_EDD_V3.0.pdf. Version V3-0 of Dataset published 2025 in ODATIS-AVISO portal. This dataset has been produced within the framework of the 4DAtlantic-Ocean heat content Project funded by ESA.\"\n",
"
\n",
" \n",
" \n",
@@ -3391,7 +3318,7 @@
""
]
},
- "execution_count": 13,
+ "execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
@@ -3402,11 +3329,9 @@
},
{
"cell_type": "markdown",
- "id": "404d041e-742c-4134-812e-79f1e71b930d",
+ "id": "af820e73",
"metadata": {},
"source": [
- "##### Congratulations, you have created your first STAC Collection. \n",
- "\n",
"\n",
"Now, you have your results ready to be ingested into ESA PRR. To request data storage in ESA PRR, contact EarthCODE team at: earth-code@esa.int and provide following information:\n",
"\n",
@@ -3422,13 +3347,19 @@
"\n",
"Once the collection is imported you will receive a dedicated URL to your products, which you can use to create the record on Open Science Data Catalogue to make your data discoverable or/and request a DOI for your dataset (at the moment this has to be done by external service of your choice). "
]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "b22f5724",
+ "metadata": {},
+ "source": []
}
],
"metadata": {
"kernelspec": {
- "display_name": "Python [conda env:micromamba-pangeo] *",
+ "display_name": "pangeo",
"language": "python",
- "name": "conda-env-micromamba-pangeo-py"
+ "name": "python3"
},
"language_info": {
"codemirror_mode": {