OceanColor.storage.OceanColorDB

class OceanColor.storage.OceanColorDB(username: str, password: str, download: bool = True)[source]

An abstraction of NASA’s Ocean Color database

While OceanColorDB provides access to NASA’s ocean color data, it is the backend that manages the data accessed. Currently, there is only one backend based on local files and directories. But it is planned more alternatives such as AWS S3 storage.

Examples

>>> db = OceanColorDB(username, password)
>>> db.backend = FileSystem('./')
>>> ds = db['T2004006.L3m_DAY_CHL_chlor_a_4km.nc']
>>> ds.attrs

Notes

Think about the best way to define the backend. Maybe add an optional parameter path, which if available is used to define the backend as a FileSystem.

__init__(username: str, password: str, download: bool = True)[source]

Initializes OceanColorDB

Parameters
  • username (str) – The username registered with EarthData

  • password (str) – The password associated the the username

  • download (bool, optional) – Download new data when required, otherwise limits to the already available datasets. Default is true, i.e. download when necessary.

Methods

__init__(username, password[, download])

Initializes OceanColorDB

backend()

Placeholder to reinforce the use of a backend

Attributes

lock

time_last_download