openPMD-viewer is an open-source Python package to access openPMD data.
It allows to:
Quickly browse through the data, with a GUI-type interface in the Jupyter notebook
Have access to the data numpy array, for more detailed analysis
openPMD-viewer can be installed via
conda install -c conda-forge openpmd-viewer openpmd-api
pip install openPMD-viewer openPMD-api
and for Jupyter Lab use this instead:
If none of those work, e.g. because ipympl is not properly installed, you can as a last resort always try
%matplotlib inline for non-interactive plots.
In both interactive and scripted usage, you can import openPMD-viewer, and load the data with the following commands:
from openpmd_viewer import OpenPMDTimeSeries ts = OpenPMDTimeSeries('./diags/diag1/')
If you are using the Jupyter notebook, then you can start a pre-filled notebook, which already contains the above lines, by typing in a terminal:
When using the Jupyter notebook, you can quickly browse through the data by using the command:
You can also access the particle and field data as numpy arrays with the methods
See the openPMD-viewer tutorials here for more info.