Skip to content
Discussion options

You must be logged in to vote
Admin verified this answer by ax3l Oct 23, 2025

hi @sweber04,

Thanks for your question and the script demonstrating it.

When you use the same monitor name multiple times in a beamline, we will store the beam according to its "simulation step" in that monitor file. In other words, the line above will have a monitor output with two steps.

Looking at your script:

beam_series = io.Series("diags/openPMD/monitor.h5", io.Access.read_only)
beam_steps = list(beam_series.iterations)

if I print beam_steps I get:

[1, 3]

Thus, the next lines of your script visualize the first (initial output) and not the last one:

# ...
step = 1
beam_at_step = beam_series.iterations[step].particles["beam"].to_df()

If you want the final step, do:

step_final = beam_…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer verified by Admin Oct 23, 2025
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested component: diagnostics all types of outputs
2 participants
Converted from issue

This discussion was converted from issue #1196 on October 23, 2025 17:25.