Hi,
I have a long FODO lattice. I fit once fodo cell to find the quad strength needed for a specified phase advance and then I would like to set all the quad in the FODO lattice given the value I found for one cell.
I tried to do something like this:
# load the quad associated to one cell
&rpn_load
tag = QUAD450,
filename = fodo.param,
match_column = ElementName,
match_column_value = Q450,
matching_row_number = 1
&end
# set the quad Q470 to same value match as Q450
&alter_elements
name = Q470
item = K1
value = "QUAD450.ParameterValue"
&end
This does not work and I am not sure how to do this. Also is there a way in the rpn_load to actually access the parameter
(now I do it by end using the matching_row_number). Thank you, -- Philippe.
rpn_load to set several quads
Moderators: cyao, michael_borland
-
- Posts: 83
- Joined: 20 Aug 2008, 13:18
- Location: Northern Illinois University & Argonne National Laboratory
- Contact:
-
- Posts: 1933
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: rpn_load to set several quads
Philippe,
&rpn_load isn't really intended to do this, but it should work if you try
An easier method is using &load_parameters, e.g.,
You can expand this to do multiple replacements, within limits. E.g., if you want to shift values from Q450, Q451, ..., Q459 to Q470, Q471, ..., this would work
If you plan to do lots of these operations, I suggest externally processing the fodo.param file.
&rpn_load isn't really intended to do this, but it should work if you try
Code: Select all
...
# set the quad Q470 to same value match as Q450
&alter_elements
name = Q470
item = K1
value = "(QUAD450.ParameterValue)"
&end
Code: Select all
&load_parameters
filename = fodo.param,
include_name_pattern = Q450,
edit_name_command = %/Q450/Q470/
&end
Code: Select all
&load_parameters
filename = fodo.param,
include_name_pattern = Q45?,
edit_name_command = %/Q45/Q47/
&end
- Create a cross-reference file with two string columns: SourceName and TargetName.
- Cross-reference the fodo.param file to get the TargetName for each element
sddsxref fodo.param xrefFile.sdds fodoMod.param -match=ElementName=SourceName -take=TargetName -reuse=rows - Replace the ElementName in fodoMod.param
sddsconvert fodoMod.param -delete=column,ElementName -rename=column,TargetName=ElementName - Load fodoMod.param using load_parameters
-
- Posts: 83
- Joined: 20 Aug 2008, 13:18
- Location: Northern Illinois University & Argonne National Laboratory
- Contact:
Re: rpn_load to set several quads
MIchael,
Thank you very much; I was not aware of the capability of the load-parameter. Best, -- Philippe.
Thank you very much; I was not aware of the capability of the load-parameter. Best, -- Philippe.