pyozwald
Cached OzWALD time series for Australia — fetch once per grid point, never twice. OzWALD is ANU's Water and Landscape Dynamics dataset: modelled daily meteorology (~5 km) and 8-day biophysical variables (~500 m, MODIS-derived) served as one OPeNDAP NetCDF per variable per year. Every observation this machine ever samples lands in one SQLite store, so repeat requests, nearby coordinates in the same cell, and extended date ranges all reuse the same rows. Part of the Borevitz Lab ecosystem.
How it works
{data_root}/ozwald_store/
└── ozwald.db
├── observations(point, cadence, variable, date, value)
└── coverage(point, cadence, variable, year, through)
- Coordinates snap to a dedup grid matching each product's native resolution — 0.05° for daily meteorology, 0.005° for the 8-day variables — so nearby requests share one stored series per cadence.
- OzWALD's unit of delivery is one NetCDF per (variable, year), so
that's the unit of the coverage ledger.
Store.get_df(...)diffs the requested years × variables against it and samples only the missing cells; a whole year is stored even when a sub-range was requested, since the marginal cost is nil and it maximises reuse. throughrecords the last date a year's file actually contained — an in-progress year keeps being re-fetched until complete, then never again.- Writes are transactional (SQLite/WAL): a crash mid-fetch leaves the cell unrecorded, and the next run re-fetches it.
Usage
The core API is troi-agnostic — a coordinate, dates, and a cadence:
from datetime import date
from pyozwald.store import Store
store = Store()
met = store.get_df(-33.516, 148.373, date(2023, 1, 1), date(2023, 12, 31))
# daily meteorology: time, Pg, Tmax, Tmin, Uavg, Ueff, VPeff, ...
veg = store.get_df(-33.516, 148.373, date(2023, 1, 1), date(2023, 12, 31),
cadence='8day', variables=['NDVI', 'LAI', 'GPP'])
# 8-day biophysical series on the ~500 m grid
store.fill(-33.516, 148.373, date(2023, 1, 1), date(2023, 12, 31)) # → 0: already local
Pipelines that speak the shared troi.troi.Troi use the
adapters (evaluated at the bbox centre):
df = store.get_df_troi(troi, cadence='daily')
download_ozwald_daily(troi) and download_ozwald_8day(troi)
remain as thin wrappers.
Performance
Live measurements against NCI THREDDS — one grid point:
| Scenario | Fetched | Time |
|---|---|---|
| Cold fill — 2 daily variables × 1 year | 2 cells | 2.3 s |
| Same request again | nothing | 0.0 s |
| Nearby coordinate, same ~5 km cell | nothing | 0.0 s |
| Date range extended −1 year | 2 cells — the new year only | 1.8 s |
| 8-day NDVI, one year | 1 cell | 0.7 s |
| Read cached year (365 × 2) | — | 0.01 s |
(One cell = one variable × one year at one grid point.) Store footprint: ~100 KB for the five cells above. Absolute times vary with network and THREDDS load; the zeros are the point — they are ledger lookups, no network involved.
Install
pip
pip install git+https://github.com/thestochasticman/pyozwald.git
Dependencies (the troi core included, pulled from GitHub) are
declared in pyproject.toml and installed automatically.
From source
git clone https://github.com/thestochasticman/pyozwald.git
cd pyozwald
pip install -e .
Package design (shared across the lab's packages — no inheritance, composition only):
Troi(fromtroi) — identity: what region, what dates.OzWALD(pyozwald.ozwald) — config: endpoint, variable catalogs per cadence, dedup grid steps.Paths(pyozwald.paths) — derived location of the store for a givenConfig.grid— the dedup grids (pure, offline-testable math).Store(pyozwald.store) — ties them together.
Test
# offline (pure math + synthetic store):
python pyozwald/grid.py # True
python pyozwald/paths.py # True
python pyozwald/store.py # True
# live (small real samples from NCI THREDDS, incl. dedup assertions):
python pyozwald/download_ozwald.py # True
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 pyozwald-0.1.0.tar.gz.
File metadata
- Download URL: pyozwald-0.1.0.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ea218765bc94064e7ad4a13c87bfc024bbb6c8a66de91291a59a0b97364db00
|
|
| MD5 |
43f22c4f5a817a5ea11dc32ef060f8c2
|
|
| BLAKE2b-256 |
bb72102b47037c9444a77ade7c029e179eb7e44357608ece4c3b7adda3cda1e0
|
File details
Details for the file pyozwald-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyozwald-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d35feceb4639ccb074c79a0f94d9192f81742494cf9ab7d07927a3f4f2d6bfa3
|
|
| MD5 |
adf5b7f33a07483c62b2a91e081c8c95
|
|
| BLAKE2b-256 |
09ffec1a16b5e30ab80e230071f393877a310d5634e5a1fe82c6cce0cd0cb6d0
|