Backplanes
Modules
src/backplanes/backplanes.py: Orchestrates per-image flowReads prior nav metadata from
--nav-results-rootBuilds
ObsSnapshotwithextfov_margin_vu=(0, 0)and appliesOffsetFOVComputes bodies and rings backplanes
Merges sources per-pixel by distance
Writes the FITS file and a companion metadata JSON via the writer
src/backplanes/backplanes_bodies.py: Body backplanesFor each body in FOV, builds a clipped meshgrid (no oversampling) and evaluates OOPS backplanes
Embeds arrays/masks into full-size frames
Simulation: synthesizes fake arrays but only within the simulated body mask derived from: -
snapshot.sim_body_mask_map[body_name]if present, else -snapshot.sim_body_index_mapmatched againstsnapshot.sim_body_order_near_to_far
src/backplanes/backplanes_rings.py: Ring backplanesUses full-frame
snapshot.bp, evaluates configured ring backplanesProduces per-pixel
distanceused for merge ordering
src/backplanes/merge.py: Per-pixel distance-ordered mergeBodies: body-level scalar distances, broadcast within each body’s mask
Rings: per-pixel distances
BODY_ID_MAP is filled with NAIF IDs; simulation uses deterministic fake IDs when unknown
src/backplanes/writer.py: Output writerWrites BODY_ID_MAP as the first image HDU
Excludes any backplane that is entirely zero from the FITS file
Writes a companion
*_backplane_metadata.jsoncontaining per-body inventory and per-backplane min/max statistics; this JSON is consumed bynav_create_bundlewhen generating PDS4 labels. The backplanes step itself does not produce any PDS4 labels.
Snapshot Helpers
Added methods to ObsSnapshot:
inventory_body_in_fov(inv: dict) -> boolinventory_body_in_extfov(inv: dict) -> boolclip_rect_fov(u_min, u_max, v_min, v_max) -> tuple[int, int, int, int]clip_rect_extfov(u_min, u_max, v_min, v_max) -> tuple[int, int, int, int]
These unify bounding-box intersection and clipping logic and are used by backplanes and navigation code.
CLI and Roots
Backplanes drivers accept two roots:
--nav-results-root: prior nav results (metadata); used to read*_metadata.json--backplane-results-root: destination for new backplane outputs
Offset drivers use:
--nav-results-rootfor navigation outputs (metadata JSON and summary PNG)
Configuration
src/nav/config_files/config_90_backplanes.yaml defines:
backplanes.bodiesandbackplanes.rings: each entry hasname(FITS HDU name),method(oops.Backplanemethod name), and optionalunits(copied to the FITSBUNITheader card).
Testing
There is a smoke test under experiments/backplanes/ using a simulated JSON to ensure backplane generation runs end-to-end. In simulation, per-body masks are respected for fake backplanes to avoid rectangular artifacts.