seagrid.sources.registry#
The registry of seagrid data sources.
Every DataSource subclass with a name is
registered when its module is imported. The modules of the built-in sources
are listed in BUILTIN_MODULES and imported on first use, so
get_source("ostia") works without importing anything first.
Module Attributes
Module of each built-in source, imported when the source is first requested. |
Functions
|
Return a data source object. |
Return the names of all available data sources (without aliases). |
|
|
Add a source class to the registry under its name and aliases. |
|
Return the class of a source. |
- seagrid.sources.registry.BUILTIN_MODULES: dict[str, str] = {'acspo': 'seagrid.sources.sst.acspo', 'avhrr': 'seagrid.sources.sst.ghrsst', 'bicep_cp': 'seagrid.sources.ocean_colour.carbon', 'bicep_poc': 'seagrid.sources.ocean_colour.carbon', 'cafe': 'seagrid.sources.pp.cafe', 'cmems_globgc': 'seagrid.sources.model.cmems_globgc', 'ecco2': 'seagrid.sources.model.ecco2', 'gebco': 'seagrid.sources.static.gebco', 'glorys': 'seagrid.sources.model.glorys', 'glorys_carb': 'seagrid.sources.model.glorys_carb', 'ifado': 'seagrid.sources.local', 'kd_cci': 'seagrid.sources.local', 'longhurst': 'seagrid.sources.static.longhurst', 'mercator12': 'seagrid.sources.local', 'mimoc': 'seagrid.sources.model.mimoc', 'modis_a': 'seagrid.sources.ocean_colour.modis', 'mur25': 'seagrid.sources.sst.ghrsst', 'oc_cci': 'seagrid.sources.ocean_colour.oc_cci', 'oc_cci_local': 'seagrid.sources.local', 'olci': 'seagrid.sources.ocean_colour.olci', 'ostia': 'seagrid.sources.sst.ostia', 'psm': 'seagrid.sources.local', 'scrippsgog': 'seagrid.sources.model.scrippsgog', 'seawifs': 'seagrid.sources.ocean_colour.seawifs', 'smoc': 'seagrid.sources.model.smoc', 'tiho_psd': 'seagrid.sources.ocean_colour.carbon', 'viirs': 'seagrid.sources.ocean_colour.viirs'}#
Module of each built-in source, imported when the source is first requested.
- seagrid.sources.registry.get_source(name, variant=None, **overrides)[source]#
Return a data source object.
- Parameters:
- Returns:
DataSource- Return type:
Examples
>>> import seagrid >>> ostia = seagrid.get_source("ostia") >>> ostia.name, ostia.timetypes ('ostia', ('daily', '8day', 'monthly'))
- seagrid.sources.registry.list_sources()[source]#
Return the names of all available data sources (without aliases).
- seagrid.sources.registry.register(cls)[source]#
Add a source class to the registry under its name and aliases.
Called automatically for every
DataSourcesubclass that setsname(passregister=Falsein the class statement to opt out).- Parameters:
cls (
type) – The source class.- Returns:
type– cls, so this can be used as a decorator.- Raises:
ValueError – If another class is already registered under one of the names.
- Return type: