ocean_data_gateway.readers.local.stations

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

Bases: ocean_data_gateway.readers.local.LocalReader

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

kw

Contains space and time search constraints: min_lon, max_lon, min_lat, max_lat, min_time, max_time.

Type

dict

approach

approach is defined as ‘stations’ for this class.

Type

string

Attributes
catalog

Write then open catalog.

dataset_ids

Find dataset_ids for catalog.

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.

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.

write_catalog()

Write catalog file.

__init__(kwargs)[source]
Parameters

kwargs (dict) –

Can contain arguments to pass onto the base LocalReader class (catalog_name, parallel, filenames). The dict entries to initialize this class are: * kw: dict, optional

Contains space and time search constraints: min_lon, max_lon, min_lat, max_lat, min_time, max_time.

Methods

__init__(kwargs)

param kwargs

Can contain arguments to pass onto the base LocalReader 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.

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.

write_catalog()

Write catalog file.

Attributes

catalog

Write then open catalog.

dataset_ids

Find dataset_ids for catalog.

meta

Rearrange the individual metadata into a dataframe.

_abc_impl = <_abc_data object>
property catalog

Write then open catalog.

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.

TODO: SHOULD I INCLUDE TIME RANGE?

property dataset_ids

Find dataset_ids for catalog.

Notes

The dataset_ids are read from the catalog, so the catalog is created before this can happen.

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.

meta_by_dataset(dataset_id)

Return the catalog metadata for a single dataset_id.

TODO: Should this return intake-style or a row of the metadata dataframe?

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.

write_catalog()

Write catalog file.