pass number as an argument for SCRIPT

Moderators: cyao, michael_borland

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

pass number as an argument for SCRIPT

Post by Philippe Piot » 15 Dec 2017, 19:18

Hello,
Is there a way to pass the number of to a SCRIPT element can have this info (I have a SCRIPT element in a ring and wants it to be on only for certain pass). Likewise in a ring how could I turn off the SCRIPT command when the &closed_orbit is used.

Thank you, -- Philippe.

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

Re: pass number as an argument for SCRIPT

Post by michael_borland » 15 Dec 2017, 20:41

Philippe,

To pass the pass number to a SCRIPT, use the "%p" sequence in the COMMAND, e.g.,

Code: Select all

s1: script,command="myScript %i %o %p"
In this case, the script will get the input filename, output filename, and pass number, in that order, in its arguments.

To turn off the script for closed orbits (and other operations involving the transport matrix), add the DRIFT_MATRIX=1 qualifier.

--Michael

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

Re: varying a parameter on a turn-by-turn basis

Post by Philippe Piot » 25 Aug 2021, 22:18

All,
Is there a way to vary a parameter on a turn-by-turn basis in a ring? (e.g. changing the strength of a quadruple as a function of pass number). I thought vary_element could do that but it seems not to be the case. Thank you, -- Philippe.

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

Re: pass number as an argument for SCRIPT

Post by michael_borland » 26 Aug 2021, 09:21

Philippe,

You can do this with the ramp_elements or modulate_elements command. See the attached files for an example.

--Michael
Attachments
scriptVaryWithTurn.zip
(5.94 KiB) Downloaded 187 times

Post Reply