From 2eadf552a8be74ff709f367d6d5cac129c4d2076 Mon Sep 17 00:00:00 2001 From: Sylvain Brunato Date: Tue, 26 Nov 2024 16:09:03 +0000 Subject: [PATCH 1/2] feat: geodes tutorial --- Geodes/Geodes.ipynb | 1746 +++++++++++++++++++++++++++++++++++++++ Geodes/requirements.txt | 2 + 2 files changed, 1748 insertions(+) create mode 100644 Geodes/Geodes.ipynb create mode 100644 Geodes/requirements.txt diff --git a/Geodes/Geodes.ipynb b/Geodes/Geodes.ipynb new file mode 100644 index 0000000..00a501c --- /dev/null +++ b/Geodes/Geodes.ipynb @@ -0,0 +1,1746 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "b12a9b7a-5038-4518-8ba2-80c830d9c855", + "metadata": {}, + "source": [ + "# Geodes with EODAG\n", + "\n", + "In this tutorial we will see how to use [EODAG](https://github.com/CS-SI/eodag) to search and download data on the [Geodes portal](https://geodes.cnes.fr).\n", + "\n", + "*Disable some warnings related to geodes SSL verification disabled*" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "604bfbb9-2625-4e20-a136-05289e2211bb", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "import requests\n", + "requests.packages.urllib3.disable_warnings() " + ] + }, + { + "cell_type": "markdown", + "id": "eb582e09-c760-426d-9346-670e82e3705f", + "metadata": {}, + "source": [ + "## 1. Credentials configuration\n", + "\n", + "As explained on [Provider registration - geodes](https://eodag.readthedocs.io/en/stable/getting_started_guide/register.html#geodes), go to https://geodes-portal.cnes.fr, then login or create an account by clicking on `Log in` in the top-right corner. \n", + "\n", + "Once logged-in, create an API key in the user settings page, and use it as `apikey` in EODAG provider auth credentials:" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "e8b4e1aa-c0b5-4124-b11d-61503a215093", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdin", + "output_type": "stream", + "text": [ + "Input apikey: ········\n" + ] + } + ], + "source": [ + "import os\n", + "from getpass import getpass\n", + "\n", + "os.environ[\"EODAG__GEODES__AUTH__CREDENTIALS__APIKEY\"] = getpass(\"Input apikey: \")" + ] + }, + { + "cell_type": "markdown", + "id": "269ee67b-543f-4b28-9bb7-702de3c12610", + "metadata": {}, + "source": [ + "## 2. Search\n", + "\n", + "Let's instantiate EODAG `EODataAccessGateway`" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "17fef1ed-a481-4abe-8868-a40f7b8bd79a", + "metadata": { + "tags": [] + }, + "outputs": [], + "source": [ + "from eodag import EODataAccessGateway\n", + "\n", + "dag = EODataAccessGateway()" + ] + }, + { + "cell_type": "markdown", + "id": "4f544f2d-96cc-4b7f-81f6-93887b7351de", + "metadata": {}, + "source": [ + "Then look for available product types on `geodes`" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "3a2f55cc-1427-4e23-b9a9-d8be859d13c9", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/plain": [ + "['FLATSIM_AFAR_AUXILIARYDATA_PUBLIC',\n", + " 'FLATSIM_AFAR_INTERFEROGRAM_PUBLIC',\n", + " 'FLATSIM_AFAR_TIMESERIE_PUBLIC',\n", + " 'FLATSIM_ANDES_AUXILIARYDATA_PUBLIC',\n", + " 'FLATSIM_ANDES_INTERFEROGRAM_PUBLIC',\n", + " 'FLATSIM_ANDES_TIMESERIE_PUBLIC',\n", + " 'FLATSIM_BALKANS_AUXILIARYDATA_PUBLIC',\n", + " 'FLATSIM_BALKANS_INTERFEROGRAM_PUBLIC',\n", + " 'FLATSIM_BALKANS_TIMESERIE_PUBLIC',\n", + " 'FLATSIM_CAUCASE_AUXILIARYDATA_PUBLIC',\n", + " 'FLATSIM_CAUCASE_INTERFEROGRAM_PUBLIC',\n", + " 'FLATSIM_CAUCASE_TIMESERIE_PUBLIC',\n", + " 'FLATSIM_CHILI_AUXILIARYDATA_PUBLIC',\n", + " 'FLATSIM_CHILI_INTERFEROGRAM_PUBLIC',\n", + " 'FLATSIM_CHILI_TIMESERIE_PUBLIC',\n", + " 'FLATSIM_CORSE_AUXILIARYDATA_PUBLIC',\n", + " 'FLATSIM_CORSE_INTERFEROGRAM_PUBLIC',\n", + " 'FLATSIM_CORSE_TIMESERIE_PUBLIC',\n", + " 'FLATSIM_FRANCE_AUXILIARYDATA_PUBLIC',\n", + " 'FLATSIM_FRANCE_INTERFEROGRAM_PUBLIC',\n", + " 'FLATSIM_FRANCE_TIMESERIE_PUBLIC',\n", + " 'FLATSIM_INDE_AUXILIARYDATA_PUBLIC',\n", + " 'FLATSIM_INDE_INTERFEROGRAM_PUBLIC',\n", + " 'FLATSIM_INDE_TIMESERIE_PUBLIC',\n", + " 'FLATSIM_LEVANT_AUXILIARYDATA_PUBLIC',\n", + " 'FLATSIM_LEVANT_INTERFEROGRAM_PUBLIC',\n", + " 'FLATSIM_LEVANT_TIMESERIE_PUBLIC',\n", + " 'FLATSIM_MAGHREB_AUXILIARYDATA_PUBLIC',\n", + " 'FLATSIM_MAGHREB_INTERFEROGRAM_PUBLIC',\n", + " 'FLATSIM_MAGHREB_TIMESERIE_PUBLIC',\n", + " 'FLATSIM_MAKRAN_AUXILIARYDATA_PUBLIC',\n", + " 'FLATSIM_MAKRAN_INTERFEROGRAM_PUBLIC',\n", + " 'FLATSIM_MAKRAN_TIMESERIE_PUBLIC',\n", + " 'FLATSIM_MEXIQUE_AUXILIARYDATA_PUBLIC',\n", + " 'FLATSIM_MEXIQUE_INTERFEROGRAM_PUBLIC',\n", + " 'FLATSIM_MEXIQUE_TIMESERIE_PUBLIC',\n", + " 'FLATSIM_MOZAMBIQUE_AUXILIARYDATA_PUBLIC',\n", + " 'FLATSIM_MOZAMBIQUE_INTERFEROGRAM_PUBLIC',\n", + " 'FLATSIM_MOZAMBIQUE_TIMESERIE_PUBLIC',\n", + " 'FLATSIM_OKAVANGO_AUXILIARYDATA_PUBLIC',\n", + " 'FLATSIM_OKAVANGO_INTERFEROGRAM_PUBLIC',\n", + " 'FLATSIM_OKAVANGO_TIMESERIE_PUBLIC',\n", + " 'FLATSIM_OZARK_AUXILIARYDATA_PUBLIC',\n", + " 'FLATSIM_OZARK_INTERFEROGRAM_PUBLIC',\n", + " 'FLATSIM_OZARK_TIMESERIE_PUBLIC',\n", + " 'FLATSIM_SHOWCASE_AUXILIARYDATA_PUBLIC',\n", + " 'FLATSIM_SHOWCASE_INTERFEROGRAM_PUBLIC',\n", + " 'FLATSIM_SHOWCASE_TIMESERIE_PUBLIC',\n", + " 'FLATSIM_TARIM_AUXILIARYDATA_PUBLIC',\n", + " 'FLATSIM_TARIM_INTERFEROGRAM_PUBLIC',\n", + " 'FLATSIM_TARIM_TIMESERIE_PUBLIC',\n", + " 'FLATSIM_TIANSHAN_AUXILIARYDATA_PUBLIC',\n", + " 'FLATSIM_TIANSHAN_INTERFEROGRAM_PUBLIC',\n", + " 'FLATSIM_TIANSHAN_TIMESERIE_PUBLIC',\n", + " 'FLATSIM_TIBETHIM_AUXILIARYDATA_PUBLIC',\n", + " 'FLATSIM_TIBETHIM_INTERFEROGRAM_PUBLIC',\n", + " 'FLATSIM_TIBETHIM_TIMESERIE_PUBLIC',\n", + " 'FLATSIM_TURQUIE_AUXILIARYDATA_PUBLIC',\n", + " 'FLATSIM_TURQUIE_INTERFEROGRAM_PUBLIC',\n", + " 'FLATSIM_TURQUIE_TIMESERIE_PUBLIC',\n", + " 'MUSCATE_LANDSAT_LANDSAT8_L2A',\n", + " 'MUSCATE_Landsat57_LANDSAT5_N2A',\n", + " 'MUSCATE_Landsat57_LANDSAT7_N2A',\n", + " 'MUSCATE_OSO_RASTER_L3B-OSO',\n", + " 'MUSCATE_OSO_VECTOR_L3B-OSO',\n", + " 'MUSCATE_PLEIADES_PLEIADES_ORTHO',\n", + " 'MUSCATE_PLEIADES_PLEIADES_PRIMARY',\n", + " 'MUSCATE_SENTINEL2_SENTINEL2_L3A',\n", + " 'MUSCATE_SPOTWORLDHERITAGE_SPOT1_L1C',\n", + " 'MUSCATE_SPOTWORLDHERITAGE_SPOT2_L1C',\n", + " 'MUSCATE_SPOTWORLDHERITAGE_SPOT3_L1C',\n", + " 'MUSCATE_SPOTWORLDHERITAGE_SPOT4_L1C',\n", + " 'MUSCATE_SPOTWORLDHERITAGE_SPOT5_L1C',\n", + " 'MUSCATE_Snow_LANDSAT8_L2B-SNOW',\n", + " 'MUSCATE_Snow_MULTISAT_L3B-SNOW',\n", + " 'MUSCATE_Snow_SENTINEL2_L2B-SNOW',\n", + " 'MUSCATE_Spirit_SPOT5_1A',\n", + " 'MUSCATE_VENUSVM05_VM5_L1C',\n", + " 'MUSCATE_VENUSVM05_VM5_L2A',\n", + " 'MUSCATE_VENUSVM05_VM5_L3A',\n", + " 'MUSCATE_VENUS_VM1_L1C',\n", + " 'MUSCATE_VENUS_VM1_L2A',\n", + " 'MUSCATE_VENUS_VM1_L3A',\n", + " 'MUSCATE_WaterQual_SENTINEL2_L2B-WATER',\n", + " 'PEPS_S2_L2A',\n", + " 'PEPS_S3_L1',\n", + " 'POSTEL_LANDCOVER_GLOBCOVER',\n", + " 'POSTEL_RADIATION_BRDF',\n", + " 'POSTEL_RADIATION_DLR',\n", + " 'POSTEL_RADIATION_SURFACEALBEDO',\n", + " 'POSTEL_RADIATION_SURFACEREFLECTANCE',\n", + " 'POSTEL_VEGETATION_FAPAR',\n", + " 'POSTEL_VEGETATION_FCOVER',\n", + " 'POSTEL_VEGETATION_LAI',\n", + " 'POSTEL_VEGETATION_NDVI',\n", + " 'POSTEL_VEGETATION_SURFACEREFLECTANCE',\n", + " 'POSTEL_WATER_PRECIP',\n", + " 'POSTEL_WATER_SOILMOISTURE',\n", + " 'POSTEL_WATER_SURFWET',\n", + " 'POSTEL_WATER_SWI',\n", + " 'S1_SAR_GRD',\n", + " 'S1_SAR_OCN',\n", + " 'S1_SAR_SLC',\n", + " 'S2_MSI_L1C',\n", + " 'S2_MSI_L2A_MAJA',\n", + " 'SWH_SPOT123_L1',\n", + " 'SWH_SPOT4_L1',\n", + " 'SWH_SPOT5_L1',\n", + " 'TAKE5_SPOT4_L1C',\n", + " 'TAKE5_SPOT4_L2A',\n", + " 'TAKE5_SPOT5_L1C',\n", + " 'TAKE5_SPOT5_L2A']" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "product_types = dag.list_product_types(\"geodes\")\n", + "[pt[\"ID\"] for pt in product_types]" + ] + }, + { + "cell_type": "markdown", + "id": "d0b551f6-30f7-4afa-8ed1-ac7c90356915", + "metadata": {}, + "source": [ + "Search for October-2024 Sentinel 2 L1C data over South-West of France with less that 5% of cloud coverage" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "21f6babd-b82e-4f7d-aa6c-f2b9483c2f2d", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + " \n", + " \n", + " \n", + "
\n", + " SearchResult (2)\n", + "
\n", + "
\n", + " 0 \n", + " EOProduct(id=S2B_MSIL1C_20241008T103829_N0511_R008_T31TCJ_20241008T131242, provider=geodes)\n", + " \n", + " \n", + " \n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
\n", + " EOProduct\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
provider:'geodes',
product_type:'S2_MSI_L1C',
properties["id"]:'S2B_MSIL1C_20241008T103829_N0511_R008_T31TCJ_20241008T131242',
properties["startTimeFromAscendingNode"]:'2024-10-08T10:38:29.024Z',
properties["completionTimeFromAscendingNode"]:'2024-10-08T10:38:29.024Z',
\n", + "
properties: (40){\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", + " \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", + " \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", + " \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", + " \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", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
abstract:'The Level-1C product is composed of 100x100 km2 tiles (ortho-images in UTM/WGS84 projection). It results from\n", + "using a Digital Elevation Model (DEM) to project the image in cartographic geometry. Per-pixel radiometric\n", + "measurements are provided in Top Of Atmosphere (TOA) reflectances along with the parameters to transform them\n", + "into radiances. Level-1C products are resampled with a constant Ground Sampling Distance (GSD) of 10, 20 and 60\n", + "meters depending on the native resolution of the different spectral bands. In Level-1C products, pixel\n", + "coordinates refer to the upper left corner of the pixel. Level-1C products will additionally include Cloud Masks\n", + "and ECMWF data (total column of ozone, total column of water vapour and mean sea level pressure).\n", + "SAFE formatted product, see https://sentinel.esa.int/web/sentinel/user-guides/sentinel-2-msi/data-formats\n", + "',
instrument:'MSI',
platform:'SENTINEL2',
platformSerialIdentifier:'S2B',
processingLevel:'L1C',
keywords:'MSI,SENTINEL,SENTINEL2,S2,S2A,S2B,L1,L1C,SAFE',
sensorType:'OPTICAL',
license:'proprietary',
missionStartDate:'2015-06-23T00:00:00Z',
title:'S2B_MSIL1C_20241008T103829_N0511_R008_T31TCJ_20241008T131242',
_id:'S2_MSI_L1C',
productType:'PEPS_S2_L1C',
uid:'URN:FEATURE:DATA:gdh:318b319d-7398-3191-a60b-a6df32e74d3b:V1',
keyword:['location:northern'\n", + " , 'season:autumn'\n", + " ],
orbitNumber:39645,
orbitDirection:'Descending',
cloudCover:0.0,
sensorMode:'INS-NOBS',
startTimeFromAscendingNode:'2024-10-08T10:38:29.024Z',
completionTimeFromAscendingNode:'2024-10-08T10:38:29.024Z',
id:'S2B_MSIL1C_20241008T103829_N0511_R008_T31TCJ_20241008T131242',
quicklook:'https://geodes-portal.cnes.fr/api/quicklook/URN:FEATURE:DATA:gdh:318b319d-7398-3191-a60b-a6df32e74d3b:V1/files/57defb00d70747e2e0ed21a4505cfa26?scope=gdh',
downloadLink:'https://geodes-portal.cnes.fr/api/download/URN:FEATURE:DATA:gdh:318b319d-7398-3191-a60b-a6df32e74d3b:V1/files/0c454397a963d62be21df73e259b665a',
thumbnail:'https://geodes-portal.cnes.fr/api/quicklook/URN:FEATURE:DATA:gdh:318b319d-7398-3191-a60b-a6df32e74d3b:V1/files/57defb00d70747e2e0ed21a4505cfa26?scope=gdh',
storageStatus:'ONLINE',
spaceborne:orbitID:8,
spaceborne:productType:'S2MSI1C',
spaceborne:s2TakeId:'GS2B_20241008T103829_039645_N05.11',
versionInfo:0.0,
latest:True,
identifier:'S2B_MSIL1C_20241008T103829_N0511_R008_T31TCJ_20241008T131242',
spaceborne:productTimeliness:'Nominal',
spaceborne:references:[{\n", + " 'url': 'http://www.naturalearthdata.com/downloads/10m-physical-vectors/10m-coastline/'\n", + " , \n", + " 'author': 'Natural Earth'\n", + " , \n", + " 'dataset': 'Coastline'\n", + " , \n", + " 'license': 'Free of Charge'\n", + " }\n", + " ,
{\n", + " 'url': 'http://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-admin-0-countries/'\n", + " , \n", + " 'author': 'Natural Earth'\n", + " , \n", + " 'dataset': 'Admin level 0 - Countries'\n", + " , \n", + " 'license': 'Free of Charge'\n", + " }\n", + " ,
{\n", + " 'url': 'http://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-admin-1-states-provinces/'\n", + " , \n", + " 'author': 'Natural Earth'\n", + " , \n", + " 'dataset': 'Admin level 1 - States, Provinces'\n", + " , \n", + " 'license': 'Free of Charge'\n", + " }\n", + " ,
{\n", + " 'url': 'http://www.naturalearthdata.com/downloads/10m-physical-vectors/10m-rivers-lake-centerlines/'\n", + " , \n", + " 'author': 'Natural Earth'\n", + " , \n", + " 'dataset': 'Rivers and lake centerlines'\n", + " , \n", + " 'license': 'Free of charge'\n", + " }\n", + " ,
{\n", + " 'url': 'http://www.naturalearthdata.com/downloads/10m-physical-vectors/10m-physical-labels/'\n", + " , \n", + " 'author': 'Natural Earth'\n", + " , \n", + " 'dataset': 'Marine Regions'\n", + " , \n", + " 'license': 'Free of charge'\n", + " }\n", + " ],
spaceborne:tile:'T31TCJ',
spaceborne:political:{\n", + " 'continents': [{\n", + " 'id': 'continent:Europe:6255148'\n", + " , \n", + " 'name': 'Europe'\n", + " , \n", + " 'countries': [{\n", + " 'id': 'country:France:223816'\n", + " , \n", + " 'name': 'France'\n", + " , \n", + " 'gcover': 0.53\n", + " , \n", + " 'pcover': 100\n", + " , \n", + " 'regions': [{\n", + " 'id': 'region:Occitanie:'\n", + " , \n", + " 'name': 'Occitanie'\n", + " , \n", + " 'gcover': 4.65\n", + " , \n", + " 'pcover': 100\n", + " , \n", + " 'states': [{\n", + " 'id': 'state:HauteGaronne:3013767'\n", + " , \n", + " 'name': 'Haute-Garonne'\n", + " , \n", + " 'gcover': 22.42\n", + " , \n", + " 'pcover': 41.8\n", + " }\n", + " ]\n", + " }\n", + " ,
{\n", + " 'id': 'region:Occitanie:'\n", + " , \n", + " 'name': 'Occitanie'\n", + " , \n", + " 'gcover': 4.65\n", + " , \n", + " 'pcover': 100\n", + " , \n", + " 'states': [{\n", + " 'id': 'state:Tarn:2973362'\n", + " , \n", + " 'name': 'Tarn'\n", + " , \n", + " 'gcover': 18.55\n", + " , \n", + " 'pcover': 31.7\n", + " }\n", + " ]\n", + " }\n", + " ,
{\n", + " 'id': 'region:Occitanie:'\n", + " , \n", + " 'name': 'Occitanie'\n", + " , \n", + " 'gcover': 4.65\n", + " , \n", + " 'pcover': 100\n", + " , \n", + " 'states': [{\n", + " 'id': 'state:TarnEtGaronne:2973357'\n", + " , \n", + " 'name': 'Tarn-et-Garonne'\n", + " , \n", + " 'gcover': 19.32\n", + " , \n", + " 'pcover': 20.93\n", + " }\n", + " ]\n", + " }\n", + " ,
{\n", + " 'id': 'region:Occitanie:'\n", + " , \n", + " 'name': 'Occitanie'\n", + " , \n", + " 'gcover': 4.65\n", + " , \n", + " 'pcover': 100\n", + " , \n", + " 'states': [{\n", + " 'id': 'state:Aude:3036264'\n", + " , \n", + " 'name': 'Aude'\n", + " , \n", + " 'gcover': 2.4\n", + " , \n", + " 'pcover': 4.47\n", + " }\n", + " ]\n", + " }\n", + " ,
{\n", + " 'id': 'region:Occitanie:'\n", + " , \n", + " 'name': 'Occitanie'\n", + " , \n", + " 'gcover': 4.65\n", + " , \n", + " 'pcover': 100\n", + " , \n", + " 'states': [{\n", + " 'id': 'state:Ariege:3036965'\n", + " , \n", + " 'name': 'Ariège'\n", + " , \n", + " 'gcover': 0.65\n", + " , \n", + " 'pcover': 0.95\n", + " }\n", + " ]\n", + " }\n", + " ,
{\n", + " 'id': 'region:Occitanie:'\n", + " , \n", + " 'name': 'Occitanie'\n", + " , \n", + " 'gcover': 4.65\n", + " , \n", + " 'pcover': 100\n", + " , \n", + " 'states': [{\n", + " 'id': 'state:Lot:2997524'\n", + " , \n", + " 'name': 'Lot'\n", + " , \n", + " 'gcover': 0.09\n", + " , \n", + " 'pcover': 0.14\n", + " }\n", + " ]\n", + " }\n", + " ]\n", + "
}
\n", + " ]\n", + "
}
\n", + " ]\n", + "
},
datetime:'2024-10-08T14:37:04.729Z',
processing:processingVersion:5.11,
spaceborne:continentsID:['EU'\n", + " ],
accessService:endpointDescription:'Link to product in datalake',
spatial:bbox:[1.4861600905095\n", + " , 43.253100777035\n", + " , 1.8702372867615\n", + " , 44.247830683969\n", + " ],
}
\n", + "
assets: (2)\n", + " \n", + "
\n", + "
\n", + " '2024/10/08/S2B/S2B_MSIL1C_20241008T103829_N0511_R008_T31TCJ_20241008T131242_quicklook.jpg': \n", + " {\n", + " 'roles': '['overview']', \n", + " 'type': 'image/jpeg', \n", + " 'title': '2024/10/08/S2B/S2B_MSIL1C_20241008T103829_N0511_R008_T31TCJ_20241008T131242_quicklook.jpg', \n", + " ...\n", + " }\n", + " \n", + " {\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
href:'https://geodes-portal.cnes.fr/api/quicklook/URN:FEATURE:DATA:gdh:318b319d-7398-3191-a60b-a6df32e74d3b:V1/files/57defb00d70747e2e0ed21a4505cfa26',
title:'2024/10/08/S2B/S2B_MSIL1C_20241008T103829_N0511_R008_T31TCJ_20241008T131242_quicklook.jpg',
description:'File size: 5840 bytes\n", + "\n", + "Is reference: false\n", + "\n", + "Is online: true\n", + "\n", + "Datatype: QUICKLOOK_SD\n", + "\n", + "Checksum MD5: 57defb00d70747e2e0ed21a4505cfa26',
type:'image/jpeg',
roles:['overview'\n", + " ],
}\n", + "
\n", + "
\n", + "
\n", + " 'S2B_MSIL1C_20241008T103829_N0511_R008_T31TCJ_20241008T131242.zip': \n", + " {\n", + " 'roles': '['data']', \n", + " 'type': 'application/zip', \n", + " 'title': 'S2B_MSIL1C_20241008T103829_N0511_R008_T31TCJ_20241008T131242.zip', \n", + " ...\n", + " }\n", + " \n", + " {\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
href:'https://geodes-portal.cnes.fr/api/download/URN:FEATURE:DATA:gdh:318b319d-7398-3191-a60b-a6df32e74d3b:V1/files/0c454397a963d62be21df73e259b665a',
title:'S2B_MSIL1C_20241008T103829_N0511_R008_T31TCJ_20241008T131242.zip',
description:'File size: 168214718 bytes\n", + "\n", + "Is reference: false\n", + "\n", + "Is online: false\n", + "\n", + "Datatype: RAWDATA\n", + "\n", + "Checksum MD5: 0c454397a963d62be21df73e259b665a',
type:'application/zip',
roles:['data'\n", + " ],
}\n", + "
\n", + "
\n", + "
geometry
thumbnail
\n", + "
\n", + "
\n", + "
\n", + " 1 \n", + " EOProduct(id=S2A_MSIL1C_20241013T104001_N0511_R008_T31TCH_20241013T124120, provider=geodes)\n", + " \n", + " \n", + " \n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
\n", + " EOProduct\n", + "
\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
provider:'geodes',
product_type:'S2_MSI_L1C',
properties["id"]:'S2A_MSIL1C_20241013T104001_N0511_R008_T31TCH_20241013T124120',
properties["startTimeFromAscendingNode"]:'2024-10-13T10:40:01.024Z',
properties["completionTimeFromAscendingNode"]:'2024-10-13T10:40:01.024Z',
\n", + "
properties: (40){\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", + " \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", + " \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", + " \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", + " \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", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
abstract:'The Level-1C product is composed of 100x100 km2 tiles (ortho-images in UTM/WGS84 projection). It results from\n", + "using a Digital Elevation Model (DEM) to project the image in cartographic geometry. Per-pixel radiometric\n", + "measurements are provided in Top Of Atmosphere (TOA) reflectances along with the parameters to transform them\n", + "into radiances. Level-1C products are resampled with a constant Ground Sampling Distance (GSD) of 10, 20 and 60\n", + "meters depending on the native resolution of the different spectral bands. In Level-1C products, pixel\n", + "coordinates refer to the upper left corner of the pixel. Level-1C products will additionally include Cloud Masks\n", + "and ECMWF data (total column of ozone, total column of water vapour and mean sea level pressure).\n", + "SAFE formatted product, see https://sentinel.esa.int/web/sentinel/user-guides/sentinel-2-msi/data-formats\n", + "',
instrument:'MSI',
platform:'SENTINEL2',
platformSerialIdentifier:'S2A',
processingLevel:'L1C',
keywords:'MSI,SENTINEL,SENTINEL2,S2,S2A,S2B,L1,L1C,SAFE',
sensorType:'OPTICAL',
license:'proprietary',
missionStartDate:'2015-06-23T00:00:00Z',
title:'S2A_MSIL1C_20241013T104001_N0511_R008_T31TCH_20241013T124120',
_id:'S2_MSI_L1C',
productType:'PEPS_S2_L1C',
uid:'URN:FEATURE:DATA:gdh:6217faf2-abf6-36b0-ae06-649a1b196ca0:V1',
keyword:['location:northern'\n", + " , 'season:autumn'\n", + " ],
orbitNumber:48625,
orbitDirection:'Descending',
cloudCover:0.179240979035,
sensorMode:'INS-NOBS',
startTimeFromAscendingNode:'2024-10-13T10:40:01.024Z',
completionTimeFromAscendingNode:'2024-10-13T10:40:01.024Z',
id:'S2A_MSIL1C_20241013T104001_N0511_R008_T31TCH_20241013T124120',
quicklook:'https://geodes-portal.cnes.fr/api/quicklook/URN:FEATURE:DATA:gdh:6217faf2-abf6-36b0-ae06-649a1b196ca0:V1/files/a495021f4d4c458bfa9f252c93505a63?scope=gdh',
downloadLink:'https://geodes-portal.cnes.fr/api/download/URN:FEATURE:DATA:gdh:6217faf2-abf6-36b0-ae06-649a1b196ca0:V1/files/e4d2ddd8dccb077fec3f1b4c8debf811',
thumbnail:'https://geodes-portal.cnes.fr/api/quicklook/URN:FEATURE:DATA:gdh:6217faf2-abf6-36b0-ae06-649a1b196ca0:V1/files/a495021f4d4c458bfa9f252c93505a63?scope=gdh',
storageStatus:'ONLINE',
spaceborne:orbitID:8,
spaceborne:productType:'S2MSI1C',
spaceborne:s2TakeId:'GS2A_20241013T104001_048625_N05.11',
versionInfo:0.0,
latest:True,
identifier:'S2A_MSIL1C_20241013T104001_N0511_R008_T31TCH_20241013T124120',
spaceborne:productTimeliness:'Nominal',
spaceborne:references:[{\n", + " 'url': 'http://www.naturalearthdata.com/downloads/10m-physical-vectors/10m-coastline/'\n", + " , \n", + " 'author': 'Natural Earth'\n", + " , \n", + " 'dataset': 'Coastline'\n", + " , \n", + " 'license': 'Free of Charge'\n", + " }\n", + " ,
{\n", + " 'url': 'http://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-admin-0-countries/'\n", + " , \n", + " 'author': 'Natural Earth'\n", + " , \n", + " 'dataset': 'Admin level 0 - Countries'\n", + " , \n", + " 'license': 'Free of Charge'\n", + " }\n", + " ,
{\n", + " 'url': 'http://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-admin-1-states-provinces/'\n", + " , \n", + " 'author': 'Natural Earth'\n", + " , \n", + " 'dataset': 'Admin level 1 - States, Provinces'\n", + " , \n", + " 'license': 'Free of Charge'\n", + " }\n", + " ,
{\n", + " 'url': 'http://www.naturalearthdata.com/downloads/10m-physical-vectors/10m-rivers-lake-centerlines/'\n", + " , \n", + " 'author': 'Natural Earth'\n", + " , \n", + " 'dataset': 'Rivers and lake centerlines'\n", + " , \n", + " 'license': 'Free of charge'\n", + " }\n", + " ,
{\n", + " 'url': 'http://www.naturalearthdata.com/downloads/10m-physical-vectors/10m-physical-labels/'\n", + " , \n", + " 'author': 'Natural Earth'\n", + " , \n", + " 'dataset': 'Marine Regions'\n", + " , \n", + " 'license': 'Free of charge'\n", + " }\n", + " ],
spaceborne:tile:'T31TCH',
spaceborne:political:{\n", + " 'continents': [{\n", + " 'id': 'continent:Europe:6255148'\n", + " , \n", + " 'name': 'Europe'\n", + " , \n", + " 'countries': [{\n", + " 'id': 'country:France:223816'\n", + " , \n", + " 'name': 'France'\n", + " , \n", + " 'gcover': 0.71\n", + " , \n", + " 'pcover': 73.77\n", + " , \n", + " 'regions': [{\n", + " 'id': 'region:Occitanie:'\n", + " , \n", + " 'name': 'Occitanie'\n", + " , \n", + " 'gcover': 6.2\n", + " , \n", + " 'pcover': 73.86\n", + " , \n", + " 'states': [{\n", + " 'id': 'state:Ariege:3036965'\n", + " , \n", + " 'name': 'Ariège'\n", + " , \n", + " 'gcover': 71.57\n", + " , \n", + " 'pcover': 57.78\n", + " }\n", + " ]\n", + " }\n", + " ,
{\n", + " 'id': 'region:Occitanie:'\n", + " , \n", + " 'name': 'Occitanie'\n", + " , \n", + " 'gcover': 6.2\n", + " , \n", + " 'pcover': 73.86\n", + " , \n", + " 'states': [{\n", + " 'id': 'state:HauteGaronne:3013767'\n", + " , \n", + " 'name': 'Haute-Garonne'\n", + " , \n", + " 'gcover': 8.26\n", + " , \n", + " 'pcover': 8.53\n", + " }\n", + " ]\n", + " }\n", + " ,
{\n", + " 'id': 'region:Occitanie:'\n", + " , \n", + " 'name': 'Occitanie'\n", + " , \n", + " 'gcover': 6.2\n", + " , \n", + " 'pcover': 73.86\n", + " , \n", + " 'states': [{\n", + " 'id': 'state:Aude:3036264'\n", + " , \n", + " 'name': 'Aude'\n", + " , \n", + " 'gcover': 4.8\n", + " , \n", + " 'pcover': 4.94\n", + " }\n", + " ]\n", + " }\n", + " ,
{\n", + " 'id': 'region:Occitanie:'\n", + " , \n", + " 'name': 'Occitanie'\n", + " , \n", + " 'gcover': 6.2\n", + " , \n", + " 'pcover': 73.86\n", + " , \n", + " 'states': [{\n", + " 'id': 'state:PyreneesOrientales:2984885'\n", + " , \n", + " 'name': 'Pyrénées-Orientales'\n", + " , \n", + " 'gcover': 3.64\n", + " , \n", + " 'pcover': 2.49\n", + " }\n", + " ]\n", + " }\n", + " ]\n", + "
}
\n", + " ,
{\n", + " 'id': 'country:Spain:298795'\n", + " , \n", + " 'name': 'Spain'\n", + " , \n", + " 'gcover': 0.22\n", + " , \n", + " 'pcover': 18.89\n", + " , \n", + " 'regions': [{\n", + " 'id': 'region:Cataluna:3336901'\n", + " , \n", + " 'name': 'Cataluña'\n", + " , \n", + " 'gcover': 3.63\n", + " , \n", + " 'pcover': 18.89\n", + " , \n", + " 'states': [{\n", + " 'id': 'state:Lerida:6355231'\n", + " , \n", + " 'name': 'Lérida'\n", + " , \n", + " 'gcover': 8.68\n", + " , \n", + " 'pcover': 17\n", + " }\n", + " ]\n", + " }\n", + " ,
{\n", + " 'id': 'region:Cataluna:3336901'\n", + " , \n", + " 'name': 'Cataluña'\n", + " , \n", + " 'gcover': 3.63\n", + " , \n", + " 'pcover': 18.89\n", + " , \n", + " 'states': [{\n", + " 'id': 'state:Gerona:2508807'\n", + " , \n", + " 'name': 'Gerona'\n", + " , \n", + " 'gcover': 1.99\n", + " , \n", + " 'pcover': 1.89\n", + " }\n", + " ]\n", + " }\n", + " ]\n", + "
}
\n", + " ,
{\n", + " 'id': 'country:Andorra:3041565'\n", + " , \n", + " 'name': 'Andorra'\n", + " , \n", + " 'gcover': 100\n", + " , \n", + " 'pcover': 7.33\n", + " , \n", + " 'regions': [{\n", + " 'id': 'state:SantJuliaDeLoria:3239105'\n", + " , \n", + " 'name': 'Sant Julià de Lòria'\n", + " , \n", + " 'gcover': 100\n", + " , \n", + " 'pcover': 1.24\n", + " }\n", + " ,
{\n", + " 'id': 'state:Ordino:3039676'\n", + " , \n", + " 'name': 'Ordino'\n", + " , \n", + " 'gcover': 100\n", + " , \n", + " 'pcover': 1.23\n", + " }\n", + " ,
{\n", + " 'id': 'state:Canillo:3041203'\n", + " , \n", + " 'name': 'Canillo'\n", + " , \n", + " 'gcover': 100\n", + " , \n", + " 'pcover': 1.2\n", + " }\n", + " ,
{\n", + " 'id': 'state:LaMassana:3040131'\n", + " , \n", + " 'name': 'La Massana'\n", + " , \n", + " 'gcover': 100\n", + " , \n", + " 'pcover': 1.17\n", + " }\n", + " ,
{\n", + " 'id': 'state:Encamp:2993458'\n", + " , \n", + " 'name': 'Encamp'\n", + " , \n", + " 'gcover': 100\n", + " , \n", + " 'pcover': 1.15\n", + " }\n", + " ,
{\n", + " 'id': 'state:EscaldesEngordany:3239100'\n", + " , \n", + " 'name': 'Escaldes-Engordany'\n", + " , \n", + " 'gcover': 100\n", + " , \n", + " 'pcover': 1.07\n", + " }\n", + " ,
{\n", + " 'id': 'state:AndorraLaVella:3044310'\n", + " , \n", + " 'name': 'Andorra la Vella'\n", + " , \n", + " 'gcover': 100\n", + " , \n", + " 'pcover': 0.23\n", + " }\n", + " ]\n", + "
}
\n", + " ]\n", + "
}
\n", + " ]\n", + "
},
datetime:'2024-10-13T15:44:32.194Z',
processing:processingVersion:5.11,
spaceborne:continentsID:['EU'\n", + " ],
accessService:endpointDescription:'Link to product in datalake',
spatial:bbox:[1.207118258122\n", + " , 42.348119272044\n", + " , 1.8870778350223\n", + " , 43.347440388825\n", + " ],
}
\n", + "
assets: (2)\n", + " \n", + "
\n", + "
\n", + " 'S2A_MSIL1C_20241013T104001_N0511_R008_T31TCH_20241013T124120.zip': \n", + " {\n", + " 'roles': '['data']', \n", + " 'type': 'application/zip', \n", + " 'title': 'S2A_MSIL1C_20241013T104001_N0511_R008_T31TCH_20241013T124120.zip', \n", + " ...\n", + " }\n", + " \n", + " {\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
href:'https://geodes-portal.cnes.fr/api/download/URN:FEATURE:DATA:gdh:6217faf2-abf6-36b0-ae06-649a1b196ca0:V1/files/e4d2ddd8dccb077fec3f1b4c8debf811',
title:'S2A_MSIL1C_20241013T104001_N0511_R008_T31TCH_20241013T124120.zip',
description:'File size: 372535070 bytes\n", + "\n", + "Is reference: false\n", + "\n", + "Is online: false\n", + "\n", + "Datatype: RAWDATA\n", + "\n", + "Checksum MD5: e4d2ddd8dccb077fec3f1b4c8debf811',
type:'application/zip',
roles:['data'\n", + " ],
}\n", + "
\n", + "
\n", + "
\n", + " '2024/10/13/S2A/S2A_MSIL1C_20241013T104001_N0511_R008_T31TCH_20241013T124120_quicklook.jpg': \n", + " {\n", + " 'roles': '['overview']', \n", + " 'type': 'image/jpeg', \n", + " 'title': '2024/10/13/S2A/S2A_MSIL1C_20241013T104001_N0511_R008_T31TCH_20241013T124120_quicklook.jpg', \n", + " ...\n", + " }\n", + " \n", + " {\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
href:'https://geodes-portal.cnes.fr/api/quicklook/URN:FEATURE:DATA:gdh:6217faf2-abf6-36b0-ae06-649a1b196ca0:V1/files/a495021f4d4c458bfa9f252c93505a63',
title:'2024/10/13/S2A/S2A_MSIL1C_20241013T104001_N0511_R008_T31TCH_20241013T124120_quicklook.jpg',
description:'File size: 10540 bytes\n", + "\n", + "Is reference: false\n", + "\n", + "Is online: true\n", + "\n", + "Datatype: QUICKLOOK_SD\n", + "\n", + "Checksum MD5: a495021f4d4c458bfa9f252c93505a63',
type:'image/jpeg',
roles:['overview'\n", + " ],
}\n", + "
\n", + "
\n", + "
geometry
thumbnail
\n", + "
\n", + "
" + ], + "text/plain": [ + "SearchResult([EOProduct(id=S2B_MSIL1C_20241008T103829_N0511_R008_T31TCJ_20241008T131242, provider=geodes),\n", + " EOProduct(id=S2A_MSIL1C_20241013T104001_N0511_R008_T31TCH_20241013T124120, provider=geodes)])" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "search_bbox = [1, 43, 2, 44]\n", + "search_criteria = dict(\n", + " provider=\"geodes\",\n", + " productType=\"S2_MSI_L1C\",\n", + " start=\"2024-10-01\",\n", + " end=\"2024-10-30\",\n", + " geom=search_bbox,\n", + " cloudCover=5,\n", + " count=True,\n", + ")\n", + "\n", + "results = dag.search_all(**search_criteria)\n", + "results" + ] + }, + { + "cell_type": "markdown", + "id": "eb7ff8a5-ee2b-488a-bd5d-4b503b7a069e", + "metadata": {}, + "source": [ + "View found products extents and search area on a map" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "9dcef2e4-1ce5-4ced-910a-25953e74bba4", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "text/html": [ + "
Make this Notebook Trusted to load map: File -> Trust Notebook
" + ], + "text/plain": [ + "" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import folium\n", + "\n", + "# Create a map zoomed over the search area\n", + "fmap = folium.Map([43.5, 1.5], zoom_start=7)\n", + "\n", + "# Create a layer that represents the search area in red\n", + "folium.Rectangle(\n", + " bounds=[search_bbox[::-1][2:4], search_bbox[::-1][0:2]], \n", + " color=\"red\", \n", + " tooltip=\"Search extent\"\n", + ").add_to(fmap)\n", + "\n", + "# Create a layer that maps the products found\n", + "folium.GeoJson(\n", + " data=results, tooltip=folium.GeoJsonTooltip(fields=[\"title\"])\n", + ").add_to(fmap)\n", + "\n", + "fmap" + ] + }, + { + "cell_type": "markdown", + "id": "a6456425-98d5-4aaa-8e41-15a41a245c80", + "metadata": {}, + "source": [ + "## 3. Download products to `/scratch/data` directory" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "fcba99e2-d157-49bf-86e8-ab3492aea6a0", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "fc21d6d567524bb5b976ce1c73ab385e", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Downloaded products: 0%| | 0/2 [00:00=3.0.1 +folium \ No newline at end of file From d0694028c258f48674017af9c0a0b7c125598b44 Mon Sep 17 00:00:00 2001 From: Sylvain Brunato Date: Wed, 27 Nov 2024 13:32:51 +0000 Subject: [PATCH 2/2] chore: gitignore update --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..62c472e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.ipynb_checkpoints +