Sparse-DGGS xarray reader for morton-hive zarr stores: MOC-declared domains, arithmetic shard paths, lazy dense views.
moczarr opens stores written by zagg
under the morton-hive layout convention: a digit tree of self-describing
zarr v3 leaves keyed by morton decimal ids, with a static manifest and
hierarchical coverage MOCs declaring where data exists — so a reader
intersects an area of interest arithmetically instead of listing objects
or materializing a global grid.
import moczarr
ds = moczarr.open_hive("s3://bucket/prefix", aoi=["433142"], anonymous=True)open_hive()— one call from store root (local path ors3://bucket/prefix) to a lazyxarray.Dataset; AOI covers (packed morton words or decimal strings, mixed orders) and time-window scoping resolve through coverage metadata, not object listings. An AOI over no coverage is a data answer: a schema-correct empty dataset, not an error.- A MOC-backed lazy index (the default) — the row domain held as a
rank-space interval set built from the same coverage arithmetic that
selected the leaves; the on-disk cell arrays are never read, and the
mortoncoordinate is fabricated on demand (sel/isel/alignment as interval arithmetic;index_kind="pandas"materializes instead). - Exact NESTED fabrication — HEALPix NESTED
cell_idsderived exactly from the packed morton words ("NESTED is fabricated, never stored"). - Cross-resolution joins — morton truncation makes coarse↔fine work a
vectorized lookup:
parent_cellsfor fine→coarse groupby aggregation,join_coarsefor the coarse→fine broadcast, no I/O. - xdggs integration (
moczarr[xdggs]) — a registered"morton"grid, sods.dggs.sel_latlon,cell_boundaries,zoom_towork on anyopen_hiveresult.
Docs: espg.github.io/moczarr — quickstart, concepts, API reference, and the example notebook (runnable on binder via the badge above).
pip install moczarr # core reader
pip install 'moczarr[xdggs]' # + the ds.dggs accessor integrationUntil the first PyPI release lands, install from git:
pip install 'moczarr[xdggs] @ git+https://github.com/espg/moczarr'Development (uses uv):
uv sync --extra test --extra xdggs
uv run pytest -vmoczarr is the read side of a convention owned elsewhere: the morton-hive
layout and morton decimal ids are specified in the
mortie specification,
and the coverage tiers, commit-stamp semantics, and reader architecture in
zagg's sparse_coverage.md
(§4 coverage, §5 reader, §6 xarray extension). Plan and progress:
espg/moczarr#1.
MIT