Credentials#

Most sources download without an account. Three data providers need a free account, and seagrid needs your login for them:

Provider

Sources

Copernicus Marine

ostia, smoc, cmems_globgc (GlobColour), glorys_carb

NASA Earthdata

modis_a, viirs, seawifs, olci, avhrr, mur25

Mercator Ocean

glorys (GLORYS12 on Mercator’s THREDDS server)

All other sources, OC-CCI included, need no account.

To see which accounts seagrid can find, run:

seagrid credentials
Credentials (needed only for these sources; all others are open):
  Copernicus Marine  found    cmems_globgc, glorys_carb, ostia, smoc (~/.copernicusmarine/.copernicusmarine-credentials)
  NASA Earthdata     found    avhrr, modis_a, mur25, olci, seawifs, viirs (~/.netrc)
  Mercator Ocean     missing  glorys

seagrid init prints the same check, with a warning when an account is missing. It looks for the credentials without contacting any server, so a login that is found can still be wrong. The Check step in each section below tests the login with the server.

Warning

Never put usernames, passwords or tokens in a seagrid.toml that is kept under version control or shared. Use the provider’s own login file, environment variables or a .secrets.toml file, and make those files readable only by you (chmod 600).

Copernicus Marine#

Needed for ostia, smoc, cmems_globgc and glorys_carb.

  1. Create an account at https://data.marine.copernicus.eu/register. The account is free.

  2. Give seagrid the login, in one of three ways:

    • copernicusmarine login (recommended). The copernicusmarine command is installed with seagrid:

      copernicusmarine login          # in a uv project: uv run copernicusmarine login
      

      It asks for your username and password and stores them in ~/.copernicusmarine/.copernicusmarine-credentials. Every program that uses the Copernicus Marine Toolbox finds them there.

    • Environment variables:

      export COPERNICUSMARINE_SERVICE_USERNAME="my-user"
      export COPERNICUSMARINE_SERVICE_PASSWORD="..."
      
    • .secrets.toml, one section per source, for example in ~/.config/seagrid/.secrets.toml:

      [ostia]
      username = "my-user"
      password = "..."
      
      [smoc]
      username = "my-user"
      password = "..."
      

      A source’s username and password settings take precedence over the other two, so you can use a different account for one source.

  3. Check that the server accepts the login:

    seagrid check ostia
    

NASA Earthdata#

Needed for the NASA ocean-colour products from OB.DAAC (modis_a, viirs, seawifs, olci) and the GHRSST products from PO.DAAC (avhrr, mur25). seagrid logs in through earthaccess.

  1. Create an account at https://urs.earthdata.nasa.gov/users/new. The account is free.

  2. Give seagrid the login, in one of three ways:

    • ~/.netrc (recommended). Add this line, with your own username and password:

      machine urs.earthdata.nasa.gov login my-user password ...
      

      and make the file private:

      chmod 600 ~/.netrc
      

      earthaccess can write the line for you. It asks for the username and password:

      python -c "import earthaccess; earthaccess.login(strategy='interactive', persist=True)"
      
    • Environment variables:

      export EARTHDATA_USERNAME="my-user"
      export EARTHDATA_PASSWORD="..."
      
    • A token. Generate one in your Earthdata profile (Generate Token) and set EARTHDATA_TOKEN. Tokens expire, so renew it when downloads start to fail.

    A ~/.netrc somewhere else is used if NETRC points to it.

  3. Check that the server accepts the login:

    seagrid check modis_a
    

    If the login works but downloads are refused, sign in at https://urs.earthdata.nasa.gov, open Applications → Authorized Apps, and approve the archive’s application (for example OB.DAAC Data Access).

Mercator Ocean#

Needed only for glorys, which reads GLORYS12 from Mercator Ocean’s THREDDS server (tds.mercator-ocean.fr) in the layout tracmass expects. The other Copernicus Marine products use the Copernicus Marine login instead.

  1. Get an account on the Mercator Ocean THREDDS server (https://www.mercator-ocean.eu).

  2. Give seagrid the login in ~/.netrc:

    machine tds.mercator-ocean.fr login my-user password ...
    
    chmod 600 ~/.netrc
    
  3. Check that the server accepts the login. check_auth asks the server for one dataset description and downloads nothing:

    from seagrid import glorys
    
    glorys.check_auth()     # True, or raises glorys.AuthError explaining why
    

Sources without an account#

These sources download from open servers, so they need no setup:

Source

Product

Server

oc_cci

ESA Ocean Colour CCI

oceancolour.org THREDDS

acspo

NOAA ACSPO L3S SST

NOAA CoastWatch

bicep_cp, bicep_poc

BICEP phytoplankton carbon, POC

CEDA

gebco

GEBCO bathymetry

CEDA

cafe

CAFE primary production

Oregon State University

mimoc

MIMOC climatology

NOAA PMEL

ecco2

ECCO2 cube92

APDRC (OPeNDAP)

scrippsgog

Scripps Gulf of Guinea model

UCSD

tiho_psd

Phytoplankton size distribution

PANGAEA

longhurst

Longhurst provinces (1995 version)

Marine Regions (VLIZ), SAERI

The 2007 Longhurst grid (longhurst, the default version) has no server any more and must be copied into the data directory. The local sources (ifado, psm, oc_cci_local, kd_cci, mercator12) read files from a mounted disk and need no account.