intake_erddap.GridDAPReader¶
- class intake_erddap.GridDAPReader(*args, metadata: dict | None = None, output_instance: str | None = None, **kwargs)[source]¶
Creates a Data Reader for an ERDDAP GridDAP Dataset.
- Parameters:
server (str) –
URL to the ERDDAP service. Example:
"https://coastwatch.pfeg.noaa.gov/erddap"Note
Do not include a trailing slash.
dataset_id (str) – The dataset identifier from ERDDAP.
constraints (dict, optional) – A mapping of conditions and constraints.
chunks (None or int or dict or str, optional) – If chunks is provided, it is used to load the new dataset into dask arrays. chunks=-1 loads the dataset with dask using a single chunk for all arrays. chunks={} loads the dataset with dask using engine preferred chunks if exposed by the backend, otherwise with a single chunk for all arrays. chunks=’auto’ will use dask auto chunking taking into account the engine preferred chunks. See dask chunking for more details.
xarray_kwargs (dict, optional) – Arguments to be passed to the xarray open_dataset function.
Examples
Readers are normally returned from a catalog object, but a reader can be instantiated directly:
>>> reader = GridDAPReader("https://coastwatch.pfeg.noaa.gov/erddap", "charmForecast1day", ... chunks={"time": 1})
Getting an xarray dataset from the reader object:
>>> ds = reader.read()
Once the dataset object has been instantiated, the dataset’s full metadata is available in the reader.
>>> reader.metadata {'catalog_dir': '', 'dims': {'time': 1182, 'latitude': 391, 'longitude': 351}, 'data_vars': {'pseudo_nitzschia': ['time', 'latitude', 'longitude'], 'particulate_domoic': ['time', 'latitude', 'longitude'], 'cellular_domoic': ['time', 'latitude', 'longitude'], 'chla_filled': ['time', 'latitude', 'longitude'], 'r555_filled': ['time', 'latitude', 'longitude'], 'r488_filled': ['time', 'latitude', 'longitude']}, 'coords': ('time', 'latitude', 'longitude'), 'acknowledgement': ...
- Attributes:
dataThe BaseData this reader depends on, if it has one
- func_doc
tokenToken is computed from all non-_ attributes and then cached.
- transform
Methods
__call__(*args, **kwargs)New version of this instance with altered arguments
apply(func, *args[, output_instance])Make a pipeline by applying a function to this reader's output
discover(**kwargs)Part of the data
doc()Doc associated with loading function
from_dict(data)Recreate instance from the results of to_dict()
get_client(server, protocol, dataset_id, ...)Return an initialized ERDDAP Client.
output_doc()Doc associated with output type
pprint()Produce nice text formatting of the instance's contents
qname()package.module:class name of this class, makes str for import_name
read(*args, **kwargs)Produce data artefact
to_cat([name])Create a Catalog containing on this reader
to_dict()Dictionary representation of the instances contents
to_entry()Create an entry version of this, ready to be inserted into a Catalog
to_reader([outtype, reader])Make a different reader for the data used by this reader
auto_pipeline
check_imports
tab_completion_fixer
- __init__(*args, metadata: dict | None = None, output_instance: str | None = None, **kwargs)¶
Methods
__init__(*args[, metadata, output_instance])apply(func, *args[, output_instance])Make a pipeline by applying a function to this reader's output
auto_pipeline(outtype[, avoid])check_imports()discover(**kwargs)Part of the data
doc()Doc associated with loading function
from_dict(data)Recreate instance from the results of to_dict()
get_client(server, protocol, dataset_id, ...)Return an initialized ERDDAP Client.
output_doc()Doc associated with output type
pprint()Produce nice text formatting of the instance's contents
qname()package.module:class name of this class, makes str for import_name
read(*args, **kwargs)Produce data artefact
tab_completion_fixer(item)to_cat([name])Create a Catalog containing on this reader
to_dict()Dictionary representation of the instances contents
to_entry()Create an entry version of this, ready to be inserted into a Catalog
to_reader([outtype, reader])Make a different reader for the data used by this reader
Attributes
dataThe BaseData this reader depends on, if it has one
funcfunction name for loading data
func_docdocstring origin if not from func
implementsdatatype(s) this applies to
importstop-level packages required to use this
optional_importspackages that might be required by some options
other_funcsfunction names to recognise when matching user calls
output_instancetype the reader produces
tokenToken is computed from all non-_ attributes and then cached.
transform