-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plotting help #613
Comments
Hi @koesterf, Thanks for your question! The columns contain the bunch parameters you are interested in and are in the text file as follows: You an read this file with numpy or pandas or Excel or any other preferred CSV reader. Columns are space separated, the first line is the header (as in the documentation link). Alternatively, in ImpactX 24.05+, this data will also be part of the openPMD data in the |
Hi @ax3l, thanks for explaining how to plot. It works exactly as I was looking for. If you could suggest me one more thing it will be great: how to plot longitudinal as well as transverse phase-space. I mean longitudinal (s-pt) and transverse (x-px and y-py). Because in header I don't see these values, but px_mean, px_min, px_max etc.
Thanks a lot. |
Hi @ax3l , using the plot chicane file I can make the phase-space evolution. See the attached figure. But how to increase the frequency of such output ? For example, I want to see the phase-space plot after every magnet of the chicane what should I do ? could you also confirm that fist row is the longitudinal phase space ? If yes, could you please tell me how to make the longitudinal phase-space with respect to |
Hi @ax3l @cemitch99, just a friendly reminder of my above request. Cheers, |
Hi @koesterf, Sorry for the delay, I had a couple of business trips and was swamped in backlog and an upcoming review.
Perfect, you already found it. Above, I explained how to find collective beam properties. For phase space plots, you want to create output for individual particles, for which we have the BeamMonitor element, and then histogram the properties you like to correlate in post-processing, as you did.
Looks on a high level correct. But please post your post-processing script so we can see what you did. Usually, you make a longitudinal phase space as
You can increase the frequency, e.g., between every element, by placing the # ...
# add beam diagnostics
monitor = elements.BeamMonitor("monitor", backend="h5")
# design the accelerator lattice)
ns = 25 # number of slices per ds in the element
fodo = [
monitor,
elements.Drift(ds=0.25, nslice=ns),
monitor,
elements.Quad(ds=1.0, k=1.0, nslice=ns),
monitor,
elements.Drift(ds=0.5, nslice=ns),
monitor,
elements.Quad(ds=1.0, k=-1.0, nslice=ns),
monitor,
elements.Drift(ds=0.25, nslice=ns),
monitor,
]
# assign a fodo segment
sim.lattice.extend(fodo)
# ... |
Hi,
I run the simulation successfully. Now, I want to make plots of evolution of
(1) Twiss: beta_x and beta_y function with the propagation length.
(2) emittance_x and emittance_y with the propagation length.
(3) bunch length evolution with the propagation length.
There are 4 files in the diags directory
(i) reduced_beam_characteristics.0.0,
(ii) ref_particle.0.0
(iii) reduced_beam_characteristics_final.0.0
(iv) ref_particle_final.0.0
Which files I should use to make plots.
Thanks.
Frank
The text was updated successfully, but these errors were encountered: