Open RemiLehe opened 2 years ago
My impression is that the function SetConstParticleRecordsEDPIC
is not being called.
The openPMD files can be tested with the following Python code (after doing pip install openpmd-viewer
)
from openpmd_viewer import OpenPMDTimeSeries
ts = OpenPMDTimeSeries('./diags/back_3d/')
ts.get_particle(['ux'])
It currently raises an exception:
IndexError: Key 'mass' does not exist (read-only).
It seems that the problem disappears when prob_hi
is 0 in z
inputs_3d_zmax0.txt
It seems that the version of WarpX that I was using was not up to date. Sorry about this! I will close this issue for now.
thank you for checking @RemiLehe
I observe this issue some times, working on the latest WarpX branch.
When loading in openPMD-viewer
:
>>> ts = OpenPMDTimeSeries('diags/diag_lab')
Warning: File 9 has different openPMD parameters than the rest of the time series.
...
Warning: File 18 has different openPMD parameters than the rest of the time series.
>>> ts_l.get_particle(species='beam', var_list = ['charge','w', 'ux', 'uy', 'uz'], iteration=8);
>>> ts_l.get_particle(species='beam', var_list = ['charge','w', 'ux', 'uy', 'uz'], iteration=9);
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
/tmp/ipykernel_86/3022048230.py in <module>
1 ii = 9
----> 2 pdata = ts_l.get_particle(species='beam', var_list = ['charge','w', 'ux', 'uy', 'uz'], iteration=ii)
...
KeyError: "Unable to open object (object 'charge' doesn't exist)"
Here is a reproducing input file inputs.txt
I had previously tested the particle openPMD output of the new BTD diagnostics, but it turns out that I did not do a complete check. Some of the metadata (e.g. particle mass, position offset) is not being written to the file.
Here is a simple reproducing script: inputs_3d.txt