Command Line User Guide

Command Line User Guide

Command Line User Guide

EUMDAC’s command line interface (CLI) is a program named eumdac.

The CLI allows you to build workflows using shell commands, either interactively at the command prompt or with a script. Many common cases are covered by CLI sub-commands and it is often more convenient to use a ready-made command as opposed to implementing similar functionality as a python script.

 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 $ eumdac --help usage: eumdac [-h] [--version] [--collections] [--set-credentials ConsumerKey ConsumerSecret] [--debug] {describe,search,download} ... Eumetsat Data Access Client positional arguments: {describe,search,download} describe describe a collection or product search search for products at the collection level download download product(s) from a collection optional arguments: --help show this help message and exit --version show program's version number and exit --collections list collections and exit --set-credentials ConsumerKey ConsumerSecret permanently set consumer key and secret and exit, see https://api.eumetsat.int/api-key --debug show backtrace for errors

Setup

Before using the CLI for the first time, ensure that you’re registered at the EUMETSAT EO Portal: https://eoportal.eumetsat.int

Now, you can set your personal credentials:

1 eumdac --set-credentials ConsumerKey ConsumerSecret

You can find your ConsumerKey and ConsumerSecret here: https://api.eumetsat.int/api-key/

Example:

1 eumdac --set-credentials XclkbXXXXXXXXXXXXXXXhO7GYI8a bVLv6CXXXXXXXXXXXXXXXXXU5FYa

Commands

Command

Arguments

Description

Command

Arguments

Description

describe

 

Using describe to get more information about a collection or product.

 

-h
--help

Show the help message for this command

 

-c
--collection

Specifies the collection to describe

Output:

  • Identifier of collection/product

  • title

  • abstract

Example:
-c EO:EUM:DAT:MSG:MSG15-RSS

 

-p
--product

Specifies the product to describe [Optional]

Output:

  • Mission

  • Instrument

  • Sensing start/end

  • Size

Example:
-p MSG3-SEVI-MSG15-0100-NA-20211109085417.273000000Z-NA

search

 

Using search to get all products that match search parameters.

 

-h
--help

Show the help message for this command

 

-c
--collection

Specifies the collection for product search

Output:

  • Product IDs of the collection (default: latest)

Example:
-c EO:EUM:DAT:MSG:MSG15-RSS

 

-s
--start

Filter by start date (UTC)

Format:
YYYY-MM-DD[THH[:MM[:SS]]]

Example:
-s 2002-12-21T12:30:15
-s 2002-12-21

 

-e
--end

Filter by end date (UTC)

Format:
YYYY-MM-DD[THH[:MM[:SS]]]

Example:
-s 2002-12-24T18:30:15
-s 2002-12-24

 

--bbox

Find products which has a spatial extent overlapping the defined bounding box, the box is defined in EPSG:4326 decimal degrees

Format:
[west, south, east, north]

Example:
--bbox 51.28 51.69 0.51 0.33

 

--geometry

Find products which has a spatial extent overlapping the defined

Format:
Well Known Text geometry, the box is defined in EPSG:4326 decimal degrees

Find examples on how to create WKT geometries here: https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry

Example:
--geometry 'POLYGON ((10.09 56.09, 10.34 56.09, 10.34 56.19, 10.09 56.19, 10.09 56.09))'

 

--satellite

Filter products by satellite

Example:
--satellite Sentinel-3A

 

--sort

Sort results

 

--limit

Max Items to return (default = 10)

Example:
--limit 5

Please, be aware of current limitations of the Data Store API. The search and browse APIs are limited to return a maximum of 10.000 items.

download

 

Download products

 

-h
--help

Show the help message for this command

 

-c
--collection

Specifies the collection for product search

Output:

  • Product IDs of the collection (default: latest)

Example:
-c EO:EUM:DAT:MSG:MSG15-RSS

 

-p
--product

Specifies the products to download

Example:
-p MSG3-SEVI-MSG15-0100-NA-20211109085417.273000000Z-NA

 

-o
--output-dir

Define the download directory

Example:
-o /Desktop/project_dir/

 

--file-pattern

Filter product files

Format:
shell-style wildcard pattern(s)

