ERDDAP catalog explorer¶
earthlens.erddap reaches many public ERDDAP servers from one backend. A curated catalog pins each dataset to a concrete (server_url, dataset_id, protocol); the protocol decides the output shape — griddap -> raster NetCDF, tabledap -> tabular DataFrame. This notebook is offline: it only reads the bundled catalog.
Open the catalog¶
In [ ]:
Copied!
from earthlens.erddap import Catalog
cat = Catalog()
len(cat)
from earthlens.erddap import Catalog
cat = Catalog()
len(cat)
Split by protocol¶
The protocol is what fixes a dataset's OUTPUT_KIND (and therefore whether aggregate= is accepted).
In [ ]:
Copied!
by_protocol = {}
for key, ds in cat.datasets.items():
by_protocol.setdefault(ds.protocol, []).append(key)
for protocol, keys in sorted(by_protocol.items()):
print(f'{protocol:9s} ({len(keys)}): {keys}')
by_protocol = {}
for key, ds in cat.datasets.items():
by_protocol.setdefault(ds.protocol, []).append(key)
for protocol, keys in sorted(by_protocol.items()):
print(f'{protocol:9s} ({len(keys)}): {keys}')
Inspect a row¶
Each row is self-describing — server, id, protocol, default variables, and (for griddap) the grid dimension order.
In [ ]:
Copied!
for key in ['NOAA_DHW', 'cwwcNDBCMet']:
ds = cat.get(key)
print(key)
print(' server :', ds.server_url)
print(' protocol:', ds.protocol)
print(' vars :', ds.variables)
if ds.protocol == 'griddap':
print(' dims :', ds.dim_names)
print(' title :', ds.title)
for key in ['NOAA_DHW', 'cwwcNDBCMet']:
ds = cat.get(key)
print(key)
print(' server :', ds.server_url)
print(' protocol:', ds.protocol)
print(' vars :', ds.variables)
if ds.protocol == 'griddap':
print(' dims :', ds.dim_names)
print(' title :', ds.title)
Reach it through the facade¶
Users do not import the subpackage — the unified EarthLens facade resolves the erddap key (alias ioos).
In [ ]:
Copied!
from earthlens.core import EarthLens
print('erddap' in EarthLens.DataSources)
print('ioos' in EarthLens.DataSources)
from earthlens.core import EarthLens
print('erddap' in EarthLens.DataSources)
print('ioos' in EarthLens.DataSources)
Unknown ids raise with a did-you-mean hint¶
In [ ]:
Copied!
try:
cat.get('NOAA_DH')
except ValueError as exc:
print(exc)
try:
cat.get('NOAA_DH')
except ValueError as exc:
print(exc)