pyAMPP HDF5 Model Format
This page documents the current stage-file contract written by gx-fov2box and consumed by:
gxbox-view3d(3D viewer),gxbox-view2d(2D FOV / box viewer),gxrefmap-view(base/refmap browser),resume/rebuild workflows via
--entry-box.
File Naming
Typical output naming pattern:
hmi.M_720s.YYYYMMDD_HHMMSS.<region>.CEA.NONE.h5same stem with stage suffixes such as
POT,BND,NAS,NAS.GEN,NAS.CHR,NAS.GEN.CHR
Common Groups (All Stages)
base
2D boundary maps:
base/bx,base/by,base/bzbase/icbase/chromo_maskbase/index(IDL-compatible serialized header payload)
base/index compatibility notes
base/index is intended to preserve the scientific meaning of the saved base
map geometry and to remain consumable by IDL/GX-oriented tools, but it is not
guaranteed to be numerically identical to the internal WCS produced by the IDL
prepare_basemaps.pro round-trip.
Current design intent:
pyAMPP treats the imported SunPy/HMI map WCS and observer metadata as the primary source of truth for newly generated base maps.
pyAMPP writes an IDL-compatible serialized header payload whose Carrington / observer tags are semantically correct for the saved base grid.
pyAMPP does not intentionally reproduce every SSW internal normalization step (for example the IDL
wcs2map -> map2wcsround-trip) unless that behavior is independently justified.
Practical implications:
Small differences in cards such as
CRVAL*,CRLN_OBS,DSUN_OBS, orSOLAR_B0may remain when comparing a fresh pyAMPP model against an IDL model built from the same source FITS files.Those differences do not automatically imply a scientific error in the pyAMPP base maps; they may reflect different WCS normalization conventions between SunPy and SSW.
Users who require strict IDL basemap parity may start from an IDL-produced
NONEmodel via--entry-boxand continue the workflow from there.For downstream numerical equivalency beyond the basemap stage, IDL and pyAMPP should also use the same NLFFF library/version; otherwise later model stages can diverge even when the starting
NONEmodel is identical.
Compatibility requirement for imported legacy models:
SAV/HDF5 import paths should produce a
base/indexpayload that is structurally compatible with the current pyAMPP contract, even when the original IDL header representation is not preserved byte-for-byte.
metadata
Core provenance:
metadata/id: model identifiermetadata/execute: full command string used to create the modelmetadata/projection:CEAorTOPmetadata/disambiguation: e.g.HMIorSFQmetadata/axis_order_2dandmetadata/axis_order_3dwhen presentmetadata/vector_layoutwhen present
Geometry contract metadata (when present):
metadata/geometry_contract/nxmetadata/geometry_contract/nymetadata/geometry_contract/nzmetadata/geometry_contract/dr_xmetadata/geometry_contract/dr_ymetadata/geometry_contract/dr_zmetadata/geometry_contract/rsun_mmetadata/geometry_contract/anchor_lon_degmetadata/geometry_contract/anchor_lat_degmetadata/geometry_contract/anchor_radius_rsunmetadata/geometry_contract/framemetadata/geometry_contract/obstimemetadata/geometry_contract/inferred_from
Contract semantics:
Tier 1 (intrinsic box) and Tier 2 (world embedding/time) fields are expected to be complete for new pyAMPP outputs.
Legacy models may be missing this group on disk; canonical loaders complete and attach these fields at load time.
Saving through
pyampp.io.save_modelpersists the completed contract to this location.
observer
Optional observer / FOV metadata used by 2D resume and viewer flows:
observer/nameobserver/labelas the user-facing observer identifier shown in the 2D selectorobserver/sourcewhen the observer record comes from an uploaded reference fileobserver/fov/frameobserver/fov/xc_arcsec,observer/fov/yc_arcsecobserver/fov/xsize_arcsec,observer/fov/ysize_arcsecobserver/fov/squareobserver/ephemeris/*as the canonical observer-state blockobserver/pb0r/*as an optional redundant derived block for SSW-styleB0 / L0 / Rsuninteroperability
Viewer UI semantics:
MODEL-DATEis the saved model time.OBS-DATEis the true observer-record time.For built-in observers those typically match; uploaded/manual custom observers may intentionally differ.
The current derived observer/pb0r keys are:
observer/pb0r/obs_dateobserver/pb0r/b0_degobserver/pb0r/l0_degobserver/pb0r/p_degwhen availableobserver/pb0r/rsun_arcsec
refmaps
Optional context maps, each in its own subgroup:
refmaps/<map_id>/datarefmaps/<map_id>/wcs_header
External FITS reference maps imported by gx-fov2box or
pyampp.io.refmaps are stored in this same layout. Each imported map group
may also carry:
refmaps/<map_id>.attrs["order_index"]for stable viewer orderingrefmaps/<map_id>.attrs["source_path"]for source-file provenance
For generated boxes, reference-map alignment uses the model time inferred from
base/index. Earth/SDO line-of-sight maps are reprojected to the model
reference-map footprint; non-Earth maps keep their native WCS footprint.
grid
Grid geometry and identity:
grid/dx,grid/dy,grid/dzgrid/voxel_id(uint32)
Stage-Specific Groups
NONE
Minimal model shell for downstream continuation.
No solved extrapolation required.
coronamay exist as placeholder fields withattrs/model_type = "none".
POT
Potential-field stage in corona:
corona/bx,corona/by,corona/bzcorona/drcorona/attrs/model_type = "pot"corona/corona_basewhen available
BND
Boundary-conditioned stage in corona:
corona/bx,corona/by,corona/bzcorona/drcorona/corona_basewhen available
NAS
NLFFF stage in corona:
corona/bx,corona/by,corona/bzcorona/drcorona/attrs/model_type = "nlfff"(or equivalent)
NAS.GEN
Adds line-tracing products (stored in lines and/or stage-compatible chromo metadata):
line indexing arrays (start/end/apex/seed)
status/code arrays
aggregate line properties (average field, physical length)
NAS.CHR
Adds chromospheric payload in chromo and finalized grid metadata:
chromospheric thermodynamic variables (where generated)
chromosphere-resolved field cubes (when present)
final
grid/voxel_idand geometry values used by viewers/renderers
Reference-map IDs
Typical AIA-derived IDs used by viewers:
AIA_94,AIA_131,AIA_171,AIA_193,AIA_211,AIA_304,AIA_335AIA_1600,AIA_1700(if UV requested)
Axis and Layout Notes
2D base/refmap arrays are map-shaped with explicit WCS headers retained.
3D field arrays are stored in HDF5 canonical
(z, y, x)order when written by current writers.Viewers and adapters handle any required transpose/reindex for rendering and legacy compatibility.
Resume/Entry Compatibility
For robust resume behavior, entry files should include:
metadata/execute(for reproducible command provenance and path recovery),valid
metadata/idstage naming,required stage groups for the selected jump/rebuild mode.
When --entry-box is supplied, gx-fov2box detects stage availability and enforces required groups for continuation/rebuild paths.
Canonical Read Path
For application and downstream usage, model files should be restored via
pyampp.io rather than low-level HDF5 readers. The centralized loader path
ensures geometry contract completion and observer normalization before models
are consumed by geometry or rendering code.