Developer Interface¶
This part of the documentation covers all the interfaces of yodapy.
Data Sources
OOI Object
-
class
yodapy.datasources.ooi.OOI.
OOI
(ooi_username=None, ooi_token=None, cloud_source=False, **kwargs)[source]¶ Bases:
yodapy.datasources.ooi.CAVA.CAVA
OOI Object for Ocean Observatories Initiative Data Retrieval.
-
ooi_name
¶ Username for OOI API Data Access.
- Type
str
-
ooi_token
¶ Token for OOI API Data Access.
- Type
str
-
source_name
¶ Data source name.
- Type
str
-
regions
¶ Table of OOI regions.
- Type
pandas.DataFrame
-
sites
¶ Table of OOI sites.
- Type
pandas.DataFrame
-
instruments
¶ Table of available instrument streams.
- Type
pandas.DataFrame
-
global_ranges
¶ Table of global ranges for each instrument streams.
- Type
pandas.DataFrame
-
deployments
¶ Table of deployments for filtered instrument streams.
- Type
pandas.DataFrame
-
annotations
¶ Table of annotations for filtered instrument streams.
- Type
pandas.DataFrame
-
start_date
¶ List of start dates requested.
- Type
list
-
end_date
¶ List of end dates requested.
- Type
list
-
last_request
¶ List of requested urls and parameters.
- Type
list
-
last_m2m_urls
¶ List of requested M2M urls.
- Type
list
-
cava_arrays
¶ Cabled array team Arrays vocab table.
- Type
pandas.DataFrame
-
cava_sites
¶ Cabled array team Sites vocab table.
- Type
pandas.DataFrame
-
cava_infrastructures
¶ Cabled array team Infrastructures vocab table.
- Type
pandas.DataFrame
-
cava_instruments
¶ Cabled array team Instruments vocab table.
- Type
pandas.DataFrame
-
cava_parameters
¶ Cabled array team Parameters vocab table.
- Type
pandas.DataFrame
-
property
annotations
¶ Return instruments annotations
-
data_availability
()[source]¶ Plots data availability of desired instruments.
- Returns
Instrument Stream legend
- Return type
pandas.DataFrame
-
property
deployments
¶ Return instruments deployments
-
download_netcdfs
(destination='.', timeout=3600)[source]¶ Download netcdf files from the catalog created from data request.
- Parameters
destination (str, optional) – Location to save netcdf file. Default will save in current directory.
timeout (int, optional) – Expected download time before timing out in seconds. Defaults to 30min or 3600s.
- Returns
List of exported netcdf.
- Return type
list
-
property
end_date
¶ Return requested end date(s)
-
property
global_ranges
¶ Return global ranges
-
property
instruments
¶
-
property
last_m2m_urls
¶ Return last request m2m urls
-
property
last_requests
¶ Return last request url and parameters
-
property
regions
¶ Returns the OOI regions
-
request_data
(begin_date, end_date, data_type='netcdf', limit=- 1, **kwargs)[source]¶ Request data for filtered instruments.
- Parameters
begin_date (str) – Begin date of desired data in ISO-8601 Format.
end_date (str) – End date of desired data in ISO-8601 Format.
data_type (str) – Desired data type. Either ‘netcdf’ or ‘json’.
limit (int, optional) – Desired data points. Required for ‘json’
data_type
. Max is 20000.**kwargs –
Optional Keyword arguments.
time_check - set to true (default) to ensure the request times fall within the stream data availability
exec_dpa - boolean value specifying whether to execute all data product algorithms to return L1/L2 parameters (Default is True)
provenance - boolean value specifying whether provenance information should be included in the data set (Default is True)
email - provide email.
- Returns
Modified OOI Object. Use
raw()
to see either data url for netcdf or json result for json.- Return type
self
-
search
(region=None, site=None, node=None, instrument=None, stream_type='Science', stream_method=None, stream=None, parameter=None)[source]¶ Perform a search, and filters data catalog
- Parameters
region (str) – Region name. If multiple use comma separated.
site (str) – Site name. If multiple use comma separated.
node (str) – Node name. If multiple use comma separated.
instrument (str) – Instrument name. If multiple use comma separated.
stream_type (str) – Stream type. Either ‘Science’ or ‘Engineering’. If multiple use comma separated.
stream_method (str) – Stream method. If multiple use comma separated.
stream (str) – Stream name. If multiple use comma separated.
parameter (str) – Parameter name. If multiple use comma separated.
- Returns
Modified OOI Object
- Return type
self
-
property
sites
¶ Returns the OOI sites
-
property
source_name
¶ Return data source name
-
property
start_date
¶ Return requested start date(s)
-
to_xarray
(**kwargs)[source]¶ Retrieve the OOI streams data and export to Xarray Datasets, saving in memory.
- Parameters
**kwargs – Keyword arguments for xarray open_mfdataset.
- Returns
List of xarray datasets
- Return type
list
-
view_instruments
()[source]¶ DEPRECATED. Shows the current instruments requested. Use OOI.instruments attribute instead.
- Returns
Pandas dataframe of the instruments.
- Return type
DataFrame
-
-
class
yodapy.datasources.ooi.CAVA.
CAVA
[source]¶ Bases:
yodapy.datasources.datasource.DataSource
-
property
cava_arrays
¶ Cabled array team Arrays vocab table.
-
property
cava_infrastructures
¶ Cabled array team Infrastructures vocab table.
-
property
cava_instruments
¶ Cabled array team Instruments vocab table.
-
property
cava_parameters
¶ Cabled array team Parameters vocab table.
-
property
cava_sites
¶ Cabled array team Sites vocab table.
-
property
Utilities
-
yodapy.utils.creds.
set_credentials_file
(data_source, username, token)[source]¶ Sets and saves the credential file for a data source.
- Parameters
data_source (str) – Data source string. Currently only supports ‘ooi’.
username (str) – Username value for the specified data_source.
token (str) – Token or password value for the specified data_source.