ocean_data_gateway.readers.local.region¶
- class ocean_data_gateway.readers.local.region(kwargs)[source]¶
Bases:
ocean_data_gateway.readers.local.LocalReaderInherits from LocalReader to search over a region of space and time.
- kw¶
Contains space and time search constraints: min_lon, max_lon, min_lat, max_lat, min_time, max_time.
- Type
dict
- variables¶
Variable names if you want to limit the search to those. This is currently ignored.
- Type
string or list
- approach¶
approach is defined as ‘region’ for this class.
- Type
string
- Attributes
catalogWrite then open catalog.
dataset_idsFind dataset_ids for catalog.
metaRearrange the individual metadata into a dataframe.
Methods
data()Read in data for all dataset_ids.
data_by_dataset(dataset_id)Return the data for a single dataset_id.
meta_by_dataset(dataset_id)Return the catalog metadata for a single dataset_id.
Write catalog file.
- __init__(kwargs)[source]¶
- Parameters
kwargs (dict) –
Can contain arguments to pass onto the base AxdsReader class (catalog_name, parallel, filenames). The dict entries to initialize this class are:
kw: dict Contains space and time search constraints: min_lon, max_lon, min_lat, max_lat, min_time, max_time. Not used to filter data currently.
variables: string or list, optional Variable names if you want to limit the search to those. This is not used to filter data currently.
Methods
__init__(kwargs)- param kwargs
Can contain arguments to pass onto the base AxdsReader class
data()Read in data for all dataset_ids.
data_by_dataset(dataset_id)Return the data for a single dataset_id.
meta_by_dataset(dataset_id)Return the catalog metadata for a single dataset_id.
Write catalog file.
Attributes
Write then open catalog.
Find dataset_ids for catalog.
Rearrange the individual metadata into a dataframe.
- property catalog¶
Write then open catalog.
- data()¶
Read in data for all dataset_ids.
- Returns
A dictionary with keys of the dataset_ids and values the data of type
If `filename` is a csv file (a pandas DataFrame)
If `filename` is a netcdf file (an xarray Dataset)
Notes
This is either done in parallel with the multiprocessing library or in serial.
- 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.
- 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?
- write_catalog()¶
Write catalog file.
