Skip to content

Adapt qed to the pyre::grid reimplementation#86

Open
aivazis wants to merge 8 commits into
mainfrom
grid
Open

Adapt qed to the pyre::grid reimplementation#86
aivazis wants to merge 8 commits into
mainfrom
grid

Conversation

@aivazis

@aivazis aivazis commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Adapt qed to the pyre::grid reimplementation.

This tracks the pyre grid rewrite (pyre#211), which retires the per-cell-type grid
bindings and the typed-grid Python classes in favor of a single type-erased grid that
presents the buffer protocol. qed consumed the old model in three places — its C++ tile
generators, their bindings, and the Python readers — all of which are reworked here. The
numerical kernels in lib/qed are unchanged.

Grid bindings

The tile generators fall into two families:

  • native and isce2 take a grid as their source. Each binding is replaced by one
    wrapper that receives a py::buffer (the erased grid, or anything else that speaks the
    buffer protocol), rebuilds a read-only typed grid over it with onGrid, and dispatches
    on the buffer's cell format to the existing kernel. The shared helper lives in
    ext/qed/grid.h/grid.icc: onGrid<dim, cellTs...> for the dispatch, and asGrid,
    asIndex, asShape for the conversions. This collapses the old per-cell-type overload
    piles to one wrapper per generator.

  • nisar reads a tile out of an HDF5 dataset (using an on-disk datatype) and only uses
    the grid type at compile time for the tile geometry. Those wrappers keep the dataset and
    datatype and convert the geometry. The stack generators take a list of datasets; the
    masked variants take a second dataset for the mask; the BFPQ generators take the lookup
    table as a buffer, which asBFPQ rebuilds into the small heap grid the kernels expect.

Geometry arguments accept any Python iterable — tuple, list, or generator — so callers hand
in coordinates without wrapping them.

Readers

The readers no longer build Shape2D/Index2D/Canonical objects or per-type grid
factories. The three memory-mapped-file readers (native MemoryMap, the isce2 datasets)
lay a pyre.grid.map erased grid over the file; the rest pass their geometry as plain
sequences to the tile generators.

Datatypes

Each concrete datatype carries a cell attribute — the pyre memory cell name (float32,
complex64, …) — which is what pyre.grid wants when it lays a grid over memory. The
existing tag remains the class-name form used to build qed's own type-specialized binding
names (profileFloat).

Dependency

Requires pyre#211. Verified against the live client on NISAR GUNW products — the nisar real
and complex channels (including the masked coherence and the wrapped-interferogram phase)
render correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant