Hi Michael,
Is there a way in elegent+sddstools to produce plots such as Fig.3 and Fig. 5 (particle density plots visualizing rays) in this paper?
https://journals.aps.org/prab/abstract/ ... .16.041302
Thanks
density plot
Moderators: cyao, michael_borland
-
- Posts: 1951
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: density plot
Neeraj,
You can use sddshist2d to make a 2d histogram of SDDS data, then use sddscontour to plot it. However, elegant doesn't log individual particle trajectories at fixed intervals along the beamline. One way around this is to construct the beamline with segmented elements having a fixed length, then log particle coordinates using a series of WATCH elements. I put together a simple example of one way to do this. See attached.
If fixed-length element segments doesn't work, there are other approaches, such as using element index as the horizontal coordinate, or interpolating.
--Michael
You can use sddshist2d to make a 2d histogram of SDDS data, then use sddscontour to plot it. However, elegant doesn't log individual particle trajectories at fixed intervals along the beamline. One way around this is to construct the beamline with segmented elements having a fixed length, then log particle coordinates using a series of WATCH elements. I put together a simple example of one way to do this. See attached.
If fixed-length element segments doesn't work, there are other approaches, such as using element index as the horizontal coordinate, or interpolating.
--Michael
- Attachments
-
- 2018-07-17.zip
- (1.42 KiB) Downloaded 234 times
-
- Posts: 1951
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: density plot
Neeraj,
Here's a better example that doesn't require manually splitting the beamline elements.
--Michael
Here's a better example that doesn't require manually splitting the beamline elements.
--Michael
- Attachments
-
- 2018-07-17a.zip
- (1.79 KiB) Downloaded 253 times
Re: density plot
Referring to the same figures in the article, I would like to show the magnets as they have; overlay them with position in z and the (scaled) bore-diameter. Is there a way to do this in elegant? I could settle also with a usual 1 sigma envelop plot. This would help to visualize the beam-loss positions.
-Neeraj
-
- Posts: 1951
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: density plot
Neeraj,
Please see attached. --Michael
Please see attached. --Michael
- Attachments
-
- 2018-07-27.zip
- (2.12 KiB) Downloaded 252 times
Re: density plot
Michael,
Thanks for the answer. But I think my question was misunderstood. I did not mean the way we plot it usually by overlaying the magnets as 'blocks', which indicates only their length and placement. I was referring to the article in my first post, where in Fig. 3 and Fig. 5 the magnets are also shown like limiting apertures (by the blocks on top and bottom of the image).
Thanks for the answer. But I think my question was misunderstood. I did not mean the way we plot it usually by overlaying the magnets as 'blocks', which indicates only their length and placement. I was referring to the article in my first post, where in Fig. 3 and Fig. 5 the magnets are also shown like limiting apertures (by the blocks on top and bottom of the image).
-Neeraj
-
- Posts: 1951
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: density plot
Neeraj,
For that, you'll need a separate file showing the apertures. For example, if you use MAXAMP, RCOL, or ECOL elements in your lattice file, then the aperture vs s is available from the &twiss_output output file (xAperture, yAperture). You can add those to the plots in a manner analogous to what I did in my examples.
--Michael
For that, you'll need a separate file showing the apertures. For example, if you use MAXAMP, RCOL, or ECOL elements in your lattice file, then the aperture vs s is available from the &twiss_output output file (xAperture, yAperture). You can add those to the plots in a manner analogous to what I did in my examples.
--Michael