How-To Guide — Discover
Here, we describe some of the most common OceanDataCatalog discovery operations in a concise how-to guide (inspired by the excellent documentation of Icechunk).
For more detailed documentation on the OceanDataCatalog API, users should visit the API Reference.
How do I create an OceanDataCatalog instance?
- To create a new instance of the OceanDataCatalog from the
"odc-stac"(default catalog):
How do I see what Collections are available?
- To return a list of all STAC Collections in the root catalog, we can use the
available_collectionsproperty:
How do I search for a Collection?
- To search the OceanDataCatalog for the EN4.2.2 ocean analysis collection, we can use the
search()method:
After performing each search(), our catalog instance stores the results, meaning we can view all available Items from our search using the available_items property:
How do I search for only observational data?
- To search for only Items containing ocean observation data, we can perform the following
search():
- Items are restricted to either
dataset_type="model"ordataset_type="observation".
How do I search for only climatologies?
- To search for only Items containing climatologies, we can perform the following
search():
How do I search for an Item by variable standard name?
- To search for all Items (datasets) including a variable with the standard name
'sea_surface_temperature'in the'noc-npd-era5'collection, we can perform the followingsearch():
How do I search for a Item by ID?
- To search for all Items containing the substring
"domain"in their path-like ID, we can perform the followingsearch():
How do I open a Dataset from its Item ID?
- To open an Item as an
xarray.Dataset, we pass its path-like ID to theopen_dataset()method as follows:
- In the example above, we open the World Ocean Atlas 2023 monthly climatology (1991-2020) as a lazy
xarray.Datasetmeaning data is only loaded into memory when diagnostics are explicitly computed.
Summary
- We can search for Items in the OceanDataCatalog by passing any of the following parameters to the
search()method:
| Parameter | Description |
|---|---|
collection |
Collection name (e.g., "noc-npd-era5") |
dataset_type |
"model", "observation", or "reanalysis" |
product_type |
"climatology", "timeseries", or "ancillary" |
variable_name |
Variable name in the asset (e.g., "tos_con") |
standard_name |
CF standard name (e.g., "sea_surface_salinity") |
item_name |
Substring to match against Item IDs |