ocean_data_gateway.readers.erddap.stations

class ocean_data_gateway.readers.erddap.stations(kwargs)[source]

Bases: ocean_data_gateway.readers.erddap.ErddapReader

Inherits from ErddapReader to search for 1+ stations or dataset_ids.

kw

Contains space and time search constraints: min_time, max_time.

Type

dict, optional

variables

variables is None for this class since we read search by dataset_id or station name.

Type

None

approach

approach is defined as ‘stations’ for this class.

Type

string

Attributes
dataset_ids

Find dataset_ids for server.

meta

Rearrange the individual metadata into a dataframe.

Methods

clear()

data([dataset_ids])

Read in data for some or all dataset_ids.

data_by_dataset(dataset_id)

Return the data for a single dataset_id.

find_dataset_id_from_station(station)

Find dataset_id from station name.

get(k[,d])

items()

keys()

Regular dict-like way to return keys.

meta_by_dataset(dataset_id)

Return the catalog metadata for a single dataset_id.

pop(k[,d])

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem()

as a 2-tuple; but raise KeyError if D is empty.

setdefault(k[,d])

update([E, ]**F)

If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v

values()

Regular dict-like way to return values.

__init__(kwargs)[source]
Parameters

kwargs (dict) –

Can contain arguments to pass onto the base ErddapReader class (known_server, protocol, server, parallel). The dict entries to initialize this class are: * kw: dict, optional

Contains time search constraints: min_time, max_time. If not input, all time will be used.

  • stations: string, list, optional Input station names as they might be commonly known and therefore can be searched for as a query term. The station names can be input as something like “TABS B” or “8771972” and has pretty good success. Or, input the exact dataset_ids for the data you want, corresponding to the databases that are being searched, so in this case they need to be the ERDDAP server’s dataset_ids.

Notes

The known_server needs to match the station name or dataset_id you are searching for.

Methods

__init__(kwargs)

param kwargs

Can contain arguments to pass onto the base ErddapReader class

clear()

data([dataset_ids])

Read in data for some or all dataset_ids.

data_by_dataset(dataset_id)

Return the data for a single dataset_id.

find_dataset_id_from_station(station)

Find dataset_id from station name.

get(k[,d])

items()

keys()

Regular dict-like way to return keys.

meta_by_dataset(dataset_id)

Return the catalog metadata for a single dataset_id.

pop(k[,d])

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem()

as a 2-tuple; but raise KeyError if D is empty.

setdefault(k[,d])

update([E, ]**F)

If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v

values()

Regular dict-like way to return values.

Attributes

dataset_ids

Find dataset_ids for server.

meta

Rearrange the individual metadata into a dataframe.

_abc_impl = <_abc_data object>
clear()None.  Remove all items from D.
data(dataset_ids=None)

Read in data for some or all dataset_ids.

NOT USED CURRENTLY

Once data is read in for a dataset_ids, it is remembered.

See full documentation in utils.load_data().

data_by_dataset(dataset_id)

Return the data for a single dataset_id.

Returns

Return type

A tuple of (dataset_id, data), where data type is a pandas DataFrame

Notes

Data is read into memory.

property dataset_ids

Find dataset_ids for server.

Notes

The dataset_ids are found by querying the metadata through the ERDDAP server.

The number of dataset_ids can change if a variable is removed from the list of variables and this is rerun.

find_dataset_id_from_station(station)

Find dataset_id from station name.

Parameters

station (string) – Station name for which to search for dataset_id

get(k[, d])D[k] if k in D, else d.  d defaults to None.
items()a set-like object providing a view on D’s items
keys()

Regular dict-like way to return keys.

property meta

Rearrange the individual metadata into a dataframe.

Notes

This should exclude duplicate entries.

meta_by_dataset(dataset_id)

Return the catalog metadata for a single dataset_id.

pop(k[, d])v, remove specified key and return the corresponding value.

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem()(k, v), remove and return some (key, value) pair

as a 2-tuple; but raise KeyError if D is empty.

setdefault(k[, d])D.get(k,d), also set D[k]=d if k not in D
update([E, ]**F)None.  Update D from mapping/iterable E and F.

If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v

values()

Regular dict-like way to return values.