ocean_data_gateway.gateway.Gateway¶
- class ocean_data_gateway.gateway.Gateway(**kwargs)[source]¶
Bases:
objectWraps together the individual readers in order to have a single way to search.
- kwargs_all¶
Input keyword arguments that are not specific to one of the readers. These may include “approach”, “parallel”, “kw” containing the time and space region to search for, etc.
- Type
dict
- kwargs¶
Keyword arguments that contain specific arguments for the readers.
- Type
dict
- Attributes
dataReturn the data, given metadata.
dataset_idsFind dataset_ids for each source/reader.
metaFind and return metadata for datasets.
sourcesSet up data sources (readers).
- __init__(**kwargs)[source]¶
- Parameters
kw (dict) – Contains space and time search constraints: min_lon, max_lon, min_lat, max_lat, min_time, max_time.
approach (string) – approach is defined as ‘stations’ or ‘region’ depending on user choice.
parallel (boolean, optional) – If True, run with simple parallelization using multiprocessing. If False, run serially. True by default. If input in this manner, the same value is used for all readers. If input by individual reader dictionary, the value can vary by reader.
readers (ocean_data_gateway Reader, list of readers, optional) – Use this to use fewer than the full set of readers. For example, readers=odg.erddap or to specifically include all by name readers = [odg.ErddapReader, odg.axdsReader, odg.localReader].
erddap (dict, optional) – Dictionary of reader specifications. For example, erddap={‘known_server’: ‘ioos’}. See odg.erddap.ErddapReader for more input options.
axds (dict, optional) – Dictionary of reader specifications. For example, axds={‘axds_type’: ‘platform2’}. See odg.axds.AxdsReader for more input options.
local (dict, optional) – Dictionary of reader specifications. For example, local={‘filenames’: filenames} for a list of filenames. See odg.local.LocalReader for more input options.
Notes
To select search variables, input the variable names to each reader individually in the format erddap={‘variables’: [list of variables]}. Make sure that the variable names are correct for each individual reader. Check individual reader docs for more information.
Input keyword arguments that are not specific to one of the readers will be collected in local dictionary kwargs_all. These may include “approach”, “parallel”, “kw” containing the time and space region to search for, etc.
Input keyword arguments that are specific to readers will be collected in local dictionary kwargs.
Methods
__init__(**kwargs)- param kw
Contains space and time search constraints: min_lon, max_lon,
Attributes
Return the data, given metadata.
Find dataset_ids for each source/reader.
Find and return metadata for datasets.
Set up data sources (readers).
- property data¶
Return the data, given metadata.
Notes
This is either done in parallel with the multiprocessing library or in serial.
- property dataset_ids¶
Find dataset_ids for each source/reader.
- Returns
- Return type
A list of dataset_ids where each entry in the list corresponds to one source/reader, which in turn contains a list of dataset_ids.
- property meta¶
Find and return metadata for datasets.
- Returns
- Return type
A list with an entry for each reader. Each entry in the list contains a pandas DataFrames of metadata for that reader.
Notes
This is done by querying each data source function for metadata and then using the metadata for quick returns.
This will not rerun if the metadata has already been found.
Different sources have different metadata, though certain attributes are always available.
TO DO: SEPARATE DATASOURCE FUNCTIONS INTO A PART THAT RETRIEVES THE DATASET_IDS AND METADATA AND A PART THAT READS IN THE DATA.
- property sources¶
Set up data sources (readers).
Notes
- All readers are included by default (readers as listed in odg._SOURCES). See
__init__ for options.
