pyampp.geometry.contract

Geometry contract completion for model box metadata.

Contract policy: - Tier 1 (intrinsic box): inferred from coronal cube and corona.dr only. - Tier 2 (world embedding + time): inferred from base/index.

base/index is treated as canonical. For backward compatibility, this module also parses legacy tuple-style base/index payloads produced by older converters.

Attributes

RSUN_HMI_METERS

Classes

GeometryContract

Functions

world_corners_from_geometry_contract(...)

Build red-box world corners from a completed geometry contract.

infer_box_dims(→ tuple[int, int, int] | None)

Infer (nx, ny, nz) from coronal cube components only.

infer_voxel_resolution(→ tuple[float, float, float] | None)

Infer (dr_x, dr_y, dr_z) from corona.dr only (never from chromo).

infer_obstime(→ str | None)

Infer model observation time from canonical base/index payload.

infer_world_anchor_from_index(→ tuple[float, float, ...)

Infer world anchor from canonical base/index payload.

complete_geometry_contract(→ GeometryContract | None)

Complete a geometry contract.

Module Contents

pyampp.geometry.contract.RSUN_HMI_METERS = 695700000.0[source]
class pyampp.geometry.contract.GeometryContract[source]
nx: int[source]
ny: int[source]
nz: int[source]
dr_x: float[source]
dr_y: float[source]
dr_z: float[source]
rsun_m: float[source]
anchor_lon_deg: float[source]
anchor_lat_deg: float[source]
anchor_radius_rsun: float[source]
frame: str[source]
obstime: str[source]
inferred_from: str | None = None[source]
to_dict() dict[str, Any][source]
classmethod from_dict(data: dict[str, Any]) GeometryContract[source]
pyampp.geometry.contract.world_corners_from_geometry_contract(contract: GeometryContract, *, obstime: str | astropy.time.Time | None = None, observer: str | astropy.coordinates.SkyCoord | None = 'earth') astropy.coordinates.SkyCoord | None[source]

Build red-box world corners from a completed geometry contract.

pyampp.geometry.contract.infer_box_dims(model_dict: dict[str, Any]) tuple[int, int, int] | None[source]

Infer (nx, ny, nz) from coronal cube components only.

pyampp.geometry.contract.infer_voxel_resolution(model_dict: dict[str, Any]) tuple[float, float, float] | None[source]

Infer (dr_x, dr_y, dr_z) from corona.dr only (never from chromo).

pyampp.geometry.contract.infer_obstime(model_dict: dict[str, Any]) str | None[source]

Infer model observation time from canonical base/index payload.

pyampp.geometry.contract.infer_world_anchor_from_index(model_dict: dict[str, Any]) tuple[float, float, float, str] | None[source]

Infer world anchor from canonical base/index payload.

pyampp.geometry.contract.complete_geometry_contract(model_dict: dict[str, Any], *, strict: bool = False) GeometryContract | None[source]

Complete a geometry contract.

Policy: base/index is canonical for time and anchor metadata. If observation time or anchor cannot be inferred, the contract is incomplete.