oceanum.datamesh.Datasource

class oceanum.datamesh.Datasource(datasource_id, geometry=None, name=None, description=None, tstart=None, tend=None, parchive=None, schema={}, coordinates={}, tags=[], links=[], info={}, details=None, last_modified=None, **extra_kwargs)[source]

Datasource class

Attributes

attributes

Datasource global attributes

bounds

Bounding box of datasource geographical extent

container

Container type for datasource Is one of: - xarray.Dataset - pandas.DataFrame - geopandas.GeoDataFrame

description

Datasource description

geometry

Geometry of datasource extent or location

name

Human readable name of datasource

tend

datetime Latest time in datasource

tstart

datetime Earliest time in datasource

variables

Datasource variables (or properties)

Methods

__init__(datasource_id, geometry=None, name=None, description=None, tstart=None, tend=None, parchive=None, schema={}, coordinates={}, tags=[], links=[], info={}, details=None, last_modified=None, **extra_kwargs)[source]

Constructor for Datasource class

Parameters
  • datasource_id (string) – Unique datasource ID

  • geometry (dict, optional) – Datasource geometry as valid geojson dictionary or None. Defaults to None.

  • name (string, optional) – Datasource human readable name. Defaults to None.

  • description (string, optional) – Datasource description. Defaults to None.

  • tstart (string, optional) – Earliest time in datasource. Must be a valid ISO8601 datetime string. Defaults to “1970-01-01T00:00:00Z”.

  • tend (string, optional) – Latest time in datasource. Must be a valid ISO8601 datetime string or None. Defaults to None.

  • parchive (string, optional) – Datasource rolling archive period. Must be a valid ISO8601 interval string or None. Defaults to None.

  • schema (dict, optional) – Datasource schema. Defaults to {}.

  • coordinates (dict, optional) – Coordinates key. Defaults to {}.

  • tags (list, optional) – List of keyword tags. Defaults to [].

  • links (list, optional) – List of additional external URL links. Defaults to [].

  • info (dict, optional) – Dictionary of additional information. Defaults to {}.

  • details (string, optional) – URL link to additional details. Defaults to None.

  • last_modified (string, optional) – Latest time datasource metadata was modified. Must be a valid ISO8601 datetime string or None. Defaults to None.

load()[source]

Load the datasource into an in memory container or open zarr dataset

For datasources which load into DataFrames or GeoDataFrames, this returns an in memory instance of the DataFrame. For datasources which load into an xarray Dataset, an open zarr backed dataset is returned.