Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Harmonised MARS credential setup with other clients: using ~/.ecmwfapirc
Info

To learn more about MARS and how to use it, please visit the MARS user documentation.

One of the big features of the European Weather Cloud is the fast access to data resources. If you want to access MARS from the European Weather Cloud, here is what you need to do.

Setting up your instance

Info

For fast MARS access, you will need to provision your instance on the ECMWF cloud.

For now, the only supported Operating System for MARS access is CentOSUbuntu, CentOS and Rocky have support for native MARS client.

When provisioning a new instance:

  • Select
  • , make sure you select
  • the "*-data" layout.
  • Make sure you add the data network in addition to the public/private one. 

    NoteWhen having more than one network, please configure data as the last one
  •  
  • If the instance is running at ECMWF, add the "external-internet" network. MARS needs to have a public IP (external-internet network) to be able to use the direct connection to the MARS servers.
  • If using Floating IP instead, you will then need to let MARS know at runtime what is your IP address is. You will need to have the following variable defined on every session that you need to run MARS from. You may add that definition into your .bashrc or .profile scripts.
    No Format
    export MARS_DHS_LOCALHOST=<your_public_ip>

If you wish to convert an existing instance, you can select it, and "Action -> run workflow -> click the list icon and select something like "Install ECMWF software nexus".

Configuring MARS

The command-line client will be pre-installed if you chose the "*-data" layout, but you will need an extra step so MARS knows who you are when you issue your requests. 

  1. In your web browser...
    1. Go to https://apps.ecmwf.int/v1/key
    2. Log in with your ECMWF user and password if you are not logged int already
    3. Copy your API key

     In a terminal (ssh or console) session on your new VM, run the following command to install your credentials on your account in this VM:

    No Format
    mars --token <yourkey> --email <youremail>

    Example: if your API key is da7y37f1d5c7494662e36df034bn6323 and your email is john.smith@email.me :

    No Formatmars --token da7y37f1d5c7494662e36df034bn6323 --email john.smith@email.me
    1. the contents of .ecmwfapirc, containing your email address and key.
  2. In your VM, create a file in your home directory called ~/.ecmwfapirc and paste the contents previously copied from the web.

Test your setup

Info

You may only access data you have been granted access to. In some cases you may not be able to retrieve valid forecast data.

...

Tip

If you have access to real time data, a quick one-liner to test everything works is:

No Format
echo "retrieve, target=test.grib" | mars

The command should end with 0 exit code, a message stating "No errors reported" and a new file called test.grib containing 6 GRIB fields. You may decode them using ECC.

Content by Label
showLabelsfalse
max5
spacesEWCLOUDKB
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("mars","retrieval") and type = "page" and space = "EWCLOUDKB"
labelsmars retrieval

...

Page properties
hiddentrue


Related issues