Unexpected phase space alteration with smoothDist6s

Moderators: cyao, michael_borland

Post Reply
Marcello
Posts: 19
Joined: 28 Jan 2015, 10:05

Unexpected phase space alteration with smoothDist6s

Post by Marcello » 12 Jun 2018, 06:02

Dear all,
I would like to perform a CSR evaluation in a dispersive path, I start from a 200k particles beamfile and I would like to increase the number of particles with smoothDist6s. The problem is that I noticed that the output file shows a different distribution in the longitudinal phase space and that the average energy is decreased. After this transport I would like to continue the start to end simulation so I need to preserve correctly the beam characteristics.

In the picture I show you the starting distribution and the one I obtained with the string:
smoothDist6s -input Astra.out -output Astra2x.sdds -factor 2
smoothdist1.png
I tested also its behavior with another beamfile, here is the analogous result:
smoothdist2.png
Probably I'm not understanding correctly how the script works, are those transformations correct?

Thanks you and best wishes,
Marcello Rossetti Conti

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

Re: Unexpected phase space alteration with smoothDist6s

Post by michael_borland » 12 Jun 2018, 08:15

Marcello,

That's very strange. I tried the same command with a similar input file with expected results. The file is attached. Please try these commands and let me know the results:

Code: Select all

smoothDist6s -input P200k_e1220.sdds -output P200k_e1220.sddsx2 -factor 2
sddsplot -graph=dot -sep=1 -same -layout=2,2 -col=t,p P200k_e1220.sdds P200k_e1220.sddsx2 
sample.zip
(8.17 MiB) Downloaded 229 times
--Michael
Attachments
smooth2x.png
smooth2x.png (11.3 KiB) Viewed 6438 times

Marcello
Posts: 19
Joined: 28 Jan 2015, 10:05

Re: Unexpected phase space alteration with smoothDist6s

Post by Marcello » 12 Jun 2018, 08:55

Dear Michael,
thank you for your fast reply.
I repeated the procedure with your attached file everything seems to work fine, I see the same result you showed me.
Can you, please, try to repeat the procedure with my beam file?
Astra192k.sdds
(8.76 MiB) Downloaded 259 times
Thanks!
Marcello R. C.

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

Re: Unexpected phase space alteration with smoothDist6s

Post by michael_borland » 12 Jun 2018, 16:13

Marcello,

The problem is that smoothDist6s has problems when the range of t values is small compared to the average t value. You can work around this as follows

Code: Select all

sddsprocess Astra192k.sdds Astra192k.tmp -process=t,ave,tAve -redefine=col,t,"t tAve -",units=s
smoothDist6s -input Astra192k.tmp -output Astra192k.sddsx2 -factor 2
If care about the average time coordinate, you can restore it as follows

Code: Select all

sddsxref Astra192k.sddsx2 Astra192k.tmp -leave=* -transfer=parameter,tAve
sddsprocess Astra192k.sddsx2 -redefine=column,t,"t tAve +",units=s
We'll fix this problem in a future release. Thanks for reporting it.

--Michael

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

Re: Unexpected phase space alteration with smoothDist6s

Post by michael_borland » 12 Jun 2018, 16:55

Marcello,

Here's the fix.

--Michael
Attachments
smoothDist6s-bugFix.zip
(3.61 KiB) Downloaded 244 times

Marcello
Posts: 19
Joined: 28 Jan 2015, 10:05

Re: Unexpected phase space alteration with smoothDist6s

Post by Marcello » 13 Jun 2018, 03:35

Michael,
thanks a lot for the fix, it will be very useful!

Best regards,
Marcello

Marcello
Posts: 19
Joined: 28 Jan 2015, 10:05

Re: Unexpected phase space alteration with smoothDist6s

Post by Marcello » 13 Jun 2018, 05:14

Michael,
I just double-checked the behavior of the fix with the second beamfile I posted initially (because the bunch seemed to be already centered in t=0).
In that case the fix doesn't work, could it be because of the higher average energy of the particles?

The original beamfile is the following (it is not a file of mine, I took it from the Start-2-End repository of LCLS: http://www-ssrl.slac.stanford.edu/lcls/s2e/).
lcls10jun03_rematched_nocsr.out
(8.79 MiB) Downloaded 207 times

Thanks again Micheal for your patience,
Marcello Rossetti Conti

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

Re: Unexpected phase space alteration with smoothDist6s

Post by michael_borland » 13 Jun 2018, 07:57

Marcello,

For that file, the problem is that the script gets confused by the folded phase space. This makes the slice energy spread very large at the ends, which the script turns into a large rms energy spread. It isn't able to cope with the complex nonlinear correlations between energy and time. The best approach is to increase the number of particles at the beginning of the simulation where the phase space is less complicated, then track that to the end.

--Michael

Marcello
Posts: 19
Joined: 28 Jan 2015, 10:05

Re: Unexpected phase space alteration with smoothDist6s

Post by Marcello » 13 Jun 2018, 08:44

Perfect, good to know.

Thanks
Marcello

Qin
Posts: 11
Joined: 22 Apr 2015, 07:48

Re: Unexpected phase space alteration with smoothDist6s

Post by Qin » 26 Sep 2019, 05:20

Hi,
I am having a similar problem using smoothDist6s, attached is t-x and t-p phase space before (left) and after (right) smoothing. The command I used for smoothing is :
smoothDist6s -input 20190925_1B.sdds -output 20190925_1B.sdds.smth -factor 1 -betaSlices 500

The sdds file comes from ASTRA simulation, using astra2elegant program. The phase space does not have complex shape so I am not sure why it is not reproduced correctly.

It would be great if you can kindly take a look and give some suggestion.

Thanks for your help.
Weilun
Attachments
20190925_1B.sdds
(106.81 MiB) Downloaded 157 times
X-T-phasespace.PNG
P-T-phasespace.PNG

Post Reply