Add Total Bunch Attributes to Monitor
Add our reduced beam characteristics (moments of the particle bunch) as metadata to openPMD files (the beam monitor element).
X-Ref.:
- #533
Action Items
- [x] implement
- [x] test that
reduced_beam_characteristicsis indeed an AllReduce now. - [x] document changes in reduced beam characteristics (no ref particle info anymore)
- [x] document openPMD attributes
Follow-ups
- [ ] document openPMD particle "columns" if read back to a dataframe @ax3l
- [ ] test and use the new metadata from openPMD over the text file in tests (only
visualize_ml_....py?) @ax3l @RTSandberg
Will push one more update on the TODOs we marked in the RBC routines - removing reference particle info from it to avoid duplication and collisions.
ping @RTSandberg @n01r for review :)
The reference particle data is still written to "ref_particle_," but is no longer duplicated in "reduced_beam_characteristics_".
Correct. The issue was that it would otherwise collide in names once we combine it to the openPMD output. If we want, we can still keep the information in the text file output.
Instead, it is duplicated in the openPMD output.
It should now only be once in the openPMD output using a consistent name for reference particle and collective beam properties; stored as attributes to the beam in each step (iteration).
I think it's important that we keep the reference particle text output. It is a small cost for I/O, and allows a quick check by the user without any postprocessing.
Good point. We have currently in diags/ the
ref_particle*reduced_beam_characteristics*
In the latter, this would remove s and ref_beta_gamma now. Shall I add s again (or both?).
(Later, we could also make both one file for simplicity.)
I think it's good to remove ref_beta_gamma from reduced_beam_characteristics, since that information is duplicated in the ref_particle text output, and it is a "reference" quantity. However, it would be good to keep the s output in both text files, since this is effectively the independent variable characterizing the lattice location.
Perfect, ok that is what I thought, too. I added the s column back to the text file now :)