Carrying a user's defined variable to SDDSPLOT

Moderators: cyao, michael_borland

Post Reply
Max
Posts: 50
Joined: 31 Jul 2008, 12:16

Carrying a user's defined variable to SDDSPLOT

Post by Max » 10 Dec 2009, 14:20

In the .lte file I define a variable (example:
% 4.754 = sto QRF1c). This is the power supply current in a quadrupole that I then use to compute K1 in .LTE.
How can I save/extract this number (4.754 in the example) to display it in SDDSPLOT ?

Thanks, max

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

Re: Carrying a user's defined variable to SDDSPLOT

Post by michael_borland » 10 Dec 2009, 14:37

Max,

There isn't a way to do this starting from the .lte file. However, I can suggest an alternative: remove the data from the .lte file and create an SDDS file with the data. You can load this into elegant and also use it in sddsplot.

You can use sddsmakedataset to make a new data file from the commandline:
% sddsmakedataset settings.sdds -parameter=QRF1c,units=A -data=4.754 -parameter=whatever -data=value etc.

In your .ele file, use rpn_load to load the parameters into rpn variables. This replaces the "sto" commands in the .lte file.
&rpn_load
filename = settings.sdds
load_parameters = 1 ! Load SDDS parameters rather than columns
&end
This command needs to come before the &run_setup command.

In your .lte file, you can use the parameter values just as before (assuming you used the same names).

To add this data to your plots, you can do something like this
% sddsxref run.twi settings.sdds run.twip -leave=* -transfer=parameter,*
% sddsprocess run.twip -print=parameter,Label1,"QRF1c: %f nux: %f nuy: %f",QRF1c,nux,nuy
% sddsplot -column=s,betax run.twip -title=@Label1

Hope this helps.

--Michael

Max
Posts: 50
Joined: 31 Jul 2008, 12:16

Re: Carrying a user's defined variable to SDDSPLOT

Post by Max » 10 Dec 2009, 16:19

Michael,
thanks for your always prompt reply.
Elegant solution (pun intended) ! However, having downloaded the most recent version of Elegant,
load_parameters is detected as an "unknown variable" in namelist rpn_load.
I understand this is a novel feature. I also noticed that the new version of Elegant (Dec. 7) heading
carries the date of June 2, 2009. Is it possible that the link to the download is wrong ?
Thanks, Max

Max
Posts: 50
Joined: 31 Jul 2008, 12:16

Re: Carrying a user's defined variable to SDDSPLOT

Post by Max » 10 Dec 2009, 16:22

I just realized. I should have downloaded the new SDDS toolkit most likely, which I have not yet done.
If so, my apologies.
Max

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

Re: Carrying a user's defined variable to SDDSPLOT

Post by michael_borland » 10 Dec 2009, 16:25

Max,

You are right. It turns out the wrong file was in place. I think I've fixed it, but let me know if not because I don't have a Windows machine to test it on.

--Michael

Max
Posts: 50
Joined: 31 Jul 2008, 12:16

Re: Carrying a user's defined variable to SDDSPLOT

Post by Max » 14 Dec 2009, 11:33

Thank you, Michael, for a useful algorithm that is working well.
Max

Post Reply