pyampp.gxbox.view_h5

Attributes

PyVistaDeprecationWarning

Classes

SimpleBox

Functions

normalize_viewer_axis_order(→ dict)

Convert canonical H5 zyx cubes into viewer xyz cubes.

infer_dims(→ numpy.ndarray)

infer_time(→ astropy.time.Time)

infer_res(→ astropy.units.Quantity)

can_prepare_model_for_viewer(→ bool)

Return True when a file looks like a viewer-compatible saved model.

prepare_model_for_viewer(→ tuple[SimpleBox, ...)

Load a saved model file into the in-memory objects expected by MagFieldViewer.

main(→ int)

Module Contents

pyampp.gxbox.view_h5.PyVistaDeprecationWarning[source]
pyampp.gxbox.view_h5.normalize_viewer_axis_order(b3d: dict) dict[source]

Convert canonical H5 zyx cubes into viewer xyz cubes. MagFieldViewer expects (x, y, z).

class pyampp.gxbox.view_h5.SimpleBox[source]

Bases: pyampp.gxbox.box.BoxGeometryMixin

dims_pix: numpy.ndarray[source]
res: astropy.units.Quantity[source]
b3d: dict[source]
property grid_coords[source]
pyampp.gxbox.view_h5.infer_dims(b3d: dict) numpy.ndarray[source]
pyampp.gxbox.view_h5.infer_time(b3d: dict) astropy.time.Time[source]
pyampp.gxbox.view_h5.infer_res(b3d: dict) astropy.units.Quantity[source]
pyampp.gxbox.view_h5.can_prepare_model_for_viewer(model_path: str | pathlib.Path) bool[source]

Return True when a file looks like a viewer-compatible saved model.

This is a lightweight gate for enabling UI actions. It intentionally avoids full SAV conversion and only checks file existence, supported suffix, and the presence of recognizable top-level model groups for HDF5 files.

pyampp.gxbox.view_h5.prepare_model_for_viewer(model_path: str | pathlib.Path) tuple[SimpleBox, astropy.time.Time, str, pathlib.Path | None][source]

Load a saved model file into the in-memory objects expected by MagFieldViewer.

Returns:

(box, obs_time, b3dtype, temp_h5_path) where temp_h5_path is a temporary conversion artifact when the canonical loader had to materialize one.

Return type:

tuple

pyampp.gxbox.view_h5.main() int[source]