pyoptics.fdtd.storage¶
Saving and loading monitor data.
Results are dictionaries of NumPy arrays plus scalar attributes. They are
written to compressed .npz files (no extra dependency) or, for files ending
in .h5/.hdf5, to HDF5 with gzip compression (needs the optional h5py,
pip install pyoptics[hdf5]). HDF5 also allows streaming snapshot frames
to disk during a run (Snapshots(path=…)).
Classes
Appends frames to a growing, chunked and gzip compressed HDF5 dataset (used by Snapshots(path=...)). |
Functions
Read a file written by save(); returns (arrays, attrs). |
|
Write a dict of arrays (and scalar/string attributes) to .npz or HDF5. |