Skip to content

Design: the xarray data model for multiresolution /2 stores (DataTree vs resolution dimension vs custom multi-res index) #37

Description

@espg

🤖 from Claude (filed at espg's direction, 2026-08-05; the model question behind issue #36's mechanism)

Motivation

zagg-pyramid/2 stores are inherently multiresolution (englacial/zagg#381, point (12)): a guaranteed ladder at every order 0…base plus the native resolution, with the finest level already anchored in the root metadata (morton_hive.cell_order, dggs.refinement_level) and the full set in the expanded pyramid.overviews block. Issue #36 covers exposing the ladder; this issue decides what the ladder is in xarray terms — before ad-hoc per-level opens calcify into the de-facto model.

The design questions

  1. Container idiom. xarray.DataTree (now upstream) with one dataset per order — the natural multiscales mapping — vs one Dataset with a stacked resolution coordinate, vs the status quo family of independent Datasets. DataTree is the lean; the others deserve a written rejection.
  2. Coordinate identity across levels. Morton prefix nesting gives exact parent/child cell relations between any two orders — what does that buy in the API? (sel traversal to a coarser order; a "lift/project" operation between levels; groupby-parent.) What coordinate/index metadata must each level carry for those to be lawful?
  3. Cross-resolution operation policy. Explicitly NOT via upstream xdggs — upstream forbids cross-resolution alignment in one index (recorded prior ruling), and that prohibition is the reason this design lives here. Within this package the fixed ladder makes cross-res relations well-defined; the policy should say which ops are exact (exact-class fields: order-to-coarser aggregation is exactly the stored coarser level — the doctrine upgrade), which are approximate-with-provenance (digest fields at recorded merges-from-raw), and which are refused (implicit alignment between arbitrary orders).
  4. Index design. One MortonMocIndex per level (status quo) vs a single multiresolution index owning the prefix relations. Interaction with lazy/cubed arrays at each level.
  5. Convention mapping. How the zagg-side convention attrs (declare the multiresolution ladder in machine-readable convention metadata (zarr multiscales + DGGS refinement) englacial/zagg#392) map onto the chosen idiom (multiscales entries → DataTree groups), manifest-first as always.
  6. Compatibility posture toward xdggs: the register_dggs plugin route needs no upstream PR (recorded prior finding) — per-level xdggs interop as a side-door is plausible; it must not constrain the primary model.

Deliverable

A written model decision on this thread (options + rejection rationale), then implementation lands under issue #36. Refs: #1 (plan), #36 (mechanism), #21 (gridlook feeder), englacial/zagg#381, englacial/zagg#392.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions