analyzing correlation between different distributions

Moderators: cyao, michael_borland

Post Reply
Philippe Piot
Posts: 83
Joined: 20 Aug 2008, 13:18
Location: Northern Illinois University & Argonne National Laboratory
Contact:

analyzing correlation between different distributions

Post by Philippe Piot » 05 Apr 2011, 07:44

Hi,
I am running elegant and would like to explore correlation between the final transverse phase space and initial particle energy. I can do this in octave easily but thought would try to do this with the sdds toolbox. Below is what I did and it does not work as I expected.

I have two file monobeamrev.out (my initial distribution) and monobeamfwd.out (the distribution obtained after tracking monobeamrev.out into a beamline). I first rename the columns of monobeamrev.out and delete the standard columns.

sddsprocess monobeamrev.out monobeamrev.outproc \
-define=column,x0,x \
-define=column,xp0,xp \
-define=column,y0,y \
-define=column,yp0,yp \
-define=column,t0,t \
-define=column,p0,p \
-delete=column,x,xp,y,yp,t,p,particleID

I then combine the processed file with my final file and expect the following column x, xp, y, yp, t, p, x0, xp0, y0, yp0, t0, p0, particleID (a sddsquery confirms this)

sddscombine -merge monobeamfwd.out monobeamrev.outproc monobeamfwd.outETbun

finally I try to plot the final transverse phase space and would like to color-code the particle according to their initial fractional momentum spread
sddsplot -graph=dot,vary -order=spect -split=column=p0 -column=x,xp monobeamfwd.outETbun

the latter command gives on one point...

Of course all of this assume the macroparticle order in the file remains unchanged during the tracking (true in elegant but I am not sure about Pelegant -- did not try yet).

Thanks in advance for any help, -- Philippe.

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

Re: analyzing correlation between different distributions

Post by michael_borland » 05 Apr 2011, 12:05

Philippe,

You need to use sddsxref, not sddscombine. sddscombine is used to combine files that already have the same columns and parameters, making, for example, an N-page file out of N 1-page files.

Here's my suggestion:

sddsxref monobeamfwd.out monobeamrev.out -take=* -edit=column,*,ei/0/ combined.out

The file combined.out now contains the columns (x, xp, ...) from monobeamfwd.out plus the columns (x->x0, xp->xp0, etc.) from monobeamrev.out

--Michael

Post Reply