Welcome to intake-erddap’s documentation!¶
Intake ERDDAP¶
Intake is a lightweight set of tools for loading and sharing data in data science projects. Intake ERDDAP provides a set of integrations for ERDDAP.
Quickly identify all datasets from an ERDDAP service in a geographic region, or containing certain variables.
Produce a pandas DataFrame for a given dataset or query.
Get an xarray Dataset for the Gridded datasets.
The project is available on Github.
TODO: Summary
The Key features are:
Pandas DataFrames for any TableDAP dataset.
xarray Datasets for any GridDAP datasets.
- Query by any or all:
bounding box
time
CF
standard_name
variable name
Plaintext Search term
Save catalogs locally for future use.
Requirements¶
Python >= 3.8
Installation¶
In the very near future, we will be offering the project on conda. Currently the
project is available on PyPI, so it can be installed using pip
:
pip install intake-erddap
Examples¶
To create an intake catalog for all of the ERDDAP’s TableDAP offerings use:
import intake
catalog = intake.open_erddap_cat(
server="https://erddap.sensors.ioos.us/erddap"
)
The catalog objects behave like a dictionary with the keys representing the
dataset’s unique identifier within ERDDAP, and the values being the
TableDAPSource
objects. To access a source object:
source = catalog["datasetid"]
From the source object, a pandas DataFrame can be retrieved:
df = source.read()
Scenarios¶
Consider a case where you need to find all wind data near Florida.:
import intake
from datetime import datetime
bbox = (-87.84, 24.05, -77.11, 31.27)
catalog = intake.open_erddap_cat(
server="https://erddap.sensors.ioos.us/erddap",
bbox=bbox,
start_time=datetime(2022, 1, 1),
end_time=datetime(2023, 1, 1),
standard_names=["wind_speed", "wind_from_direction"],
)
df = next(catalog.values()).read()
time (UTC) | wind_speed (m.s-1) | wind_from_direction (degrees) | |
---|---|---|---|
0 | 2022-12-14T19:40:00Z | 7.0 | 140.0 |
1 | 2022-12-14T19:20:00Z | 7.0 | 120.0 |
2 | 2022-12-14T19:10:00Z | NaN | NaN |
3 | 2022-12-14T19:00:00Z | 9.0 | 130.0 |
4 | 2022-12-14T18:50:00Z | 9.0 | 130.0 |
... | ... | ... | ... |
48296 | 2022-01-01T00:40:00Z | 4.0 | 120.0 |
48297 | 2022-01-01T00:30:00Z | 3.0 | 130.0 |
48298 | 2022-01-01T00:20:00Z | 4.0 | 120.0 |
48299 | 2022-01-01T00:10:00Z | 4.0 | 130.0 |
48300 | 2022-01-01T00:00:00Z | 4.0 | 130.0 |