duckdb-zarr

field guide

duckdb-zarr for climate.

Explore temperature over time and public precipitation data using the repository's existing SQL examples. Run these in DuckDB with the Zarr extension loaded; see the loading instructions. These are static SQL examples, not browser-executed cells.

For Landsat imagery and vegetation indices, see the geoscience example.

Monthly mean air temperature

Group the real air-temperature tutorial dataset by month. CF-encoded time coordinates are decoded to DuckDB timestamps, so ordinary date functions work directly.

Run make generate_fixtures first, then run this SQL from the repository root. The generated data are not included in this website.

SELECT date_trunc('month', time) AS month, AVG(air) AS mean_air
FROM 'test/fixtures/xarray_tutorial/air_temperature.zarr'
WHERE time >= TIMESTAMP '2014-01-01'
GROUP BY month ORDER BY month;

Public precipitation data

Read the public GPCP store directly over HTTPS. Select the precipitation table by its dimensions because the store also contains coordinate-bound arrays. This query needs network access, but no local dataset preparation. If the external endpoint is unavailable, the local example above still works.

SELECT time, latitude, longitude, precip
FROM read_zarr(
  'https://ncsa.osn.xsede.org/Pangeo/pangeo-forge/gpcp-feedstock/gpcp.zarr',
  dims=['time','latitude','longitude']
)
LIMIT 10;

Both queries also appear in the repository quick start. See the real-data HTTP tests for the GPCP checks and tested scientific domains for the broader climate and ocean coverage.

Bring your own questions.
duckdb-zarr for the answers.