TNO Intern

Commit 6d63d3b2 authored by Arjo Segers's avatar Arjo Segers
Browse files

Updates for access to Copernicus DataSpace: use STAC API to inquire, and download from S3 buckets.

parent aba71ba5
Loading
Loading
Loading
Loading
+5 −16
Original line number Diff line number Diff line
@@ -301,21 +301,13 @@ VIRTUAL_ENV :
! full time range:
cso.tutorial.inquire-table-dataspace.timerange.start        :  2018-01-01 00:00:00
cso.tutorial.inquire-table-dataspace.timerange.end          :  2025-01-01 00:00:00
!! ... testing ...
!cso.tutorial.inquire-table-dataspace.timerange.start        :  2018-06-01 00:00:00
!cso.tutorial.inquire-table-dataspace.timerange.end          :  2018-07-01 00:00:00

! API url:
cso.tutorial.inquire-table-dataspace.url                    :  https://catalogue.dataspace.copernicus.eu/resto/api
cso.tutorial.inquire-table-dataspace.url                    :  https://stac.dataspace.copernicus.eu/v1

! collection name:
cso.tutorial.inquire-table-dataspace.collection             :  Sentinel5P

! product type, always 10 characters!
!   L2__NO2___
!   L2__CO____
!   ...
cso.tutorial.inquire-table-dataspace.producttype            :  L2__NO2___
cso.tutorial.inquire-table-dataspace.collections             :  sentinel-5p-l2-no2-rpro \
                                                                sentinel-5p-l2-no2-offl

! target area;
!!~ empty for no limitation:
@@ -323,9 +315,6 @@ cso.tutorial.inquire-table-dataspace.producttype : L2__NO2___
!~ domain specified as:  west,south,east,north
cso.tutorial.inquire-table-dataspace.area                   :  ${my.region.west},${my.region.south},${my.region.east},${my.region.north}

! template for download url given "{product_id}":
cso.tutorial.inquire-table-dataspace.download_url           :  https://zipper.dataspace.copernicus.eu/odata/v1/Products({product_id})/$value

! output table, date of today:
cso.tutorial.inquire-table-dataspace.output.file            :  ${my.work}/Copernicus/Copernicus_S5p_NO2_dataspace__%Y-%m-%d.csv

@@ -339,7 +328,7 @@ cso.tutorial.inquire-plot.renew : True
cso.tutorial.inquire-plot.file                     :  ${cso.tutorial.inquire-table-dataspace.output.file}
!!~ specify dates ("yyyy-mm-dd") to use historic tables,
!!  default is table of today:
!cso.tutorial.inquire-plot.filedate                 :  2022-01-18
!cso.tutorial.inquire-plot.filedate                 :  2026-03-11

! annote:
cso.tutorial.inquire-plot.title                    :  S5p/NO2 %Y-%m-%d
@@ -371,7 +360,7 @@ cso.tutorial.convert.timerange.end : ${my.timerange.end}
! listing of available source files,  created by 'inquire' job:
cso.tutorial.convert.inquire.file                   :  ${my.work}/Copernicus/Copernicus_S5p_NO2_dataspace__%Y-%m-%d.csv
!!~ historic inquire ...
!cso.tutorial.convert.inquire.filedate               :  2024-01-18
!cso.tutorial.convert.inquire.filedate               :  2026-03-25

! selection keyword:
my.tutorial.selection                                :  C03
+3 −0
Original line number Diff line number Diff line
@@ -38,6 +38,9 @@ dependencies = [
    "scipy >=1.1.0",
    "earthaccess",
    "requests",
    "pystac",
    "pystac_client",
    "boto3",
    "typer",
    "python-magic",
]
+367 −471

File changed.

Preview size limit exceeded, changes collapsed.

+4 −2
Original line number Diff line number Diff line
@@ -78,7 +78,9 @@
#   Updated use of Dataset.dims following deprication warning.
#   Explicitly defined data type in encoding of time array folowing warning.
#

# 2026-03, Arjo Segers
#   Updated selection of download source for Copernicus Dataspace.
#

########################################################################
###
@@ -3030,7 +3032,7 @@ class CSO_S5p_Convert(utopya.UtopyaRc):
                        # initialize download?
                        if downloader is None:
                            # init downloader based on url:
                            if "dataspace.copernicus.eu" in href:
                            if href.startswith("s3://eodata/"):
                                # download from Copernicus DataSpace:
                                downloader = cso_dataspace.CSO_DataSpace_Downloader()
                            #