Downloads#

Every source downloads through seagrid.download, so they all behave the same way:

  • A file is written to <name>.partial and renamed when complete, so an interrupted download never looks like a cached file.

  • Transient server errors (HTTP 429/5xx, dropped connections) are retried with exponential backoff.

  • A failure raises DownloadError, and refused or missing credentials raise AuthenticationError. The original exception is attached as __cause__.

Module

Service

Main functions

http

any HTTP(S) server

fetch, remote_exists, list_links, uncompress, extract_zip

earthdata

NASA Earthdata / CMR

session, fetch, search, exists

copernicus

Copernicus Marine

get_files, subset, exists

opendap

THREDDS / Hyrax OPeNDAP

open_remote, cache_dataset, retrieve, compute_all

obpg

OB.DAAC naming rules

filename, url, cmr_short_name

from seagrid.download import http, obpg, earthdata

name = obpg.filename("2023-06-01", "chlor_a", "daily")
earthdata.fetch(obpg.url(name), "~/data/modis/")

Which dates are downloaded#

seagrid.inventory keeps a small SQLite record of downloaded files and prints a collapsed summary:

GLORYS12V1, 2006-01-01 to 2008-12-31: 457 of 1096 days downloaded
2006         downloaded
2007         partial (92 of 365 days)
  Jan-May    missing
  Jun-Aug    downloaded
  Sep        partial (5 of 30 days)
    downloaded  1-5
    missing     6-30
  Oct-Dec    missing
2008         missing