Example:
--file-pattern *.nat (to only download the .nat files of the product)

 

--time-range

Download all products of a collection of the defined time range

Format:
YYYY-MM-DD[THH[:MM[:SS]]] YYYY-MM-DD[THH[:MM[:SS]]]

Example:
--time-range 2002-12-24T12:30 2002-12-24T18:30:15

subscribe

 

Subscribe a server for a collection

 

-h
--help

Show the help message for this command

 

--list

List current active subscriptions

 

-c
--collection

Specifies which collection to subscribe to

Example:
-c EO:EUM:DAT:MSG:MSG15-RSS

 

-u
--url

Specifies the public URL of the listener server

 

--area-of-interest

Subscribe to products which has a spatial extent overlapping the defined

Format:
Well Known Text geometry, the box is defined in EPSG:4326 decimal degrees

Find examples on how to create WKT geometries here: https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry

Example:
--geometry 'POLYGON ((10.09 56.09, 10.34 56.09, 10.34 56.19, 10.09 56.19, 10.09 56.09))'

 

--delete

Delete subscriptions

Example:
--delete 6f0646b1-d2c2-XXXX-XXXX-84393b1e2dcb (this is the subscription ID)

Examples

List all existing collections

To see which collections you can search for, you just have to use this simple argument:

1 $ eumdac describe

Output:

1 2 3 4 5 EO:EUM:DAT:MSG:MSG15-RSS - Rapid Scan High Rate SEVIRI Level 1.5 Image Data - MSG EO:EUM:DAT:MSG:RSS-CLM - Rapid Scan Cloud Mask - MSG EO:EUM:DAT:MSG:HRSEVIRI - High Rate SEVIRI Level 1.5 Image Data - MSG - 0 degree EO:EUM:DAT:MSG:CLM - Cloud Mask - MSG - 0 degree ...

Get recent products of a defined area

Sometimes we want the most recent products of a specific collection and area. For this we want to search with specific parameters:

  • Collection ID

  • Area as WKT Polygon

We can use this parameter in a call like this:

1 $ eumdac search -c EO:EUM:DAT:MSG:MSG15-RSS --geometry 'POLYGON ((10.09 56.09, 10.34 56.09, 10.34 56.19, 10.09 56.19, 10.09 56.09))'

In this case, we get a list of the 10 most recent products that match our search parameters:

1 2 3 4 5 6 7 8 9 10 MSG3-SEVI-MSG15-0100-NA-20211109085915.989000000Z-NA MSG3-SEVI-MSG15-0100-NA-20211109085417.273000000Z-NA MSG3-SEVI-MSG15-0100-NA-20211109084918.557000000Z-NA MSG3-SEVI-MSG15-0100-NA-20211109084418.639000000Z-NA MSG3-SEVI-MSG15-0100-NA-20211109083918.721000000Z-NA MSG3-SEVI-MSG15-0100-NA-20211109083418.803000000Z-NA MSG3-SEVI-MSG15-0100-NA-20211109082917.684000000Z-NA MSG3-SEVI-MSG15-0100-NA-20211109082416.564000000Z-NA MSG3-SEVI-MSG15-0100-NA-20211109081915.445000000Z-NA MSG3-SEVI-MSG15-0100-NA-20211109081415.527000000Z-NA

If you want to have more or less than 10 products, just add the --limit argument in your call. Now, we want to download one or more products.

If you just want to download one specific product, you just can use the product ID to start the download.

1 $ eumdac download -c EO:EUM:DAT:MSG:MSG15-RSS -p MSG3-SEVI-MSG15-0100-NA-20211109084418.639000000Z-NA

But sometimes, we want to download multiple products. Therefore, we save all products from the previous search with the > products.txtargument in a text file:

1 $ eumdac search -c EO:EUM:DAT:MSG:MSG15-RSS --geometry 'POLYGON ((10.09 56.09, 10.34 56.09, 10.34 56.19, 10.09 56.19, 10.09 56.09))' > products.txt

Now, we can import the text file and download all products from it:

1 eumdac download -c EO:EUM:DAT:MSG:MSG15-RSS -p @products.txt