I'd like to scan the value on multiple elements at once. I can change the value easily using RPN variables in the lattice file, and I was hoping there might be a way to scan an RPN variable. Other solutions also allow changing elements, like alter_elements, etc., but I'd like to be able to do it across elements that I can't match with a single string. (I.e. without regex.)
Basically, I'd like to scan a CSR flag to turn CSR simulation on and off, as well as ISR flags, etc. For instance, it might be useful to scan the phase of many klystrons at once. Is this possible?
Scan multiple elements at once, a la RPN variable?
Moderators: cyao, michael_borland
-
- Posts: 60
- Joined: 05 Aug 2010, 11:32
- Location: SLAC National Accelerator Laboratory
-
- Posts: 1959
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Scan multiple elements at once, a la RPN variable?
Joel,
You can use the vary_element command to do this. Several examples can be found in the collection of examples at
http://www.aps.anl.gov/Accelerator_Syst ... les.tar.gz
The scanParameters1 directory is probably a good one to look at.
--Michael
You can use the vary_element command to do this. Several examples can be found in the collection of examples at
http://www.aps.anl.gov/Accelerator_Syst ... les.tar.gz
The scanParameters1 directory is probably a good one to look at.
--Michael
-
- Posts: 60
- Joined: 05 Aug 2010, 11:32
- Location: SLAC National Accelerator Laboratory
Re: Scan multiple elements at once, a la RPN variable?
Michael,
Excellent, I've been using vary_element to load scan parameters from SDDS files, but didn't realize it could be set up like this. Specifically, I didn't realize vary_element commands could have the same index_number.
Thanks very much!
Joel
Excellent, I've been using vary_element to load scan parameters from SDDS files, but didn't realize it could be set up like this. Specifically, I didn't realize vary_element commands could have the same index_number.
Thanks very much!
Joel
-
- Posts: 60
- Joined: 05 Aug 2010, 11:32
- Location: SLAC National Accelerator Laboratory
Re: Scan multiple elements at once, a la RPN variable?
Unfortunately, this isn't very elegant... (no pun intended!) I'd have to add a vary_element command for every element I want to vary, and that's rather ugly since I have something like 200 elements I want to vary simultaneously. It doesn't seem that vary_element's name variable tolerates wildcards, unlike alter_element and modulate_element. (It would be good if it handled regex...) I suppose I could create a script that searches through the lte file with regex or something, and inserts the appropriate vary_element commands into the ele file... Are there any better (cleaner) solutions? The only things I'm coming up with are fairly ugly or hacky. It would really be nice and simple on my end to be able to vary an RPN variable...
-
- Posts: 1959
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Scan multiple elements at once, a la RPN variable?
Joel,
At this point I can't offer an elegant solution. We'll have to try to get wildcards implemented for vary_element in a future release.
Instead of scanning the lattice, you can make a preliminary run and ask for a parameter file (from run_setup). This is easy to process with sddsprocess to pick out the elements of interest and compose the vary_element commands. You can then spit them into a text file with sdds2stream and include that into your command file.
--Michael
At this point I can't offer an elegant solution. We'll have to try to get wildcards implemented for vary_element in a future release.
Instead of scanning the lattice, you can make a preliminary run and ask for a parameter file (from run_setup). This is easy to process with sddsprocess to pick out the elements of interest and compose the vary_element commands. You can then spit them into a text file with sdds2stream and include that into your command file.
--Michael
-
- Posts: 1959
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Scan multiple elements at once, a la RPN variable?
Joel,
On second thought, here's a better idea: you can use vary_element to vary one element, then link_elements (which takes wildcards) to link the others. With link_elements, you can specify an expression if you want to vary things in a related but not identical way
--Michael
On second thought, here's a better idea: you can use vary_element to vary one element, then link_elements (which takes wildcards) to link the others. With link_elements, you can specify an expression if you want to vary things in a related but not identical way
--Michael