analyzing WATCH data on the fly during fitting

Moderators: cyao, michael_borland

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

analyzing WATCH data on the fly during fitting

Post by Philippe Piot » 06 Nov 2020, 08:13

All,
Is there a way, when performing multiple fits sequence and saving lattice in between, to access the output particle distribution for the next fitting step. Namely, I have an incoming beam with strong coupling (so that the Courant-Snyder parameters are not meaninful). I use skew-quadrupole magnets to remove the coupling and then would like to use the resulting final distribution to compute Courant-Snyder parameters to input in my next fitting pass using something like

&twiss_output
matched=0
concat_order = 1, ! for speed
beta_x = "{sddsanalyzebeam outputfrompreviousfit.sdds -pipe=out | sdds2stream -pipe -column=betax}",
beta_y = "{sddsanalyzebeam outputfrompreviousfit.sdds -pipe=out | sdds2stream -pipe -column=betay}",
alpha_x = "{sddsanalyzebeam outputfrompreviousfit.sdds -pipe=out | sdds2stream -pipe -column=alphax}",
alpha_y = "{sddsanalyzebeam outputfrompreviousfit.sdds -pipe=out | sdds2stream -pipe -column=alphay}",
filename="%s.twi"
&end

Of course I can do this piecewise (with several elegant runs) but it would be convenient to do this within one run.

Thank you, -- Philippe.

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

Re: analyzing WATCH data on the fly during fitting

Post by Philippe Piot » 08 Nov 2020, 19:09

All,
I actually retract my question! It turns out I was doing something wrong and runing the sdds_beams between fitting iteration and loading the output of the ttracking for next fitting iteration does work. My apologies. -- Philippe.

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

Re: analyzing WATCH data on the fly during fitting

Post by michael_borland » 09 Nov 2020, 11:01

Philippe,

Glad that you found the problem.

If the beam file is large, running sddsanalyzebeam several times could be slow. A more efficient way to do this is using a temporary file for the output of sddsanalyzebeam. E.g.,

Code: Select all

&subprocess command = "sddsanalyzebeam outputfrompreviousfit.sdds outputfrompreviousfit.ana" &end

&rpn_load filename=outputfrompreviousfit.ana, tag=previous &end

&twiss_output
matched=0
concat_order = 1, ! for speed
beta_x = "(previous.betax)",
beta_y = "(previous.betay)",
alpha_x = "(previous.alphax)",
alpha_x = "(previous.alphay)",
filename="%s.twi"
&end
--Michael

Post Reply