diff options
Diffstat (limited to 'Examples/Tests/openpmd_rz/analysis_openpmd_rz.py')
-rwxr-xr-x | Examples/Tests/openpmd_rz/analysis_openpmd_rz.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Examples/Tests/openpmd_rz/analysis_openpmd_rz.py b/Examples/Tests/openpmd_rz/analysis_openpmd_rz.py new file mode 100755 index 000000000..0a15173b6 --- /dev/null +++ b/Examples/Tests/openpmd_rz/analysis_openpmd_rz.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python3 + +import openpmd_api as io + +series = io.Series("LaserAccelerationRZ_opmd_plt/openpmd_%T.h5", io.Access.read_only) + +assert len(series.iterations) == 3, 'improper number of iterations stored' + +ii = series.iterations[20] + +assert len(ii.meshes) == 7, 'improper number of meshes' + +jt = ii.meshes['j']['t'] +(Nm, Nr, Nz) = jt.shape + +assert Nm == 3, 'Wrong number of angular modes stored or possible incorrect ordering when flushed' +assert Nr == 64, 'Wrong number of radial points stored or possible incorrect ordering when flushed' +assert Nz == 512, 'Wrong number of z points stored or possible incorrect ordering when flushed' + +assert ii.meshes['part_per_grid'][io.Mesh_Record_Component.SCALAR].shape == [64,512], 'problem with part_per_grid' +assert ii.meshes['rho_electrons'][io.Mesh_Record_Component.SCALAR].shape == [3, 64, 512], 'problem with rho_electrons' |