7.38 load_parameters
- type: setup command.
- function: load parameters for elements from an SDDS file.
- sequence: must follow run_setup and precede run_control and error_control (if present).
- Command syntax, including use of equations and subcommands, is discussed in 7.2.
&load_parameters
STRING filename = NULL;
STRING filename_list = NULL;
STRING include_name_pattern = NULL;
STRING exclude_name_pattern = NULL;
STRING include_item_pattern = NULL;
STRING exclude_item_pattern = NULL;
STRING include_type_pattern = NULL;
STRING exclude_type_pattern = NULL;
STRING edit_name_command = NULL;
long change_defined_values = 0;
long repeat_at_each_step = 0;
long clear_settings = 0;
long allow_missing_elements = 0;
long allow_missing_parameters = 0;
long allow_missing_files = 0;
long force_occurence_data = 0;
long verbose = 0;
long skip_pages = 0;
long use_first = 0;
&end
- filename — Name (possibly containing the “%s” field) of SDDS file from which to take data. The
file must contain some of the following columns:
- ElementName — Required string column. The name of the element to change. May
contain wildcards.
- ElementParameter — Required string column. The name of the parameter of the element
to change.
- ParameterValue — Optional double column. If given, gives value of the parameter named
in ElementParameter for element named in ElementName.
- ParameterValueString — Optional string column. If ParameterValue is not present, then
this column must be present. The string data will be scanned, if necessary, to obtain a
value for the parameter.
- ParameterMode — Optional string column. If given, for each row the value must be one
of “absolute”, “differential”, “ignore”, or “fractional”. The meaning of these modes is as
follows: absolute mode means the given value is used as the new value for the parameter;
differential mode means the given value is added to the existing value for the parameter;
ignore mode means the value is ignored; fractional mode means the existing value is
increased by the product of the given value and the existing value (i.e., the given value
is a fractional change).
Unless change_defined_values is set, successive pages of the file are used for successive steps of the
simulation. Several elegant commands generate output that may be used (on a subsequent run)
with load_parameters; among these are the tune and chromaticity correction commands and the
run_setup command (parameters output).
- filename_list — A list of filenames, which may be given in place of filename. If used, each file in
the list is treated as if it was separately supplied with an individual load_parameters
command.
- include_name_pattern, exclude_name_pattern — A comma- or space-separated list of wildcard
patterns to be used in selecting, respectively, which elements to include and which to exclude from
loading. To be used, data must match at least one inclusion pattern and no exclusion
patterns.
- include_item_pattern, exclude_item_pattern — A comma- or space-separated list of wildcard
patterns to be used in selecting, respectively, which items (i.e., which element parameters) to include
and which to exclude from loading. To be used, data must match at least one inclusion pattern and
no exclusion patterns.
- include_type_pattern, exclude_type_pattern — Wildcard patterns to be used in selecting,
respectively, which element types (e.g., QUAD, DRIFT) to include and which to exclude from
loading. To be used, data must match at least one inclusion pattern and no exclusion
patterns.
- edit_name_command — A command using the syntax of the editstring program, allowing the
strings in the ElementName column to be modified before values are assigned.
- change_defined_values — Changes the defined values of the parameters. This means that when
the lattice is saved (using save_lattice), the parameters will have the altered values.
Also, if one wants to alter the values for all steps of the simulation, one must set this
flag.
Note that the ElementOccurence data is normally ignored if change_defined_values is nonzero.
This is because there is only one definition of each element, even if it is used multiple times. This
behavior can be altered with the next control.
- repeat_first_page_at_each_step — Normally each simulation step results in loading a new page
from the file. If this parameter is non-zero, then the first page is instead loaded at each step. This
can be used, for example, to reassert a starting configuration prior to other changes, or to load a
common set of changes into a series of configurations.
- force_occurence_data — If set, then occurence data is used even in change_defined_values
mode. When loading data for a highly repetitive system, where many elements have identical names,
this can greatly speed completion of the operation.
- use_first — It is possible that the input file will contain multiple lines for any given parameter. In
this case, elegant will by default process all lines. For example, if the lines give differential values,
then all would be included. However, if the lines give absolute values, then the last one will
overwrite the previous values; this flag allows overriding the behavior in this case to
force elegant to use the first value. This can have speed advantages for cases where
there are many identical occurences of the same element with identical values for the
parameters.
- clear_settings — If set, clear all settings and files being used for loading parameters.
- allow_missing_elements — If set, allow elements in the file that are not in the lattice. In this case,
the nonapplicable data is simply ignored.
- allow_missing_parameters — If set, it is not an error if any element in the lattice lacks a
parameter that exists in the file.
- allow_missing_files — If set, it is not an error if any listed file is missing.
- verbose — If set, provide informational printouts about changes to parameters.
- skip_pages — Specify the number of pages of input to skip.