Load ERDDAP Datasets directly into xarray
Project description
ERDDAPy engine for xarray.
pip (or conda) install xarray-erddap and check if you load the erddapy engine:
import xarray as xr
xr.backends.list_engines()
If successful any ERDDAP URL should, that has a netcdf-like response, should work. Here are a few examples:
-
OPeNDAP
import xarray as xr url = "https://gliders.ioos.us/erddap/tabledap/amelia-20200825T1929" ds = xr.open_dataset(url, engine="erddapy")
-
Full NetCDF file (also works with the
ncCFandncCFMAresponses).url = "https://gliders.ioos.us/erddap/tabledap/amelia-20200825T1929.nc" ds = xr.open_dataset(url, engine="erddapy")
-
Sliced/Filtered URLs obatined from the ERDDAP web interface.
url = "https://gliders.ioos.us/erddap/tabledap/amelia-20200825T1929.nc?trajectory%2Cwmo_id%2Cprofile_id%2Ctime%2Clatitude%2Clongitude%2Cdepth%2Cconductivity&time%3E=2020-09-18T00%3A00%3A00Z&time%3C=2020-09-25T14%3A32%3A48Z" ds = xr.open_dataset(url, engine="erddapy")
Also works on griddap URLs.
-
OPeNDAP-griddap
url = "https://pae-paha.pacioos.hawaii.edu/erddap/griddap/etopo1_bedrock" ds = xr.open_dataset(url, engine="erddapy")
Note that griddap supports lazy loading! However, you can do it the ERDDAP way and pass a server-side sliced URL:
-
Sliced/Filtered griddap
url = "https://pae-paha.pacioos.hawaii.edu/erddap/griddap/etopo1_bedrock.nc?z%5B(-42.0):1:(-44.0)%5D%5B(-42.0):1:(-44.0)%5D" ds = xr.open_dataset(url, engine="erddapy")
NB: All URLs should be quoted, like the ones returned from ERDDAP's web-interface. If you are looking for human readable URLs, other non-netCDF responses, and/or programmatically building them, then erddapy is better suited for the task.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xarray_erddap-1.0.1.tar.gz.
File metadata
- Download URL: xarray_erddap-1.0.1.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
251e463068783152f11fab057471ce36868124df51e88076ed6395217e2e2f6d
|
|
| MD5 |
40668b9fc59c54d4c905d4288da79aaf
|
|
| BLAKE2b-256 |
12da53349d0ddf38c9b11bae0462ec2ed49b76b716ce0325c11b80c4a08b73d5
|
File details
Details for the file xarray_erddap-1.0.1-py3-none-any.whl.
File metadata
- Download URL: xarray_erddap-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aeb5ab48e43e1f5589717d9d49e6e052ce70c1cda6e2e9a61d1c07db7075d842
|
|
| MD5 |
890a074f5383fce610819b6eb2e65784
|
|
| BLAKE2b-256 |
b2ad5178a52f283caecb655d626830a952761161a9c156c04bceeef5043c0e4d
|