Making animated GIF movies

Moderators: cyao, michael_borland

Post Reply
michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Making animated GIF movies

Post by michael_borland » 17 Jul 2008, 11:39

Here's how to make an animated GIF movie from data from elegant. You'll need the ImageMagick programs in order to do this.

Imagine that you are tracking many turns and want to make a movie of the particle distribution turn-by-turn.

In the .lte file, you need a watch point set up to record particle coordinates. E.g.,
W1: watch,filename="run.w1",mode="coordinate"
...
ring: line=(...,W1)
(Note that the W1 element is at the end of the beamline)

After running the simulation, use sddsplot to make a bunch of png files, one for each pass (this part was worked out by Bob Soliday). In this example, I'm looking at longitudinal phase space.

% sddsplot -device=png,template=frame%04d.png -column=t,p run.w1 -graph=dot -split=page -separate=page -sameScales \
-offset=xparameter=PassCentralTime,xinvert,yparameter=pCentral,yinvert \
-factor=yparameter=pCentral,yinvert -ylabel="delta"
(the -offset and -factor arguments are used to suppress the revolution time and to convert p to delta)

% convert -loop 1 -delay 10 frame????.png movie.gif
(convert is from ImageMagick)
% \rm frame????.png

You can now display movie.gif using a web browser.

--Michael

jtobin
Posts: 47
Joined: 23 Jul 2008, 15:00

Re: Making animated GIF movies

Post by jtobin » 01 Mar 2015, 21:57

Hi Michael,
I want to be able to do the same for linac. How can we do this in an linac. I want to see the longitudiinal phase space evolution through the linac. {Sometime it is tiredsome to plot at every single position!). Can this method be massaged for a linac?

-Charles

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Making animated GIF movies

Post by michael_borland » 02 Mar 2015, 10:15

Charles,

If you have a set of WATCH point output files, this can be done, but you have to ensure that they are ordered correctly on the commandline. One way to do this is using the &insert_elements command to insert WATCH elements using the filename template feature. See the manual page for the WATCH element for more information about using a filename template.

The attached example may also be helpful.

--Michael
movie.gif
Attachments
full457MeV.tar.gz
(2.31 MiB) Downloaded 174 times

Post Reply