diff --git a/PRR/CareHeat_v2.ipynb b/PRR/CareHeat_v2.ipynb
new file mode 100644
index 00000000..6b39a7c5
--- /dev/null
+++ b/PRR/CareHeat_v2.ipynb
@@ -0,0 +1,1834 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "id": "1f92ff5a",
+ "metadata": {},
+ "source": [
+ "# ESA Project Results Repository: Generating STAC collections with zarr files\n",
+ "\n",
+ "This notebook shows how to generate a valid STAC collection, which is a requirement to upload research outcomes to the [ESA Project Results Repository (PRR)](https://eoresults.esa.int/). The code below demonstrates how to perform the necessary steps using real data from the ESA project **deteCtion and threAts of maRinE HEAT waves (CAREHeat)**. The focus of CAREHeat is to improve existing extreme marine heatwave(MHW) detection algorithms, contributing to a better understanding of their impacts.\n",
+ "\n",
+ "\n",
+ "Check the [EarthCODE documentation](https://earthcode.esa.int/), and [PRR STAC introduction example](https://esa-earthcode.github.io/examples/prr-stac-introduction) for a more general introduction to STAC and the ESA PRR.\n",
+ "\n",
+ "\n",
+ "\n",
+ "🔗 Check the project website: [deteCtion and threAts of maRinE HEAT waves (CAREHeat) – Website](https://https://careheat.org/)
\n",
+ "🔗 Check the eo4society page: [deteCtion and threAts of maRinE HEAT waves (CAREHeat) – eo4society](https://eo4society.esa.int/projects/careheat/)\n",
+ "\n",
+ "#### Acknowledgment \n",
+ "We gratefully acknowledge the **deteCtion and threAts of maRinE HEAT waves (CAREHeat)** for providing access to the data used in this example, as well as support in creating it."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "id": "3333ec9c",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# import libraries\n",
+ "import xarray as xr\n",
+ "from pystac import Item, Collection\n",
+ "import pystac\n",
+ "from datetime import datetime\n",
+ "from shapely.geometry import box, mapping\n",
+ "from xstac import xarray_to_stac\n",
+ "import glob\n",
+ "import json\n",
+ "import shapely\n",
+ "import numpy as np\n",
+ "import geopandas as gpd\n",
+ "import pandas as pd\n",
+ "import os"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "6161e2c3",
+ "metadata": {},
+ "source": [
+ "## 1. Generate the parent collection\n",
+ "\n",
+ "The root STAC Collection provides a general description of all project outputs which will be stored on the PRR.\n",
+ "The PRR STAC Collection template enforces some required fields that you need to provide in order to build its valid description. Most of these metadata fields should already be available and can be extracted from your data.\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "id": "4029fcb4-4298-4236-8413-923d6bf64c11",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "\n",
+ "
\n",
+ "
\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"Collection\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " id\n",
+ " \"careheat-marine-heatwaves-cold-spells\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " stac_version\n",
+ " \"1.1.0\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " description\n",
+ " \"Marine heatwaves (MHWs) and cold spells (MCSs) prepared by the National Research Council - Institute of Marine Sciences (CNR-ISMAR, Italy) within the ESA-funded CAREHeat project. The catalogues are based on the ESA-CCI sea surface temperature (SST) dataset (available from https://doi.org/10.24381/cds.cf608234) for the period 1982-2022, on a regular 1°x1° longitude-latitude grid.\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " links[] 0 items
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " title\n",
+ " \"Marine heatwaves and cold spells events based on ESA-CCI SSTs\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " extent
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " spatial
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " bbox[] 1 items
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 0[] 4 items
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " 0\n",
+ " -180\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " 1\n",
+ " -90\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " 2\n",
+ " 180\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " 3\n",
+ " 90\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " temporal
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " interval[] 1 items
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 0[] 2 items
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " 0\n",
+ " \"1982-01-01T00:00:00Z\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " 1\n",
+ " \"2022-12-31T23:59:59Z\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " license\n",
+ " \"CC-BY-4.0\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "execution_count": 2,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "# create the parent collection\n",
+ "collectionid = \"careheat-marine-heatwaves-cold-spells\"\n",
+ "\n",
+ "\n",
+ "collection = Collection.from_dict(\n",
+ " \n",
+ "{\n",
+ " \"type\": \"Collection\",\n",
+ " \"id\": collectionid,\n",
+ " \"stac_version\": \"1.1.0\",\n",
+ " \"title\": \"Marine heatwaves and cold spells events based on ESA-CCI SSTs\",\n",
+ " \"description\": \"Marine heatwaves (MHWs) and cold spells (MCSs) prepared by the National Research Council - Institute of Marine Sciences (CNR-ISMAR, Italy) within the ESA-funded CAREHeat project. The catalogues are based on the ESA-CCI sea surface temperature (SST) dataset (available from https://doi.org/10.24381/cds.cf608234) for the period 1982-2022, on a regular 1°x1° longitude-latitude grid.\",\n",
+ " \"extent\": {\n",
+ " \"spatial\": {\n",
+ " \"bbox\": [\n",
+ " [-180, -90, 180, 90]\n",
+ " ]\n",
+ " },\n",
+ " \"temporal\": {\n",
+ " \"interval\": [\n",
+ " [\n",
+ " \"1982-01-01T00:00:00Z\",\n",
+ " \"2022-12-31T23:59:59Z\"\n",
+ " ]\n",
+ " ]\n",
+ " }\n",
+ " },\n",
+ " \"license\": \"CC-BY-4.0\",\n",
+ " \"links\": []\n",
+ "\n",
+ "}\n",
+ "\n",
+ ")\n",
+ "\n",
+ "collection # visualise the metadata of your collection "
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "2ab07efc",
+ "metadata": {},
+ "source": [
+ "## 2. Create STAC Items and STAC Assets from original dataset \n",
+ "\n",
+ "The second step is to describe the different files as STAC Items and Assets. Take your time to decide how your data should be categorised to improve usability of the data, and ensure intuitive navigation through different items in the collections. There are multiple strategies for doing this and this tutorial demonstrate one of the possible ways of doing that. Examples of how other ESA projects are doing this are available in the [EarthCODE documentation](https://esa-earthcode.github.io/examples/prr-stac-introduction) ."
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "cf71e971-4b50-41ae-b70d-9ea8e15f92db",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "baseurl = './data/careheat-marine-heatwaves-cold-spells/'"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "id": "f3030914-50f9-493e-abfd-4f7cca4fb1ab",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "bbox = [-180, -90, 180, 90]\n",
+ "geometry = json.loads(json.dumps(shapely.box(*bbox).__geo_interface__))"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "id": "d13ee652-2b76-44f6-b7d1-1eaf69748a2e",
+ "metadata": {},
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "../../data/careheat-marine-heatwaves-cold-spells/CCI2D_1x1_ssa_MCS_categories_glo_1982-2022.nc\n",
+ "../../data/careheat-marine-heatwaves-cold-spells/CCI2D_1x1_ssa_MCS_metrics_glo_1982-2022.nc\n",
+ "../../data/careheat-marine-heatwaves-cold-spells/CCI2D_1x1_ssa_MHW_metrics_glo_1982-2022.nc\n",
+ "../../data/careheat-marine-heatwaves-cold-spells/CCI2D_1x1_ssa_MHW_categories_glo_1982-2022.nc\n",
+ "../../data/careheat-marine-heatwaves-cold-spells/CCI2D_1x1_MHW_categories_glo_1982-2022.nc\n",
+ "../../data/careheat-marine-heatwaves-cold-spells/CCI2D_1x1_MHW_metrics_glo_1982-2022.nc\n",
+ "../../data/careheat-marine-heatwaves-cold-spells/CCI2D_1x1_MCS_metrics_glo_1982-2022.nc\n",
+ "../../data/careheat-marine-heatwaves-cold-spells/CCI2D_1x1_MCS_categories_glo_1982-2022.nc\n"
+ ]
+ }
+ ],
+ "source": [
+ "from pathlib import Path\n",
+ "baseurl = Path('../../data/careheat-marine-heatwaves-cold-spells/')\n",
+ "files = list(baseurl.glob(\"*.nc\"))\n",
+ "\n",
+ "# Convert to POSIX-style strings\n",
+ "file_paths = [f.as_posix() for f in files]\n",
+ "\n",
+ "for file in file_paths:\n",
+ " print(file)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "ee61a0f7",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "for file in file_paths:\n",
+ "\n",
+ " # open the dataset and read metadata + convert to STAC\n",
+ " ds = xr.open_dataset(file)\n",
+ " detrended = 'Detrended (SSA) ' if '_ssa_' in file else ''\n",
+ " \n",
+ " template = {\n",
+ "\n",
+ " \"id\": f\"{collectionid}-{file.split('/')[-1][:-3].lower()}\",\n",
+ " \"type\": \"Feature\",\n",
+ " \"stac_version\": \"1.0.0\",\n",
+ " \"properties\": {\n",
+ " \"title\": detrended + ds.attrs['product'],\n",
+ " \"description\": detrended + ds.attrs['description'],\n",
+ " \"start_datetime\": pd.to_datetime(ds.attrs['climatologyPeriod'][0], format='%Y').strftime(\"%Y-%m-%dT%H:%M:%SZ\"),\n",
+ " \"end_datetime\": pd.to_datetime(ds.attrs['climatologyPeriod'][-1], format='%Y').strftime(\"%Y-%m-%dT%H:%M:%SZ\"),\n",
+ " \"license\": \"CC-BY-4.0\",\n",
+ " \"created\": pd.to_datetime(ds.attrs['date'], format='%Y-%m').strftime(\"%Y-%m-%dT%H:%M:%SZ\"),\n",
+ " \"git_information\": ds.attrs['git_information'],\n",
+ " \"website\": ds.attrs['website'],\n",
+ " \"version\": ds.attrs['version'],\n",
+ " \"changelog\": ds.attrs['changelog'],\n",
+ " \"institution\": ds.attrs['institution'],\n",
+ " \"author\": ds.attrs['author'],\n",
+ " \"contact\": ds.attrs['contact'],\n",
+ " },\n",
+ " \"geometry\": geometry,\n",
+ " \"bbox\": bbox,\n",
+ " \"assets\": {\n",
+ " \"data\": {\n",
+ " \"href\": f\"./{collectionid}/{file.split('/')[-1]}\", # or local path\n",
+ " \"type\": \"application/x-netcdf\",\n",
+ " \"roles\": [\"data\"],\n",
+ " \"title\": detrended + ds.attrs['product']\n",
+ " }\n",
+ " }\n",
+ " }\n",
+ " # 3. Generate the STAC Item\n",
+ " item = xarray_to_stac(\n",
+ " ds,\n",
+ " template,\n",
+ " temporal_dimension=\"time\" if 'time' in ds.coords else False,\n",
+ " x_dimension='lon',\n",
+ " y_dimension='lat',\n",
+ " reference_system=False\n",
+ " )\n",
+ "\n",
+ " # validate and add the STAC Item to the collection\n",
+ " item.validate()\n",
+ " collection.add_item(item)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "id": "2c2ee4de-afd1-41fb-9afd-73ccbfe8ef98",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "
\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"Collection\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " id\n",
+ " \"careheat-marine-heatwaves-cold-spells\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " stac_version\n",
+ " \"1.1.0\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " description\n",
+ " \"Marine heatwaves (MHWs) and cold spells (MCSs) prepared by the National Research Council - Institute of Marine Sciences (CNR-ISMAR, Italy) within the ESA-funded CAREHeat project. The catalogues are based on the ESA-CCI sea surface temperature (SST) dataset (available from https://doi.org/10.24381/cds.cf608234) for the period 1982-2022, on a regular 1°x1° longitude-latitude grid.\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " links[] 8 items
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 0
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " rel\n",
+ " \"item\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " href\n",
+ " None\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"application/geo+json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 1
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " rel\n",
+ " \"item\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " href\n",
+ " None\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"application/geo+json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 2
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " rel\n",
+ " \"item\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " href\n",
+ " None\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"application/geo+json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 3
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " rel\n",
+ " \"item\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " href\n",
+ " None\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"application/geo+json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 4
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " rel\n",
+ " \"item\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " href\n",
+ " None\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"application/geo+json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 5
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " rel\n",
+ " \"item\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " href\n",
+ " None\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"application/geo+json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 6
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " rel\n",
+ " \"item\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " href\n",
+ " None\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"application/geo+json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 7
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " rel\n",
+ " \"item\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " href\n",
+ " None\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"application/geo+json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " title\n",
+ " \"Marine heatwaves and cold spells events based on ESA-CCI SSTs\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " extent
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " spatial
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " bbox[] 1 items
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 0[] 4 items
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " 0\n",
+ " -180\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " 1\n",
+ " -90\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " 2\n",
+ " 180\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " 3\n",
+ " 90\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " temporal
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " interval[] 1 items
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 0[] 2 items
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " 0\n",
+ " \"1982-01-01T00:00:00Z\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " 1\n",
+ " \"2022-12-31T23:59:59Z\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " license\n",
+ " \"CC-BY-4.0\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "execution_count": 8,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "collection"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "id": "93172305",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "# save the full self-contained collection\n",
+ "collection.normalize_and_save(\n",
+ " root_href=f'../../prr_preview/{collectionid}',\n",
+ " catalog_type=pystac.CatalogType.SELF_CONTAINED\n",
+ ")"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "id": "6114f728-d75a-4447-87a9-673bf7b219ef",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "
\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"Collection\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " id\n",
+ " \"careheat-marine-heatwaves-cold-spells\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " stac_version\n",
+ " \"1.1.0\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " description\n",
+ " \"Marine heatwaves (MHWs) and cold spells (MCSs) prepared by the National Research Council - Institute of Marine Sciences (CNR-ISMAR, Italy) within the ESA-funded CAREHeat project. The catalogues are based on the ESA-CCI sea surface temperature (SST) dataset (available from https://doi.org/10.24381/cds.cf608234) for the period 1982-2022, on a regular 1°x1° longitude-latitude grid.\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " links[] 10 items
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 0
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " rel\n",
+ " \"root\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " href\n",
+ " \"/home/krasen/prr_preview/careheat-marine-heatwaves-cold-spells/collection.json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"application/json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " title\n",
+ " \"Marine heatwaves and cold spells events based on ESA-CCI SSTs\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 1
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " rel\n",
+ " \"item\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " href\n",
+ " \"/home/krasen/prr_preview/careheat-marine-heatwaves-cold-spells/careheat-marine-heatwaves-cold-spells-cci2d_1x1_ssa_mcs_categories_glo_1982-2022/careheat-marine-heatwaves-cold-spells-cci2d_1x1_ssa_mcs_categories_glo_1982-2022.json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"application/geo+json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 2
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " rel\n",
+ " \"item\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " href\n",
+ " \"/home/krasen/prr_preview/careheat-marine-heatwaves-cold-spells/careheat-marine-heatwaves-cold-spells-cci2d_1x1_ssa_mcs_metrics_glo_1982-2022/careheat-marine-heatwaves-cold-spells-cci2d_1x1_ssa_mcs_metrics_glo_1982-2022.json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"application/geo+json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 3
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " rel\n",
+ " \"item\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " href\n",
+ " \"/home/krasen/prr_preview/careheat-marine-heatwaves-cold-spells/careheat-marine-heatwaves-cold-spells-cci2d_1x1_ssa_mhw_metrics_glo_1982-2022/careheat-marine-heatwaves-cold-spells-cci2d_1x1_ssa_mhw_metrics_glo_1982-2022.json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"application/geo+json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 4
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " rel\n",
+ " \"item\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " href\n",
+ " \"/home/krasen/prr_preview/careheat-marine-heatwaves-cold-spells/careheat-marine-heatwaves-cold-spells-cci2d_1x1_ssa_mhw_categories_glo_1982-2022/careheat-marine-heatwaves-cold-spells-cci2d_1x1_ssa_mhw_categories_glo_1982-2022.json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"application/geo+json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 5
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " rel\n",
+ " \"item\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " href\n",
+ " \"/home/krasen/prr_preview/careheat-marine-heatwaves-cold-spells/careheat-marine-heatwaves-cold-spells-cci2d_1x1_mhw_categories_glo_1982-2022/careheat-marine-heatwaves-cold-spells-cci2d_1x1_mhw_categories_glo_1982-2022.json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"application/geo+json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 6
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " rel\n",
+ " \"item\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " href\n",
+ " \"/home/krasen/prr_preview/careheat-marine-heatwaves-cold-spells/careheat-marine-heatwaves-cold-spells-cci2d_1x1_mhw_metrics_glo_1982-2022/careheat-marine-heatwaves-cold-spells-cci2d_1x1_mhw_metrics_glo_1982-2022.json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"application/geo+json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 7
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " rel\n",
+ " \"item\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " href\n",
+ " \"/home/krasen/prr_preview/careheat-marine-heatwaves-cold-spells/careheat-marine-heatwaves-cold-spells-cci2d_1x1_mcs_metrics_glo_1982-2022/careheat-marine-heatwaves-cold-spells-cci2d_1x1_mcs_metrics_glo_1982-2022.json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"application/geo+json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 8
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " rel\n",
+ " \"item\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " href\n",
+ " \"/home/krasen/prr_preview/careheat-marine-heatwaves-cold-spells/careheat-marine-heatwaves-cold-spells-cci2d_1x1_mcs_categories_glo_1982-2022/careheat-marine-heatwaves-cold-spells-cci2d_1x1_mcs_categories_glo_1982-2022.json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"application/geo+json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 9
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " rel\n",
+ " \"self\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " href\n",
+ " \"/home/krasen/prr_preview/careheat-marine-heatwaves-cold-spells/collection.json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " type\n",
+ " \"application/json\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " title\n",
+ " \"Marine heatwaves and cold spells events based on ESA-CCI SSTs\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " extent
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " spatial
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " bbox[] 1 items
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 0[] 4 items
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " 0\n",
+ " -180\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " 1\n",
+ " -90\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " 2\n",
+ " 180\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " 3\n",
+ " 90\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " temporal
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " interval[] 1 items
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " 0[] 2 items
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " 0\n",
+ " \"1982-01-01T00:00:00Z\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " 1\n",
+ " \"2022-12-31T23:59:59Z\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " \n",
+ " - \n",
+ " license\n",
+ " \"CC-BY-4.0\"\n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ "
\n",
+ "
\n",
+ "
"
+ ],
+ "text/plain": [
+ ""
+ ]
+ },
+ "execution_count": 12,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "collection"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "5b716252",
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "pangeo",
+ "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.13.3"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}