Tao

Tao (The Tool for Accelerator Optics)

Classes (Fortran Structures)

TaoBeamBranchStruct

Fortran struct: tao_beam_branch_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
beam_at_start BeamStruct Initial beam
beam_init BeamInitStruct User set beam distrubution at track start.
beam_init_used BeamInitStruct beam distribution with emit values set.
init_starting_distribution bool Init beam
track_start str Tracking start element.
track_end str
ix_branch int Branch tracked. If track_start or track_end is a lord, ix_track_start/end index will be a index of slave.
ix_track_start int Element track start index.
ix_track_end int Element track end index

TaoBeamUniStruct

Fortran struct: tao_beam_uni_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
saved_at str
dump_file str
dump_at str
track_beam_in_universe bool Beam tracking enabled in this universe?
always_reinit bool

TaoBuildingWallOrientationStruct

Fortran struct: tao_building_wall_orientation_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
theta float
x_offset float
z_offset float

TaoBuildingWallPointStruct

Fortran struct: tao_building_wall_point_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
z float Global floor position
x float Global floor position
radius float Arc radius. +r -> CW rotation, same as bends.
z_center float Arc center.
x_center float Arc center.

TaoBuildingWallSectionStruct

Fortran struct: tao_building_wall_section_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
name str
constraint str "left_side" or "right_side" constraint.
point 1D array of TaoBuildingWallPointStruct

TaoBuildingWallStruct

Fortran struct: tao_building_wall_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
orientation TaoBuildingWallOrientationStruct
section 1D array of TaoBuildingWallSectionStruct

TaoCmdHistoryStruct

Fortran struct: tao_cmd_history_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
cmd str The command
ix int Command index (1st command has ix = 1, etc.) Note: Commands from command files will be assigned an index.

TaoCommonStruct

Fortran struct: tao_common_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
plot_place_buffer 1D array of TaoPlotRegionStruct Used when %external_plotting is on.
covar 2D array of float
alpha 2D array of float
dummy_target float Dummy varaible
n_alias int
cmd_file_level int For nested command files. 0 -> no command file.
ix_key_bank int For single mode.
ix_history int Index to latest command in the history circular buffer.
n_history int Number of commands issued from beginning of starting Tao.
lev_loop int in do loop nest level
n_err_messages_printed int Used by tao_set_invalid to limit number of messages.
n_universes int
ix_beam_track_active_element int Element being tracked through tao_beam_track.
cmd_file_paused bool
use_cmd_here bool Used for commands recalled from the cmd history stack
cmd_from_cmd_file bool was command from a command file?
use_saved_beam_in_tracking bool
single_mode bool
combine_consecutive_elements_of_like_name bool
have_tracked_beam bool Used to catch error when beam plotting without having tracked a beam.
init_plot_needed bool reinitialize plotting?
init_beam bool Used by custom programs to control Tao init
init_var bool Used by custom programs to control Tao init
init_read_lat_info bool Used by custom programs to control Tao init
optimizer_running bool
have_datums_using_expressions bool
print_to_terminal bool Print command prompt to the terminal? For use with GUIs.
lattice_calc_done bool Used by GUI for deciding when to refresh.
add_measurement_noise bool Turn off to take data derivatives.
is_err_message_printed 1D array of bool (shape: 2) Used by tao_set_invalid
command_arg_has_been_executed bool Has the -command command line argument been executed?
all_merit_weights_positive bool
multi_turn_orbit_is_plotted bool Is a multi_turn_orbit being plotted?
force_chrom_calc bool Used by a routine to force a single chromaticity calculation.
force_rad_int_calc bool Used by a routine to force a single radiation integrals calculation
rad_int_ri_calc_on bool "Classical" radiation integrals calculation on/off.
rad_int_6d_calc_on bool 6D Radiation integrals calculation on/off.
valid_plot_who 1D array of str (shape: 10) model, base, ref etc...
single_mode_buffer str
cmd str Used for the cmd history

TaoCurveColorStruct

Fortran struct: tao_curve_color_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
data_type str Datum type to use for z-axis.
is_on bool On/Off
min float Min and max values for mapping z-axis to color.
max float Min and max values for mapping z-axis to color.
autoscale bool Set %min, %max automatically to the limits of %data_type

TaoCurveOrbitStruct

Fortran struct: tao_curve_orbit_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
x float Transverse offset
y float Transverse offset
t float Time

TaoCurveStruct

Fortran struct: tao_curve_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
name str Name identifying the curve.
data_source str 'lat', 'beam', 'data' (deprecated: 'dat'), 'var', 'multi_turn_orbit'
data_index str Used for calculating %ix_symb(:).
data_type_x str Used for data slices and phase space plots.
data_type str 'orbit.x', etc.
ele_ref_name str Reference element.
legend_text str String to draw in a curve legend.
message_text str Informational message to draw with graph.
component str Who to plot. Eg: 'meas - design'
why_invalid str Informative string to print.
g TaoGraphStruct pointer to parent graph
hist TaoHistogramStruct
z_color TaoCurveColorStruct
x_line 1D array of float Coords for drawing a curve
y_line 1D array of float
y2_line 1D array of float Second array needed for beam chamber curve.
ix_line 1D array of int Used by wave and aperture curves.
x_symb 1D array of float Coords for drawing the symbols
y_symb 1D array of float
z_symb 1D array of float Symbol color
err_symb 1D array of float Error bars
symb_size 1D array of float Symbol size. Used with symbol_size_scale.
ix_symb 1D array of int Corresponding index in d1_data%d(:) array.
y_axis_scale_factor float y-axis conversion from internal to plotting units.
line QpLineStruct Line attributes
symbol QpSymbolStruct Symbol attributes
orbit TaoCurveOrbitStruct Used for E/B field plotting.
ix_universe int Universe where data is. -1 => use s%global%default_universe
symbol_every int Symbol every how many points.
ix_branch int
ix_bunch int Bunch to plot.
n_turn int Used for multi_turn_orbit plotting
use_y2 bool Use y2 axis?
draw_line bool Draw a line through the data points?
draw_symbols bool Draw a symbol at the data points?
draw_symbol_index bool Draw the symbol index number curve%ix_symb?
draw_error_bars bool Draw error bars based upon data%error_rms if drawing data? !! logical :: draw_rms = .false. ! Show mean and RMS values with legend?
smooth_line_calc bool Calculate data between element edge points?
valid bool valid data?

TaoD1DataStruct

Fortran struct: tao_d1_data_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
name str Eg: 'x', etc.
d2 TaoD2DataStruct ptr to parent d2_data
d 1D array of TaoDataStruct Pointer to the appropriate section in u%data

TaoD2DataStruct

Fortran struct: tao_d2_data_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
name str Name to be used with commands.
data_file_name str Data file name .
ref_file_name str Reference file name.
data_date str Data measurement date.
ref_date str Reference data measurement date.
descrip 1D array of str (shape: 10) Array for descriptive information.
d1 1D array of TaoD1DataStruct Points to children
ix_universe int Index of universe this is in.
ix_d2_data int Index in u%d2_data(:) array.
ix_ref int Index of the reference data set.
data_read_in bool A data set has been read in?
ref_read_in bool A reference data set has been read in?

TaoDataStruct

Fortran struct: tao_data_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
ele_name str Name of the lattice element where datum is evaluated.
ele_start_name str Name of starting lattice element when there is a range
ele_ref_name str Name of reference lattice element
data_type str Type of data: 'orbit.x', etc.
merit_type str Type of constraint: 'target', 'max', 'min', etc.
id str Used by Tao extension code. Not used by Tao directly.
data_source str 'lat', 'beam', 'data' or 'var'. Last two used for expressions.
why_invalid str Informational string if there is a problem.
ix_uni int Universe index of datum.
ix_bunch int Bunch number to get the data from.
ix_branch int Index of the associated lattice branch.
ix_ele int Index of the lattice element corresponding to ele_name
ix_ele_start int Index of lattice elment when there is a range
ix_ele_ref int Index of lattice elment when there is a reference.
ix_ele_merit int Index of lattice elment where merit is evaluated.
ix_d1 int Index number in u%d2_data(i)%d1_data(j)%d(:) array.
ix_data int Index of this datum in the u%data(:) array of data_structs.
ix_dModel int Row number in the dModel_dVar derivative matrix.
eval_point int or anchor_center\(, anchor_beginning\). Where to evaluate data relative to the element.
meas_value float Measured datum value.
ref_value float Measured datum value from the reference data set.
model_value float Datum value as calculated from the model.
design_value float What the datum value is in the design lattice.
old_value float The model_value at some previous time.
base_value float The value as calculated from the base model.
error_rms float Measurement error RMS. Used in plotting.
delta_merit float Diff used to calculate the merit function term.
weight float Weight for the merit function term.
invalid_value float Value used in merit calc if good_model = F (or possibly good_design & good_base).
merit float Merit function term value: weight * delta_merit^2
s float longitudinal position of ele.
s_offset float Offset of the evaluation point.
ref_s_offset float Offset of the reference point. In development.
err_message_printed bool Used to prevent zillions of error messages being generated
exists bool See above
good_model bool See above
good_base bool See above
good_design bool See above
good_meas bool See above
good_ref bool See above
good_user bool See above
good_opt bool See above
good_plot bool See above
useit_plot bool See above
useit_opt bool See above
spin_map TaoSpinMapStruct
d1 TaoD1DataStruct Pointer to the parent d1_data_struct

TaoDataVarComponentStruct

Fortran struct: tao_data_var_component_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
name str Eg: 'meas', 'ref', 'model', etc.
sign float +1 or -1

TaoDrawingStruct

Fortran struct: tao_drawing_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
ele_shape 1D array of TaoEleShapeStruct

TaoDynamicApertureStruct

Fortran struct: tao_dynamic_aperture_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
param ApertureParamStruct
scan 1D array of ApertureScanStruct One scan for each pz.
pz 1D array of float
ellipse_scale float
a_emit float
b_emit float

TaoElePointerStruct

Fortran struct: tao_ele_pointer_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
eles 1D array of ElePointerStruct
n_loc int

TaoEleShapeStruct

Fortran struct: tao_ele_shape_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
ele_id str element "key::name" to match to.
shape str Shape to draw
color str Color of shape
size float plot vertical height
label str Can be: 'name', 's', 'none'
draw bool Draw the shape?
multi bool Can be part of a multi-shape.
line_width int Width of lines used to draw the shape.
offset float Vertical offset.
ix_key int Extracted from ele_id. 0 => all classes (quadrupole, etc.)
name_ele str Name of element.
uni 1D array of TaoElePointerStruct

TaoEvalNodeStruct

Fortran struct: tao_eval_node_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
type int
name str
scale float Scale factor for ping data
value 1D array of float
info 1D array of TaoExpressionInfoStruct
node 1D array of TaoEvalNodeStruct Child nodes for tree construction.

TaoExpressionInfoStruct

Fortran struct: tao_expression_info_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
good bool Expression is valid.
ele EleStruct Associated ele if it exists
s float Longitudinal position of expression.

TaoFloorPlanStruct

Fortran struct: tao_floor_plan_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
view str or 'xz'.
rotation float Rotation of floor plan plot: 1.0 -> 360^deg
correct_distortion bool T -> Shrink one axis so x-scale = y-scale.
flip_label_side bool Draw element label on other side of element?
size_is_absolute bool Are shape sizes in meters or window pixels?
draw_only_first_pass bool Draw only first pass with multipass elements?
draw_building_wall bool Draw the building wall?
orbit_scale float Scale factor for drawing orbits. 0 -> Do not draw.
orbit_color str
orbit_pattern str
orbit_lattice str Or 'design' or 'base'
orbit_width int

TaoGlobalStruct

Fortran struct: tao_global_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
beam_dead_cutoff float Percentage of dead particles at which beam tracking is stopped.
lm_opt_deriv_reinit float Reinit derivative matrix cutoff
de_lm_step_ratio float Scaling for step sizes between DE and LM optimizers.
de_var_to_population_factor float DE population = max(n_var*factor, 20)
lmdif_eps float Tollerance for lmdif optimizer.
lmdif_negligible_merit float
svd_cutoff float SVD singular value cutoff.
unstable_penalty float Used in unstable_ring datum merit calculation.
merit_stop_value float Merit value below which an optimizer will stop.
dmerit_stop_value float Fractional Merit change below which an optimizer will stop.
random_sigma_cutoff float Cut-off in sigmas.
delta_e_chrom float Delta E used from chrom calc.
max_plot_time float If plotting time (seconds) exceeds this than a message is generated.
default_universe int Default universe to work with.
default_branch int Default lattice branch to work with.
n_opti_cycles int Number of optimization cycles
n_opti_loops int Number of optimization loops
n_threads int Number of OpenMP threads for parallel calculations.
phase_units int Phase units on output.
bunch_to_plot int Which bunch to plot
random_seed int Use system clock by default
n_top10_merit int Number of top merit constraints to print.
srdt_gen_n_slices int Number times to slice elements for summation RDT calculation
datum_err_messages_max int Maximum number of error messages per call to lattice_calc.
srdt_sxt_n_slices int Number times to slice sextupoles for summation RDT calculation
srdt_use_cache bool Create cache for SRDT calculations. Can use lots of memory if srdt_*_n_slices large.
quiet str Print I/O when running a command file?
random_engine str Non-beam random number engine
random_gauss_converter str Non-beam
track_type str or 'beam'
lat_sigma_calc_uses_emit_from str Lattice derived sigma matrix uses emit values from where? Other possibilities: "beam", "beam_init".
prompt_string str
prompt_color str See read_a_line routine for possible settings.
optimizer str optimizer to use.
print_command str
var_out_file str
history_file str
beam_timer_on bool For timing the beam tracking calculation.
box_plots bool For debugging plot layout issues.
blank_line_between_commands bool Add a blank line between command output?
cmd_file_abort_on_error bool Abort open command files if there is an error?
concatenate_maps bool False => tracking using DA.
derivative_recalc bool Recalc before each optimizer run?
derivative_uses_design bool Derivative calc uses design lattice instead of model?
disable_smooth_line_calc bool Global disable of the smooth line calculation.
draw_curve_off_scale_warn bool Display warning on graphs?
external_plotting bool Used with matplotlib and gui.
label_lattice_elements bool For lat_layout plots
label_keys bool For lat_layout plots
lattice_calc_on bool Turn on/off beam and single particle calculations.
only_limit_opt_vars bool Only apply limits to variables used in optimization.
opt_with_ref bool Use reference data in optimization?
opt_with_base bool Use base data in optimization?
opt_match_auto_recalc bool Set recalc = True for match elements before each cycle?
opti_write_var_file bool "run" command writes var_out_file
optimizer_allow_user_abort bool See Tao manual for more details.
optimizer_var_limit_warn bool Warn when vars reach a limit with optimization.
plot_on bool Do plotting?
rad_int_user_calc_on bool User set radiation integrals calculation on/off.
rf_on bool RFcavities on or off? Does not affect lcavities.
single_step bool For debugging and demonstrations: Single step through a command file?
stop_on_error bool For debugging: False prevents tao from exiting on an error.
svd_retreat_on_merit_increase bool
var_limits_on bool Respect the variable limits?
wait_for_CR_in_single_mode bool For use with a python GUI.
symbol_import bool Import symbols from lattice file(s)? Internal stuff
debug_on bool For debugging.
expression_tree_on bool Use an expression tree instead of a stack?
verbose_on bool For verbose output. Used with debugging.

TaoGraphStruct

Fortran struct: tao_graph_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
name str Name identifying the graph
type str 'data', 'lat_layout', 'phase_space', 'histogram', 'dynamic_aperture'
title str
title_suffix str
text_legend 1D array of str (shape: 10) Array for holding descriptive info.
text_legend_out 1D array of str (shape: 10) Array for holding descriptive info.
why_invalid str Informative string to print.
curve 1D array of TaoCurveStruct
p TaoPlotStruct pointer to parent plot
floor_plan TaoFloorPlanStruct
text_legend_origin QpPointStruct
curve_legend_origin QpPointStruct
curve_legend QpLegendStruct
x QpAxisStruct X-axis parameters.
y QpAxisStruct Y-axis attributes.
x2 QpAxisStruct X2-axis attributes (Not currently used).
y2 QpAxisStruct Y2-axis attributes.
margin QpRectStruct Margin around the graph.
scale_margin QpRectStruct Margin for scaling
x_axis_scale_factor float x-axis conversion from internal to plotting units.
symbol_size_scale float Symbol size scale factor for phase_space plots.
box 1D array of int (shape: 4) Defines which box the plot is put in.
ix_branch int Branch in lattice. Used when there are no associated curves.
ix_universe int Used for lat_layout plots.
clip bool Clip plot at graph boundary.
y2_mirrors_y bool Y2-axis same as Y-axis?
limited bool True if at least one data point past graph bounds.
draw_axes bool Draw axes, labels, etc?
draw_curve_legend bool Legend for displaying curve info.
draw_grid bool Draw a grid?
draw_title bool
draw_only_good_user_data_or_vars bool
allow_wrap_around bool "Wrap" curves to extend past lattice boundaries?
is_valid bool EG: Bad x_axis_type.

TaoHistogramStruct

Fortran struct: tao_histogram_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
density_normalized bool
weight_by_charge bool
minimum float Computed by Tao. Not User settable.
maximum float Computed by Tao. Not User settable.
width float
center float
number int

TaoInitStruct

Fortran struct: tao_init_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
parse_cmd_args bool Used by custom programs to control Tao init
debug_switch bool Is the "-debug" switch present?
external_plotting_switch bool Is "-external_plotting" switch present?
init_name str label for initialization
hook_init_file str
hook_lat_file str To be set by tao_hook_parse_command_args
hook_beam_file str To be set by tao_hook_parse_command_args
hook_data_file str To be set by tao_hook_parse_command_args
hook_plot_file str To be set by tao_hook_parse_command_args
hook_startup_file str To be set by tao_hook_parse_command_args
hook_var_file str To be set by tao_hook_parse_command_args
hook_building_wall_file str To be set by tao_hook_parse_command_args
init_file_arg_path str Path part of init_tao_file
lattice_file_arg str -lattice_file command line argument.
hook_init_file_arg str -hook_init_file command line argument
init_file_arg str -init_file command line argument.
beam_file_arg str -beam_file command line argument.
beam_init_position_file_arg str -beam_init_position_file command line argument.
command_arg str -command command line argument.
data_file_arg str -data_file command line argument.
plot_file_arg str -plot_file command line argument.
startup_file_arg str -startup_file command line argument.
var_file_arg str -var_file command line argument.
building_wall_file_arg str -building_wall_file command line argument.
geometry_arg str -geometry command line argument.
slice_lattice_arg str -slice_lattice command line argument.
start_branch_at_arg str -start_branch_at command line argument.
log_startup_arg str -log_startup command line argument
no_stopping_arg str -no_stopping command line argument
noplot_arg str -noplot command line argument
no_rad_int_arg str -no_rad_int command line argument
reverse_arg str -reverse command line argument
debug_arg str -debug command line argument
disable_smooth_line_calc_arg str -disable_smooth_line_calc
rf_on_arg str -rf_on command line argument
prompt_color_arg str -prompt_color command line argument
quiet_arg str -quiet command line argument
noinit_arg str -noinit command line argument
nostartup_arg str -nostartup command line argument
symbol_import_arg str -symbol_import command line argument
unique_name_suffix str

TaoLatSigmaStruct

Fortran struct: tao_lat_sigma_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
mat 2D array of float (shape: 6,6)

TaoLatticeBranchStruct

Fortran struct: tao_lattice_branch_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
tao_lat TaoLatticeStruct Parent tao_lat
lat_sigma 1D array of TaoLatSigmaStruct Sigma matrix derived from lattice (not beam).
spin_ele 1D array of TaoSpinEleStruct Spin stuff
bunch_params 1D array of BunchParamsStruct Per element
bunch_params_comb 1D array of BunchTrackStruct A comb for each bunch in beam.
orbit 1D array of CoordStruct
plot_cache 1D array of TaoPlotCacheStruct Plotting data cache
spin TaoSpinPolarizationStruct
srdt SummationRdtStruct
orb0 CoordStruct For saving beginning orbit in closed geometry branches. orb0 can then be used as an initial guess when closed_orbit is called again.
modes_ri NormalModesStruct Synchrotron integrals stuff
modes_6d NormalModesStruct 6D radiation matrices.
ptc_normal_form PtcNormalFormStruct Collection of normal form structures defined in PTC
bmad_normal_form BmadNormalFormStruct Collection of normal form structures defined in Bmad
high_E_orb 1D array of CoordStruct
low_E_orb 1D array of CoordStruct
taylor_save 1D array of TaylorStruct (shape: 6) Save to reduce computation time.
cache_x_min float
cache_x_max float
comb_ds_save float Master parameter for %bunch_params_comb(:)%ds_save
ix_ref_taylor int
ix_ele_taylor int
track_state int
cache_n_pts int
ix_rad_int_cache int Radiation integrals cache index.
has_open_match_element bool
plot_cache_valid bool Valid plotting data cache?
spin_map_valid bool
twiss_valid bool Invalid EG with unstable 1-turn matrix with a closed branch. With open branch: twiss_valid = T even if some Twiss (and orbit) is invalid.
mode_flip_here bool Twiss parameter mode flip seen?
chrom_calc_ok bool
rad_int_calc_ok bool
emit_6d_calc_ok bool
sigma_track_ok bool

TaoLatticeStruct

Fortran struct: tao_lattice_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
name str "model", "base", or "design".
lat LatStruct lattice structures
high_E_lat LatStruct For chrom calc.
low_E_lat LatStruct For chrom calc.
rad_int_by_ele_ri RadIntAllEleStruct
rad_int_by_ele_6d RadIntAllEleStruct
tao_branch 1D array of TaoLatticeBranchStruct

TaoModelBranchStruct

Fortran struct: tao_model_branch_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
ele 1D array of TaoModelElementStruct Per element information
beam TaoBeamBranchStruct

TaoModelElementStruct

Fortran struct: tao_model_element_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
beam BeamStruct Beam distribution at element.
save_beam_internally bool Save beam here? Beam also saved at fork elements and at track ends.
save_beam_to_file bool Save beam to a file? Beam also saved at fork elements and at track ends.

TaoPingScaleStruct

Fortran struct: tao_ping_scale_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
a_mode_meas float
a_mode_ref float
b_mode_meas float
b_mode_ref float

TaoPlotCacheStruct

Fortran struct: tao_plot_cache_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
ele_to_s EleStruct Integrated element from branch beginning. Will be marked as a hybrid element.
orbit CoordStruct
err bool

TaoPlotPageStruct

Fortran struct: tao_plot_page_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
title TaoTitleStruct Title at top of page.
subtitle TaoTitleStruct Subtitle below title at top of page.
border QpRectStruct Border around plots edge of page.
floor_plan TaoDrawingStruct
lat_layout TaoDrawingStruct
pattern 1D array of TaoShapePatternStruct
template_ 1D array of TaoPlotStruct Templates for the plots.
region 1D array of TaoPlotRegionStruct
plot_display_type str 'X' or 'TK'
size 1D array of float (shape: 2) width and height of plot window in pixels.
text_height float In points. Scales the height of all text
main_title_text_scale float Relative to text_height
graph_title_text_scale float Relative to text_height
axis_number_text_scale float Relative to text_height
axis_label_text_scale float Relative to text_height
legend_text_scale float Relative to text_height. For legends, plot_page, and lat_layout
key_table_text_scale float Relative to text_height
floor_plan_shape_scale float
floor_plan_text_scale float Scale used = floor_plan_text_scale * legend_text_scale
lat_layout_shape_scale float
lat_layout_text_scale float Scale used = lat_layout_text_scale * legend_text_scale
n_curve_pts int Default number of points for plotting a smooth curve.
id_window int X window id number.
delete_overlapping_plots bool Delete overlapping plots when a plot is placed?
draw_graph_title_suffix bool Draw the graph title suffix?

TaoPlotRegionStruct

Fortran struct: tao_plot_region_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
name str Region name. Eg: 'r13', etc.
plot TaoPlotStruct Plot associated with this region
location 1D array of float (shape: 4) [x1, x2, y1, y2] location on page.
visible bool To draw or not to draw.
list_with_show_plot_command bool False used for default plots to shorten the output of "show plot"
setup_done bool Used for plot bookkeeping.

TaoPlotStruct

Fortran struct: tao_plot_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
name str Identifying name. Rule: If name is blank, plot is not valid.
description str Descriptive string.
graph 1D array of TaoGraphStruct individual graphs of a plot
r TaoPlotRegionStruct pointer to parent.
ix_plot int Index in s%plot_page%template(:) or %region(:) arrays.
n_curve_pts int Overrides s%plot_page%n_curve_pts.
type str or 'wave'
x_axis_type str 'index', 'ele_index', 's', 'none', 'floor', 'phase_space', etc.
autoscale_x bool Horizontal autoscale.
autoscale_y bool Vertical autoscale.
autoscale_gang_x bool scale cmd scales graphs together?
autoscale_gang_y bool scale cmd scales graphs together?
list_with_show_plot_command bool False used for default plots to shorten the output of "show plot"
phantom bool Used by tao_plot_init to add info lines to "show plot -templates"
default_plot bool One of Tao's default plots?

TaoShapePatternPointStruct

Fortran struct: tao_shape_pattern_point_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
s float
y float
radius float

TaoShapePatternStruct

Fortran struct: tao_shape_pattern_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
name str
line QpLineStruct Line color and pattern set by shape using this pattern.
pt 1D array of TaoShapePatternPointStruct

TaoSpinDnDpzStruct

Fortran struct: tao_spin_dn_dpz_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
vec 1D array of float (shape: 3) n0 derivative wrt pz.
partial 2D array of float (shape: 3,3) partial(i:) is spin n0 derivative wrt pz for i^th oscillation mode (1 => a-mode, etc.)
partial2 2D array of float (shape: 3,3) partial(i:) is spin n0 derivative wrt pz with i^th oscillation mode missing (1 => a-mode, etc.)

TaoSpinEleStruct

Fortran struct: tao_spin_ele_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
dn_dpz TaoSpinDnDpzStruct
orb_eigen_val 1D array of float (shape: 6)
orb_eigen_vec 2D array of float (shape: 6,6) (j,:) is j^th vector
spin_eigen_vec 2D array of float (shape: 6,3) (j,:) is j^th vector
valid bool

TaoSpinMapStruct

Fortran struct: tao_spin_map_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
valid bool
map1 SpinOrbitMap1Struct
axis_input SpinAxisStruct Input axes.
axis0 SpinAxisStruct Initial axes.
axis1 SpinAxisStruct Final axes.
ix_ele int
ix_ref int
ix_uni int
ix_branch int
mat8 2D array of float (shape: 8,8)

TaoSpinPolarizationStruct

Fortran struct: tao_spin_polarization_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
tune float
pol_limit_st float Polarization calculated using Sokolov-Ternov formula.
pol_limit_dk float Equalibrium Polarization calculated via the Derbenev-Kondratenko-Mane formula.
pol_limit_dk_partial 1D array of float (shape: 3) Limit using only single mode to calc dn_dpz
pol_limit_dk_partial2 1D array of float (shape: 3) Limit using only single mode to calc dn_dpz
pol_rate_bks float BKS Polarization rate (1/sec).
depol_rate float Depolarization rate (1/sec).
depol_rate_partial 1D array of float (shape: 3) Depolarization rate (1/sec) using only single mode to calc dn_dpz.
depol_rate_partial2 1D array of float (shape: 3) Depolarization rate (1/sec) using only two modes to calc dn_dpz.
integral_bn float Integral of g^3 * b_hat * n_0
integral_bdn float Integral of g^3 * b_hat * dn/ddelta
integral_1ns float Integral of g^3 (1 - 2(n * s_hat)/9)
integral_dn2 float Integral of g^3 * 11 (dn/ddelta)^2 / 9
valid bool
q_1turn SpinOrbitMap1Struct Save results from spin_concat_linear_maps in tao_spin_polarization.
q_ele 1D array of SpinOrbitMap1Struct Save results from spin_concat_linear_maps in tao_spin_polarization.

TaoSuperUniverseStruct

Fortran struct: tao_super_universe_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
global_ TaoGlobalStruct User accessible global variables.
init TaoInitStruct Initialization parameters
com TaoCommonStruct Non-initialization common parameters
plot_page TaoPlotPageStruct Defines the plot window.
v1_var 1D array of TaoV1VarStruct The variable types
var 1D array of TaoVarStruct array of all variables.
u 1D array of TaoUniverseStruct array of universes.
key 1D array of int
building_wall TaoBuildingWallStruct
wave TaoWaveStruct
n_var_used int
n_v1_var_used int
history 1D array of TaoCmdHistoryStruct (shape: 1000) command history
initialized bool Does tao_init() need to be called?

TaoTitleStruct

Fortran struct: tao_title_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
string str title character string.
x float x, y rwt lower left corner
y float x, y rwt lower left corner
units str %BOX, POINTS, etc...
justify str Left, Center, or Right justification.
draw_it bool draw the title?

TaoUniverseCalcStruct

Fortran struct: tao_universe_calc_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
srdt_for_data int 0 = false, 1 = 1st order, 2 = 1st & 2nd order
rad_int_for_data bool Do the radiation integrals need to be computed for
rad_int_for_plotting bool data or plotting?
chrom_for_data bool Does the chromaticity need to be computed for
chrom_for_plotting bool data or plotting?
lat_sigma_for_data bool Do the beam sigmas need to be computed for
lat_sigma_for_plotting bool data or plotting?
dynamic_aperture bool Do the dynamic_aperture calc?
one_turn_map bool Compute the one turn map?
lattice bool Used to indicate which lattices need tracking done.
twiss bool calc linear transfer matrix?
track bool tracking needs to be done?
spin_matrices bool Calculate G and D spin matrices?

TaoUniversePointerStruct

Fortran struct: tao_universe_pointer_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
u TaoUniverseStruct

TaoUniverseStruct

Fortran struct: tao_universe_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
model TaoLatticeStruct
design TaoLatticeStruct
base TaoLatticeStruct
beam TaoBeamUniStruct
dynamic_aperture TaoDynamicApertureStruct
model_branch 1D array of TaoModelBranchStruct model specific information
d2_data 1D array of TaoD2DataStruct The data types
data 1D array of TaoDataStruct Array of all data.
ping_scale TaoPingScaleStruct
scratch_lat LatStruct Scratch area.
calc TaoUniverseCalcStruct What needs to be calculated?
ele_order LatEleOrderStruct Order of elements with same name.
spin_map TaoSpinMapStruct
dModel_dVar 2D array of float Derivative matrix.
ix_uni int Universe index.
n_d2_data_used int Number of used %d2_data(:) components.
n_data_used int Number of used %data(:) components.
is_on bool universe turned on
design_same_as_previous bool Design lat same as the previous uni?
picked_uni bool Scratch logical.

TaoV1VarStruct

Fortran struct: tao_v1_var_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
name str V1 variable name. Eg: 'quad_k1'.
ix_v1_var int Index to s%v1_var(:) array
v 1D array of TaoVarStruct Pointer to the appropriate section in s%var.

TaoVarSlaveStruct

Fortran struct: tao_var_slave_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
ix_uni int universe index.
ix_branch int
ix_ele int Index of element in the u%lattice%ele(:) array.
model_value float Pointer to the variable in the model lat.
base_value float Pointer to the variable in the base lat.

TaoVarStruct

Fortran struct: tao_var_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
ele_name str Associated lattice element name.
attrib_name str Name of the attribute to vary.
id str Used by Tao extension code. Not used by Tao directly.
slave 1D array of TaoVarSlaveStruct
ix_v1 int Index of this var in the s%v1_var(i)%v(:) array.
ix_var int Index number of this var in the s%var(:) array.
ix_dvar int Column in the dData_dVar derivative matrix.
ix_attrib int Index in ele%value(:) array if appropriate.
ix_key_table int Has a key binding?
model_value float Model value.
base_value float Base value.
design_value float Design value from the design lattice.
scratch_value float Scratch space used by Tao.
old_value float Scratch space used by Tao.
meas_value float The value when the data measurement was taken.
ref_value float Value when the reference measurement was taken.
correction_value float Value determined by a fit to correct the lattice.
high_lim float High limit for the model_value.
low_lim float Low limit for the model_value.
step float Sets what is a small step for varying this var.
weight float Weight for the merit function term.
delta_merit float Diff used to calculate the merit function term.
merit float merit_term = weight * delta^2.
dMerit_dVar float Merit derivative.
key_val0 float Key base value
key_delta float Change in value when a key is pressed.
s float longitudinal position of ele.
extend_val float For extension code. Not used by Tao.
merit_type str 'target' or 'limit'
exists bool See above
good_var bool See above
good_user bool See above
good_opt bool See above
good_plot bool See above
useit_opt bool See above
useit_plot bool See above
key_bound bool Variable bound to keyboard key?
v1 TaoV1VarStruct Pointer to the parent.

TaoWaveKickPtStruct

Fortran struct: tao_wave_kick_pt_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
phi_s float
phi_r float
phi float
amp float
s float s-position of kick
ix_dat_before_kick int Index of datum in data array just before the kick.
ele EleStruct lattice element at position of kick.

TaoWaveStruct

Fortran struct: tao_wave_struct (tao/code/tao_struct.f90)

All attributes may be passed to the initializer as arguments:

Attribute Type Description
data_type str
rms_rel_a float
rms_rel_b float
rms_rel_as float
rms_rel_bs float
rms_rel_ar float
rms_rel_br float
rms_rel_k float
rms_rel_ks float
rms_rel_kr float
rms_phi float
rms_phi_s float
rms_phi_r float
amp_ba_s float
amp_ba_r float
chi_a float
chi_c float
chi_ba float
amp_a 1D array of float (shape: 2)
amp_b 1D array of float (shape: 2)
amp_ba 1D array of float (shape: 2)
coef_a 1D array of float (shape: 4)
coef_b 1D array of float (shape: 4)
coef_ba 1D array of float (shape: 4)
n_func int Number of functions used in the fit.
ix_a1 int
ix_a2 int
ix_b1 int
ix_b2 int
i_a1 int
i_a2 int
i_b1 int
i_b2 int
n_a int
n_b int
i_curve_wrap_pt int Index of last point before wrap in curve array.
ix_data 1D array of int Translates from plot point to datum index
n_kick int
kick 1D array of TaoWaveKickPtStruct
base_graph TaoGraphStruct Graph before curves extended to 1.5 periods.
region TaoPlotRegionStruct Where the wave plot is
d1_dat TaoD1DataStruct D1 data for analysis

Procedures

integrate_max

Fortran source: tao/code/tao_data_and_eval_mod.f90

integrate_max(ix_start: typing.SupportsInt | typing.SupportsIndex, ix_ele: typing.SupportsInt | typing.SupportsIndex, datum_value: typing.SupportsFloat | typing.SupportsIndex, ix_m: typing.SupportsInt | typing.SupportsIndex, branch: pybmad._pybmad.BranchStruct, vec: pybmad._pybmad.RealArray1D, datum: pybmad._pybmad.TaoDataStruct) -> None

Wrapper for Fortran routine integrate_max

Parameters:
  • ix_start (int) –
  • ix_ele (int) –
  • datum_value (float) –
  • ix_m (int) –
  • branch (BranchStruct) –
  • vec (1D array of float) –
  • datum (TaoDataStruct) –

integrate_min

Fortran source: tao/code/tao_data_and_eval_mod.f90

integrate_min(ix_start: typing.SupportsInt | typing.SupportsIndex, ix_ele: typing.SupportsInt | typing.SupportsIndex, datum_value: typing.SupportsFloat | typing.SupportsIndex, ix_m: typing.SupportsInt | typing.SupportsIndex, branch: pybmad._pybmad.BranchStruct, vec: pybmad._pybmad.RealArray1D, datum: pybmad._pybmad.TaoDataStruct) -> None

Wrapper for Fortran routine integrate_min

Parameters:
  • ix_start (int) –
  • ix_ele (int) –
  • datum_value (float) –
  • ix_m (int) –
  • branch (BranchStruct) –
  • vec (1D array of float) –
  • datum (TaoDataStruct) –

tao_abort_command_file

Fortran source: tao/code/tao_interface.f90

tao_abort_command_file(force_abort: bool | None = None) -> None

Wrapper for Fortran routine tao_abort_command_file

Parameters:
  • force_abort (bool) –

    : If present and True, ignore s.global.cmd_file_abort_on_error and abort any open command files.

tao_add_to_normal_mode_h_array

Fortran source: tao/code/tao_init_data_mod.f90

tao_add_to_normal_mode_h_array(h_str: str) -> pybmad._pybmad.ResonanceHStructAlloc1D

Subroutine tao_add_to_normal_mode_h_array(h_str, h_array)

Routine to add on to the "h(:)" array holding the list of normal form resonance driving terms to calculate. If h_str is already in the h_array(:) list, nothing is done.

Parameters:
  • h_str (str) –

    Resonance driving term ID. EG: "110000"

Returns:
  • h_array( 1D array of ResonanceHStruct ) –

    Array of resonance driving terms.

tao_alias_cmd

Fortran source: tao/code/tao_interface.f90

tao_alias_cmd(alias: str, string: str) -> None

Wrapper for Fortran routine tao_alias_cmd

Parameters:
  • alias (str) –

    Name of the tao command file.

  • string (str) –

    Command file arguments.

tao_allocate_data_array

Fortran source: tao/code/tao_init_data_mod.f90

tao_allocate_data_array(u: pybmad._pybmad.TaoUniverseStruct, n_data: typing.SupportsInt | typing.SupportsIndex, exact: bool | None = None) -> None

Wrapper for Fortran routine tao_allocate_data_array

Parameters:

tao_allocate_v1_var

Fortran source: tao/code/tao_init_variables_mod.f90

tao_allocate_v1_var(n_v1: typing.SupportsInt | typing.SupportsIndex, save_old: bool) -> None

Wrapper for Fortran routine tao_allocate_v1_var

Parameters:
  • n_v1 (int) –
  • save_old (bool) –

tao_allocate_var_array

Fortran source: tao/code/tao_init_variables_mod.f90

tao_allocate_var_array(n_var: typing.SupportsInt | typing.SupportsIndex, default_good_user: bool) -> None

Subroutine tao_allocate_var_array (n_var, default_good_user)

Routine to increase the s%var(:) array size.

Parameters:
  • n_var (int) –

    Size of s.var(:) wanted.

tao_beam_emit_calc

Fortran source: tao/code/tao_interface.f90

tao_beam_emit_calc(plane: typing.SupportsInt | typing.SupportsIndex, emit_type: typing.SupportsInt | typing.SupportsIndex, ele: pybmad._pybmad.EleStruct, bunch_params: pybmad._pybmad.BunchParamsStruct) -> float

Wrapper for Fortran routine tao_beam_emit_calc

Parameters:
  • plane (int) –

    x_plane$ or y_plane$.

  • emit_type (int) –

    Either projected_emit$ or apparent_emit$

  • ele (EleStruct) –

    Element.

  • bunch_params (BunchParamsStruct) –

    Bunch sigma matrix

Returns:
  • emit( float ) –

    emittance.

tao_beam_track

Fortran source: tao/code/tao_lattice_calc_mod.f90

tao_beam_track(u: pybmad._pybmad.TaoUniverseStruct, tao_lat: pybmad._pybmad.TaoLatticeStruct, ix_branch: typing.SupportsInt | typing.SupportsIndex, beam: pybmad._pybmad.BeamStruct) -> bool

Subroutine tao_beam_track (u, tao_lat, ix_branch, beam, calc_ok)

Routine to track a a beam of particles.

Parameters:
  • u (TaoUniverseStruct) –

    Universe to track through.

  • tao_lat (TaoLatticeStruct) –

    Structure containing the lattice.

  • ix_branch (int) –

    Branch index to track through.

  • beam (BeamStruct) –

    Initial beam distribution This parameter is an input/output and is modified in-place. As an output, beam: Final beam distribution.

Returns:
  • calc_ok( bool ) –

    Set True if there were no problems, False otherwise.

tao_beam_track_endpoint

Fortran source: tao/code/tao_interface.f90

tao_beam_track_endpoint(ele_id: str, lat: pybmad._pybmad.LatStruct, branch_str: str, where: str, u: pybmad._pybmad.TaoUniverseStruct) -> pybmad._pybmad.EleStruct | None

Wrapper for Fortran routine tao_beam_track_endpoint

Parameters:
  • ele_id (str) –

    Name or index of the element.

  • lat (LatStruct) –

    Lattice.

  • branch_str (str) –

    Branch where the tracking is done. '' => Branch not specified.

  • where (str) –

    'TRACK_END', 'TRACK_START', etc.. Used for error messages.

  • u (TaoUniverseStruct) –

    Universe beam is being tracked in.

Returns:
  • ele( (EleStruct, optional) ) –

    Pointer to the track endpoint element. Nullified if error. Note: blank ele_id is handled if "where" contains 'END' or 'START'

tao_branch_index

Fortran source: tao/code/tao_interface.f90

tao_branch_index(ix_branch: typing.SupportsInt | typing.SupportsIndex) -> int

Wrapper for Fortran routine tao_branch_index

Parameters:
  • ix_branch (int) –

    Nominal branch number.

Returns:
  • ix_this( int ) –

    Branch number.

tao_calc_data_at_s_pts

Fortran source: tao/code/tao_graph_setup_mod.f90

tao_calc_data_at_s_pts(tao_lat: pybmad._pybmad.TaoLatticeStruct, curve: pybmad._pybmad.TaoCurveStruct, comp_sign: typing.SupportsFloat | typing.SupportsIndex, good: pybmad._pybmad.BoolAlloc1D) -> None

Wrapper for Fortran routine tao_calc_data_at_s_pts

Parameters:

tao_call_cmd

Fortran source: tao/code/tao_interface.f90

tao_call_cmd(file_name: str, cmd_arg: pybmad._pybmad.CharacterAlloc1D | None = None) -> None

Wrapper for Fortran routine tao_call_cmd

Parameters:
  • file_name (str) –

    Name of the tao command file.

  • cmd_arg (1D array of str) –

    Command file arguments.

tao_cbar_wave_anal

Fortran source: tao/code/tao_wave_mod.f90

tao_cbar_wave_anal(plot: pybmad._pybmad.TaoPlotStruct) -> None

Subroutine tao_cbar_wave_anal (plot)

tao_change_ele

Fortran source: tao/code/tao_change_mod.f90

tao_change_ele(ele_name: str, attrib_name: str, num_str: str, update: bool) -> bool

Subroutine tao_change_ele (ele_name, attrib_name, num_str, update, err_flag)

Routine to change a variable in the model lattice.

Parameters:
  • ele_name (str) –

    Name of variable or element.

  • attrib_name (str) –

    Attribute name of element.

  • num_str (str) –

    Change in value. A '@' signifies a absolute set. A 'd' signifies a set relative design.

Returns:
  • err_flag( bool ) –

    logical, Set true if there is an error, false otherwise.

tao_change_tune

Fortran source: tao/code/tao_change_mod.f90

tao_change_tune(branch_str: str, mask_str: str, print_list: bool, dqa_str: str, dqb_str: str) -> bool

Subroutine tao_change_tune (branch_str, mask_str, print_list, dqa_str, dqb_str, err_flag)

Parameters:
  • branch_str (str) –

    List of branches to apply tune set to.

  • mask_str (str) –

    List of quadrupoles to veto.

  • print_list (bool) –

    If True, print a list of elements varied and coefficients.

  • dqa_str (str) –

    Expression for dQa tune.

  • dqb_str (str) –

    Expression for dQb tune.

Returns:
  • err_flag( bool ) –

    logical, Set true if there is an error, false otherwise.

tao_change_var

Fortran source: tao/code/tao_change_mod.f90

tao_change_var(name: str, num_str: str, silent: bool) -> bool

Subroutine tao_change_var (name, num_str, silent, err_flag)

Routine to change a variable in the model lattice.

Parameters:
  • name (str) –

    Name of variable or element.

  • num_str (str) –

    Change in value. A '@' signifies a absolute set. A 'd' signifies a set relative design.

  • silent (bool) –

    If True then do not print any info.

Returns:
  • err_flag( bool ) –

    logical, Set true if there is an error, false otherwise.

tao_change_z_tune

Fortran source: tao/code/tao_change_mod.f90

tao_change_z_tune(branch_str: str, dq_str: str) -> bool

Subroutine tao_change_z_tune (branch_str, dq_str, err_flag)

Parameters:
  • branch_str (str) –

    List of branches to apply tune set to.

  • dq_str (str) –

    Expression for dQc tune.

Returns:
  • err_flag( bool ) –

    logical, Set true if there is an error, false otherwise.

tao_chrom_calc_needed

Fortran source: tao/code/tao_interface.f90

tao_chrom_calc_needed(data_type: str, data_source: str, do_chrom: bool) -> None

Wrapper for Fortran routine tao_chrom_calc_needed

Parameters:
  • data_type (str) –
  • data_source (str) –
  • do_chrom (bool) –

tao_clear_cmd

Fortran source: tao/code/tao_interface.f90

tao_clear_cmd(cmd_line: str) -> None

Wrapper for Fortran routine tao_clear_cmd

Parameters:
  • cmd_line (str) –

    Should be set to 'maps'.

tao_clip_cmd

Fortran source: tao/code/tao_interface.f90

tao_clip_cmd(gang: bool, where: str, value1: typing.SupportsFloat | typing.SupportsIndex, value2: typing.SupportsFloat | typing.SupportsIndex) -> None

Wrapper for Fortran routine tao_clip_cmd

Parameters:
  • gang (bool) –

    Gang all data d1 arrays together.

  • where (str) –

    Graph() to clip. Eg: 'top:x'

  • value1 (float) –
  • value2 (float) –

tao_close_command_file

Fortran source: tao/code/tao_interface.f90

tao_close_command_file() -> None

Wrapper for Fortran routine tao_close_command_file

tao_cmd_history_record

Fortran source: tao/code/tao_command_mod.f90

tao_cmd_history_record(cmd: str) -> None

Subroutine tao_cmd_history_record (cmd)

Subroutine to record a cmd in the command history stack

tao_cmd_split

Fortran source: tao/code/tao_command_mod.f90

tao_cmd_split(cmd_line: str, n_word: typing.SupportsInt | typing.SupportsIndex, cmd_word: pybmad._pybmad.CharacterAlloc1D, extra_words_is_error: bool, separator: str | None = None) -> bool

Subroutine tao_cmd_split (cmd_line, n_word, cmd_word, extra_words_is_error, err, separator)

This routine splits the command line into "words" (everything between separators).

Parameters:
  • cmd_line (str) –

    The command line.

  • n_word (int) –

    Maximum number of words to split command line into.

  • cmd_word (1D array of str) –

    The individual words.

  • extra_words_is_error (bool) –

    are extra words allowed at the end? If True then err argument is set True. If False then cmd_word(n_word) will contain everything after the n_word-1 word.

  • separator (str) –

    a list of characters that, besides a blank space, signify a word boundary.

Returns:
  • err( bool ) –

    error in splitting words For example: separator = '-+' cmd_line = 'model-design' cmd_word(1) = 'model' cmd_word(2) = '-' cmd_word(3) = 'design'

Notes

Anything between single or double quotes is treated as a single word. Quoted words have quote marks removed. Whitespace or a separator inside of "{}", "()", or "[]" is ignored. Whitespace after or before a comma is ignored.

tao_command

Fortran source: tao/code/tao_interface.f90

tao_command(command_line: str, err: bool) -> bool

Wrapper for Fortran routine tao_command

Parameters:
  • command_line (str) –

    command line

  • err (bool) –
Returns:
  • err_is_fatal( bool ) –

    Set True on non-recoverable error. False otherwise

tao_constraint_type_name

Fortran source: tao/code/tao_interface.f90

tao_constraint_type_name(datum: pybmad._pybmad.TaoDataStruct) -> str

Wrapper for Fortran routine tao_constraint_type_name

Parameters:
Returns:
  • datum_name( str ) –

    Appropriate name.

tao_control_tree_list

Fortran source: tao/code/tao_interface.f90

tao_control_tree_list(ele: pybmad._pybmad.EleStruct) -> pybmad._pybmad.ElePointerStructAlloc1D

Wrapper for Fortran routine tao_control_tree_list

Parameters:
  • ele (EleStruct) –

    Lattice element to start at.

Returns:
  • tree( 1D array of ElePointerStruct ) –

    Array of elements.

tao_count_strings

Fortran source: tao/code/tao_interface.f90

tao_count_strings(string: str, pattern: str) -> int

Wrapper for Fortran routine tao_count_strings

Parameters:
  • string (str) –

    the string to look at

  • pattern (str) –

    the search pattern

Returns:
  • num( int ) –

    number of occurances

tao_create_plot_window

Fortran source: tao/code/tao_plot_window_mod.f90

tao_create_plot_window() -> None

Subroutine tao_create_plot_window ()

Subroutine to create the plot window. This soubroutine knows not to create a second window if one already exists.

tao_curve_beam_ellipse_setup

Fortran source: tao/code/tao_graph_setup_mod.f90

tao_curve_beam_ellipse_setup(curve: pybmad._pybmad.TaoCurveStruct) -> None

Wrapper for Fortran routine tao_curve_beam_ellipse_setup

Parameters:

tao_curve_check_universe

Fortran source: tao/code/tao_graph_setup_mod.f90

tao_curve_check_universe(curve: pybmad._pybmad.TaoCurveStruct, uni: pybmad._pybmad.TaoUniverseStruct) -> bool

Function tao_curve_check_universe (curve, uni) result (is_ok)

Routine to check if the universe associated with a curve exists and is on.

Parameters:
  • curve (TaoCurveStruct) –

    Curve to check. This parameter is an input/output and is modified in-place. As an output, curve: Curve.valid set to False if needed.

  • uni (TaoUniverseStruct) –

    Associated universe

Returns:
  • is_ok( bool ) –

    Set True if associated universe exists and is on.

tao_curve_data_setup

Fortran source: tao/code/tao_graph_setup_mod.f90

tao_curve_data_setup(plot: pybmad._pybmad.TaoPlotStruct, graph: pybmad._pybmad.TaoGraphStruct, curve: pybmad._pybmad.TaoCurveStruct) -> None

Wrapper for Fortran routine tao_curve_data_setup

Parameters:

tao_curve_datum_calc

Fortran source: tao/code/tao_graph_setup_mod.f90

tao_curve_datum_calc(eles: pybmad._pybmad.ElePointerStructAlloc1D, plot: pybmad._pybmad.TaoPlotStruct, curve: pybmad._pybmad.TaoCurveStruct, who: str) -> None

Subroutine tao_curve_datum_calc (eles, plot, curve, who)

Routine to calculate datum values. The values are calculated at the end of each eles(:)%ele element.

Parameters:
  • eles (1D array of ElePointerStruct) –

    Array of elements.

  • plot (TaoPlotStruct) –
  • curve (TaoCurveStruct) –

    This parameter is an input/output and is modified in-place. As an output, curve: Structure holding the datum values

  • who (str) –

    Where to put the data. Either: "SYMBOL" or "LINE".

tao_curve_ele_ref

Fortran source: tao/code/tao_interface.f90

tao_curve_ele_ref(curve: pybmad._pybmad.TaoCurveStruct, point_to_ele_ref: bool, ele_track: pybmad._pybmad.EleStruct) -> None

Wrapper for Fortran routine tao_curve_ele_ref

Parameters:

tao_curve_ix_uni

Fortran source: tao/code/tao_interface.f90

tao_curve_ix_uni(curve: pybmad._pybmad.TaoCurveStruct) -> int

Wrapper for Fortran routine tao_curve_ix_uni

Parameters:
Returns:
  • ix_uni( int ) –

    Universe index.

tao_curve_name

Fortran source: tao/code/tao_interface.f90

tao_curve_name(curve: pybmad._pybmad.TaoCurveStruct, use_region: bool | None = None) -> str

Wrapper for Fortran routine tao_curve_name

Parameters:
  • curve (TaoCurveStruct) –

    Curve

  • use_region (bool) –

    If present and True then use the region name instead of the plot name. Region name is 'NULL_REGION' if there is no assocaited region.

Returns:
  • curve_name( str ) –

    Appropriate name.

tao_curve_rms_calc

Fortran source: tao/code/tao_interface.f90

tao_curve_rms_calc(curve: pybmad._pybmad.TaoCurveStruct, who: str) -> pybmad._pybmad.TaoCurveRmsCalc

Wrapper for Fortran routine tao_curve_rms_calc

Parameters:
  • curve (TaoCurveStruct) –

    Curve to analyze.

  • who (str) –

    "LINE" or "SYMBOL".

Returns:
  • rms( float ) –

    RMS. -1 => Curve has no data.

  • mean( float ) –

    Mean.

tao_d2_d1_name

Fortran source: tao/code/tao_interface.f90

tao_d2_d1_name(d1: pybmad._pybmad.TaoD1DataStruct, show_universe: bool | None = None) -> str

Wrapper for Fortran routine tao_d2_d1_name

Parameters:
  • d1 (TaoD1DataStruct) –

    Data array.

  • show_universe (bool) –

    Show the datum's universe. Default is True.

Returns:
  • d2_d1_name( str ) –

    Appropriate name.

tao_d2_data_stuffit

Fortran source: tao/code/tao_init_data_mod.f90

tao_d2_data_stuffit(u: pybmad._pybmad.TaoUniverseStruct, d2_name: str, n_d1_data: typing.SupportsInt | typing.SupportsIndex) -> None

Wrapper for Fortran routine tao_d2_data_stuffit

Parameters:

tao_data_check

Fortran source: tao/code/tao_interface.f90

tao_data_check(err: bool) -> None

Wrapper for Fortran routine tao_data_check

Parameters:
  • err (bool) –

tao_data_coupling_init

Fortran source: tao/code/tao_interface.f90

tao_data_coupling_init(branch: pybmad._pybmad.BranchStruct) -> None

Wrapper for Fortran routine tao_data_coupling_init

Parameters:

tao_data_sanity_check

Fortran source: tao/code/tao_interface.f90

tao_data_sanity_check(datum: pybmad._pybmad.TaoDataStruct, print_err: bool, default_data_type: str, uni: pybmad._pybmad.TaoUniverseStruct | None = None) -> bool

Wrapper for Fortran routine tao_data_sanity_check

Parameters:
  • datum (TaoDataStruct) –

    Datum to check.

  • print_err (bool) –

    Print error message if data is not valid?

  • default_data_type (str) –

    Default data type associated with the datum's d2 structure.

  • uni (TaoUniverseStruct) –

    Universe to use instead of datum.d1.d2.ix_universe

Returns:
  • is_valid( bool ) –

    True if internally consistent.

tao_data_show_use

Fortran source: tao/code/tao_interface.f90

tao_data_show_use(d2_data: pybmad._pybmad.TaoD2DataStruct, lines: pybmad._pybmad.CharacterAlloc1D | None = None, nl: typing.SupportsInt | typing.SupportsIndex | None = None) -> None

Wrapper for Fortran routine tao_data_show_use

Parameters:

tao_data_type_substitute

Fortran source: tao/code/tao_graph_setup_mod.f90

tao_data_type_substitute(template_: str, curve: pybmad._pybmad.TaoCurveStruct, graph: pybmad._pybmad.TaoGraphStruct) -> str

Subroutine tao_data_type_substitute (template, str_out, curve, graph)

Routine substitute the appropriate data type string for instances of "#ref" and "#comp" in template.

Additionally, if template does not have a "|" character, the string "|" + component will be added at the end of str_out.

Parameters:
Returns:
  • str_out( str ) –

    String with substitutions.

tao_data_useit_plot_calc

Fortran source: tao/code/tao_graph_setup_mod.f90

tao_data_useit_plot_calc(curve: pybmad._pybmad.TaoCurveStruct, graph: pybmad._pybmad.TaoGraphStruct, data: pybmad._pybmad.TaoDataStructArray1D, check_s_position: bool) -> str

Subroutine tao_data_useit_plot_calc (curve, graph, data, check_s_position, most_invalid)

Routine to set the data for plotting.

Parameters:
  • curve (TaoCurveStruct) –

    tao_curve_struct

  • graph (TaoGraphStruct) –

    tao_graph_struct

  • data (1D array of TaoDataStruct) –
  • check_s_position (bool) –

    If present and True then veto data that does not have an s-position.

Returns:
  • most_invalid( str ) –

    String documenting biggest invalid data problem.

tao_datum_has_associated_ele

Fortran source: tao/code/tao_interface.f90

tao_datum_has_associated_ele(data_type: str, branch_geometry: typing.SupportsInt | typing.SupportsIndex | None = None) -> int

Wrapper for Fortran routine tao_datum_has_associated_ele

Parameters:
  • data_type (str) –

    Type of data.

  • branch_geometry (int) –

    Geometry of the associated lattice branch. open$ or closed$.

Returns:
  • has_associated_ele( int ) –

tao_datum_integrate

Fortran source: tao/code/tao_data_and_eval_mod.f90

tao_datum_integrate(datum: pybmad._pybmad.TaoDataStruct, branch: pybmad._pybmad.BranchStruct, s_pos: pybmad._pybmad.RealArray1D, values: pybmad._pybmad.RealArray1D) -> pybmad._pybmad.TaoDatumIntegrate

Function tao_datum_integrate (datum, branch, s_pos, values, valid_value, why_invalid) result (result)

Routine to calculate the integral, rms, or average of an array of values associated with a datum.

Parameters:
  • datum (TaoDataStruct) –

    Datum under consideration.

  • branch (BranchStruct) –

    Associated lattice branch.

  • s_pos (1D array of float) –

    Array of s-positions of the values.

  • values (1D array of float) –

    Array of values.

Returns:
  • valid_value( bool ) –

    Set false if, for example, all s_pos(:) are the same.

  • why_invalid( str ) –

    Information string if there is a problem.

  • result( float ) –

    Integral, rms, or average depending upon datum.merit_type.

tao_datum_name

Fortran source: tao/code/tao_interface.f90

tao_datum_name(datum: pybmad._pybmad.TaoDataStruct, show_universe: bool | None = None) -> str

Wrapper for Fortran routine tao_datum_name

Parameters:
  • datum (TaoDataStruct) –

    Datum

  • show_universe (bool) –

    Show the datum's universe. Default is True.

Returns:
  • datum_name( str ) –

    Appropriate name.

tao_datum_s_position

Fortran source: tao/code/tao_data_and_eval_mod.f90

tao_datum_s_position(datum: pybmad._pybmad.TaoDataStruct, ele: pybmad._pybmad.EleStruct) -> float

Function tao_datum_s_position (datum, ele) result (s_pos)

Routine to calculate the longitudinal position associated with a datum.

Parameters:
Returns:
  • s_pos( float ) –

    Associated longitudinal position.

tao_de_optimizer

Fortran source: tao/code/tao_interface.f90

tao_de_optimizer() -> bool

Wrapper for Fortran routine tao_de_optimizer

Returns:
  • abort( bool ) –

    Set True if an user stop signal detected.

tao_deallocate_plot_cache

Fortran source: tao/code/tao_struct.f90

tao_deallocate_plot_cache(plot_cache: pybmad._pybmad.TaoPlotCacheStructAlloc1D) -> None

Wrapper for Fortran routine tao_deallocate_plot_cache

Parameters:
  • plot_cache (1D array of TaoPlotCacheStruct) –

tao_deallocate_tree

Fortran source: tao/code/tao_expression_tree_mod.f90

tao_deallocate_tree(tree: pybmad._pybmad.TaoEvalNodeStruct) -> None

Subroutine tao_deallocate_tree (tree)

Routine to deallocate tree%node(:) and everything below it

Parameters:
  • tree (TaoEvalNodeStruct) –

    Root of tree to deallocate. This parameter is an input/output and is modified in-place. As an output, tree: Deallocated tree.

tao_destroy_plot_window

Fortran source: tao/code/tao_plot_window_mod.f90

tao_destroy_plot_window() -> None

Wrapper for Fortran routine tao_destroy_plot_window

tao_dmerit_calc

Fortran source: tao/code/tao_dmerit_mod.f90

tao_dmerit_calc() -> None

Subroutine tao_dmerit_calc ()

tao_dmodel_dvar_calc

Fortran source: tao/code/tao_dmerit_mod.f90

tao_dmodel_dvar_calc(force_calc: bool) -> bool

Subroutine tao_dModel_dVar_calc (force_calc, err_flag)

Subroutine to calculate the dModel_dVar derivative matrix.

Parameters:
  • force_calc (bool) –

    If true then force recalculation of the matrix. If False then only calculate matrix if it doesn't exist.

Returns:
  • err_flag( bool ) –

    Set true if there is an error. False otherwise.

tao_do_wire_scan

Fortran source: tao/code/tao_data_and_eval_mod.f90

tao_do_wire_scan(ele: pybmad._pybmad.EleStruct, theta: typing.SupportsFloat | typing.SupportsIndex, beam: pybmad._pybmad.BeamStruct) -> float

Subroutine tao_do_wire_scan (ele, wire_params, theta, beam) result (moment)

Returns the beam's second moment using the wire along the specified angle. Keep in mind that the actual correlation axis is 90 degrees off of the wire angle

This simulates a fast wire scanner that performs the scan over only one bunch. Obviously, this isn't realistic. Any dynamic effects will not be accounted for!

Parameters:
  • ele (EleStruct) –
  • theta (float) –

    wire angle wrt x axis (in degrees)

  • beam (BeamStruct) –

    contains the beam distribution

Returns:
  • moment( float ) –

    second moment along axis specified by angle.

tao_draw_beam_chamber_wall

Fortran source: tao/code/tao_plot_mod.f90

tao_draw_beam_chamber_wall(plot: pybmad._pybmad.TaoPlotStruct, graph: pybmad._pybmad.TaoGraphStruct) -> None

NOTE: THIS ROUTINE IS NOT CURRENTLY ACITVE (NOT CALLED BY ANY OTHER ROUTINE).

Subroutine tao_draw_beam_chamber_wall (plot, graph)

Routine to draw the beam chamber wall.

Parameters:

tao_draw_curve_data

Fortran source: tao/code/tao_plot_mod.f90

tao_draw_curve_data(plot: pybmad._pybmad.TaoPlotStruct, graph: pybmad._pybmad.TaoGraphStruct, curve: pybmad._pybmad.TaoCurveStruct, have_data: bool) -> pybmad._pybmad.TaoDrawCurveData

Subroutine tao_draw_curve_data (plot, graph, curve, have_data)

Routine to draw a graph with data and/or variable curves.

Parameters:
  • plot (TaoPlotStruct) –

    Plot containing the graph.

  • graph (TaoGraphStruct) –

    Graph containing the curve.

  • curve (TaoCurveStruct) –

    Curve to draw.

  • have_data (bool) –

    Intitial state. This parameter is an input/output and is modified in-place. As an output, have_data: Is there any data to plot? Set True if so.

Returns:
  • have_data( bool ) –

    Intitial state. This parameter is an input/output and is modified in-place. As an output, have_data: Is there any data to plot? Set True if so.

tao_draw_ele_for_floor_plan

Fortran source: tao/code/tao_plot_mod.f90

tao_draw_ele_for_floor_plan(plot: pybmad._pybmad.TaoPlotStruct, graph: pybmad._pybmad.TaoGraphStruct, tao_lat: pybmad._pybmad.TaoLatticeStruct, ele: pybmad._pybmad.EleStruct, ele_shape: pybmad._pybmad.TaoEleShapeStruct, label_name: str, offset1: typing.SupportsFloat | typing.SupportsIndex, offset2: typing.SupportsFloat | typing.SupportsIndex) -> None

Subroutine tao_draw_ele_for_floor_plan (plot, graph, tao_lat, ele, ele_shape, label_name, offset1, offset2)

Routine to draw one lattice element or one datum location for the floor plan graph.

Parameters:
  • plot (TaoPlotStruct) –

    Plot containing the graph.

  • graph (TaoGraphStruct) –

    Graph to plot.

  • tao_lat (TaoLatticeStruct) –

    Lattice containing the element.

  • ele (EleStruct) –

    Element to draw.

  • ele_shape (TaoEleShapeStruct) –

    Shape to draw from s.plot_page.floor_plan.ele_shape(:) array. Will be NULL if no associated shape for this element.

  • label_name (str) –

    Shape label.

  • offset1 (float) –

    Transverse distances used to scale the drawing of the element shape.

  • offset2 (float) –

    Transverse distances used to scale the drawing of the element shape.

tao_draw_floor_plan

Fortran source: tao/code/tao_plot_mod.f90

tao_draw_floor_plan(plot: pybmad._pybmad.TaoPlotStruct, graph: pybmad._pybmad.TaoGraphStruct) -> None

Subroutine tao_draw_floor_plan (plot, graph)

Routine to draw a floor plan graph.

Parameters:

tao_draw_graph_axes

Fortran source: tao/code/tao_plot_mod.f90

tao_draw_graph_axes(plot: pybmad._pybmad.TaoPlotStruct, graph: pybmad._pybmad.TaoGraphStruct) -> None

Subroutine tao_draw_graph_axes (plot, graph)

Routine to draw a just the graph part of a data graph. The calling routine takes care of drawing any curves.

Parameters:

tao_draw_histogram_data

Fortran source: tao/code/tao_plot_mod.f90

tao_draw_histogram_data(plot: pybmad._pybmad.TaoPlotStruct, graph: pybmad._pybmad.TaoGraphStruct, curve: pybmad._pybmad.TaoCurveStruct, have_data: bool) -> pybmad._pybmad.TaoDrawHistogramData

Subroutine tao_draw_histogram_data (plot, graph, curve, have_data)

Routine to draw a graph with data and/or variable histograms.

Parameters:
  • plot (TaoPlotStruct) –

    Plot containing the graph.

  • graph (TaoGraphStruct) –

    Graph containing the histogram.

  • curve (TaoCurveStruct) –

    Histogram to draw.

  • have_data (bool) –

    Intitial state. This parameter is an input/output and is modified in-place. As an output, have_data: Is there any data to plot? Set True if so.

Returns:
  • have_data( bool ) –

    Intitial state. This parameter is an input/output and is modified in-place. As an output, have_data: Is there any data to plot? Set True if so.

tao_draw_lat_layout

Fortran source: tao/code/tao_plot_mod.f90

tao_draw_lat_layout(plot: pybmad._pybmad.TaoPlotStruct, graph: pybmad._pybmad.TaoGraphStruct) -> None

Subroutine tao_draw_lat_layout (plot, graph)

Routine to draw a lattice layout graph.

Parameters:

tao_draw_plots

Fortran source: tao/code/tao_plot_mod.f90

tao_draw_plots(do_clear: bool | None = None) -> None

Subroutine tao_draw_plots (do_clear)

Subroutine to draw the plots on the plot window.

Parameters:
  • do_clear (bool) –

    If present and False then call qp_clear_page. This argument is used when drawing PS or GIF.

tao_ele_geometry_with_misalignments

Fortran source: tao/code/tao_data_and_eval_mod.f90

tao_ele_geometry_with_misalignments(datum: pybmad._pybmad.TaoDataStruct, ele: pybmad._pybmad.EleStruct) -> pybmad._pybmad.TaoEleGeometryWithMisalignments

Function tao_ele_geometry_with_misalignments (datum, ele, valid_value, why_invalid) result (value)

Routine to evaluate a floor position with misalignments at a given element. This routine is private and not for general use.

Parameters:
Returns:
  • valid_value( bool ) –

    Was able to evalute the datum?

  • why_invalid( str ) –

    If not valid, why not.

  • value( float ) –

    Datum value.

tao_ele_shape_info

Fortran source: tao/code/tao_interface.f90

tao_ele_shape_info(ix_uni: typing.SupportsInt | typing.SupportsIndex, ele: pybmad._pybmad.EleStruct, ele_shapes: pybmad._pybmad.TaoEleShapeStructArray1D, ix_shape_min: typing.SupportsInt | typing.SupportsIndex | None = None) -> pybmad._pybmad.TaoEleShapeInfo

Wrapper for Fortran routine tao_ele_shape_info

Parameters:
  • ix_uni (int) –

    Universe index.

  • ele (EleStruct) –

    Lattice element.

  • ele_shapes (1D array of TaoEleShapeStruct) –

    Array of shapes to search.

  • ix_shape_min (int) –

    Index of minimum ele_shape(:) index to start search from. Default is 1. This parameter is an input/output and is modified in-place. As an output, ix_shape_min: Ele_shape(

Returns:
  • label_name( str ) –

    Label name.

  • y1( float ) –

    shape transverse sizes.

  • y2( float ) –

    shape transverse sizes.

  • e_shape( (TaoEleShapeStruct, optional) ) –

    element shape. Will be nullified if no associated shape.

  • ix_shape_min( (int, optional) ) –

    Index of minimum ele_shape(:) index to start search from. Default is 1. This parameter is an input/output and is modified in-place. As an output, ix_shape_min: Ele_shape(

tao_eval_floor_orbit

Fortran source: tao/code/tao_data_and_eval_mod.f90

tao_eval_floor_orbit(datum: pybmad._pybmad.TaoDataStruct, ele: pybmad._pybmad.EleStruct, orbit: pybmad._pybmad.CoordStruct, bunch_params: pybmad._pybmad.BunchParamsStruct) -> pybmad._pybmad.TaoEvalFloorOrbit

Function tao_eval_floor_orbit (datum, ele, orbit, bunch_params, valid_value, why_invalid) result (value)

Routine to evaluate a floor_orbit datum at a given element. This routine is private and not for general use.

Parameters:
Returns:
  • valid_value( bool ) –

    Was able to evalute the datum?

  • why_invalid( str ) –

    If not valid, why not.

  • value( float ) –

    Datum value.

tao_evaluate_a_datum

Fortran source: tao/code/tao_interface.f90

tao_evaluate_a_datum(datum: pybmad._pybmad.TaoDataStruct, u: pybmad._pybmad.TaoUniverseStruct, tao_lat: pybmad._pybmad.TaoLatticeStruct, called_from_lat_calc: bool | None = None, print_err: bool | None = None) -> pybmad._pybmad.TaoEvaluateADatum

Wrapper for Fortran routine tao_evaluate_a_datum

Parameters:
  • datum (TaoDataStruct) –

    What type of datum

  • u (TaoUniverseStruct) –

    Which universe to use.

  • tao_lat (TaoLatticeStruct) –

    Lattice to use.

  • called_from_lat_calc (bool) –

    Default is False. If true, prevents infinite loop of this routine calling tao_lattice_calc

  • print_err (bool) –

    Default is True. If False, do not print an error message.

Returns:
  • datum_value( float ) –

    Value of the datum.

  • valid_value( bool ) –

    Set false when there is a problem. Set true otherwise.

  • why_invalid( (str, optional) ) –

    Tells why datum value is invalid.

tao_evaluate_datum_at_s

Fortran source: tao/code/tao_data_and_eval_mod.f90

tao_evaluate_datum_at_s(datum: pybmad._pybmad.TaoDataStruct, tao_lat: pybmad._pybmad.TaoLatticeStruct, ele: pybmad._pybmad.EleStruct, ele_ref: pybmad._pybmad.EleStruct, valid_value: bool) -> pybmad._pybmad.TaoEvaluateDatumAtS

Function tao_evaluate_datum_at_s (datum, tao_lat, ele, ele_ref, valid_value, err_str, bad_datum) result(value)

Routine to evaluate a datum at a given s-position in the lattice

Parameters:
Returns:
  • err_str( str ) –

    Error string for printing an error message.

  • bad_datum( bool ) –

    True -> datum is malformed. False -> Could evaluate or evaluation problem was not due to the datum itself (EG: the lattice was unstable).

  • value( float ) –

    Datum value.

tao_evaluate_element_parameters

Fortran source: tao/code/tao_interface.f90

tao_evaluate_element_parameters(param_name: str, print_err: bool, dflt_source: str, dflt_ele: pybmad._pybmad.EleStruct | None = None, dflt_component: str | None = None, dflt_uni: typing.SupportsInt | typing.SupportsIndex | None = None, eval_point: typing.SupportsInt | typing.SupportsIndex | None = None) -> pybmad._pybmad.TaoEvaluateElementParameters

Wrapper for Fortran routine tao_evaluate_element_parameters

Parameters:
  • param_name (str) –

    parameter name.

  • print_err (bool) –

    Print error message?

  • dflt_source (str) –

    Default source

  • dflt_ele (EleStruct) –

    Default element if not specified by param_name.

  • dflt_component (str) –

    Default component

  • dflt_uni (int) –

    Default universe to use.

  • eval_point (int) –
Returns:
  • err( bool ) –

    True if there is an error in syntax. False otherwise

  • values( 1D array of float ) –

    Array of datum values.

  • info( 1D array of TaoExpressionInfoStruct, optional ) –

tao_evaluate_expression

Fortran source: tao/code/tao_interface.f90

tao_evaluate_expression(expression: str, n_size: typing.SupportsInt | typing.SupportsIndex, use_good_user: bool, print_err: bool | None = None, dflt_component: str | None = None, dflt_source: str | None = None, dflt_ele_ref: pybmad._pybmad.EleStruct | None = None, dflt_ele_start: pybmad._pybmad.EleStruct | None = None, dflt_ele: pybmad._pybmad.EleStruct | None = None, dflt_dat_or_var_index: str | None = None, dflt_uni: typing.SupportsInt | typing.SupportsIndex | None = None, dflt_eval_point: typing.SupportsInt | typing.SupportsIndex | None = None, dflt_s_offset: typing.SupportsFloat | typing.SupportsIndex | None = None, dflt_orbit: pybmad._pybmad.CoordStruct | None = None, datum: pybmad._pybmad.TaoDataStruct | None = None) -> pybmad._pybmad.TaoEvaluateExpression

Wrapper for Fortran routine tao_evaluate_expression

Parameters:
  • expression (str) –

    Arithmetic expression.

  • n_size (int) –

    Size of the value array. If the expression evaluates to a a scalar, each value in the value array will get this value. If n_size = 0, the natural size is determined by the expression itself.

  • use_good_user (bool) –

    Use the good_user logical in evaluating good(:)

  • print_err (bool) –

    If False then supress evaluation error messages. This does not affect syntax error messages. Default is True.

  • dflt_component (str) –

    Component to use if not specified in the expression. 'model' (default), 'base', or 'design'.

  • dflt_source (str) –

    Default source ('lat', 'data', etc.). Default is ''.

  • dflt_ele_ref (EleStruct) –

    Default reference element.

  • dflt_ele_start (EleStruct) –

    Default start element for ranges.

  • dflt_ele (EleStruct) –

    Default element to evaluate at.

  • dflt_dat_or_var_index (str) –

    Default datum or variable index to use.

  • dflt_uni (int) –

    Default universe to use. If 0 or not present, use viewed universe.

  • dflt_eval_point (int) –

    Default eval_point. anchor_end$ (default), anchor_center\(, or anchor_beginning\).

  • dflt_s_offset (float) –

    Default offset of eval_point. Default = 0.

  • dflt_orbit (CoordStruct) –

    Default orbit to evaluate at.

  • datum (TaoDataStruct) –

    If present, check to see that the expression does not depend upon a datum that will be evaluated after this datum. If so, this is an error.

Returns:
  • value( 1D array of float ) –

    Value of arithmetic expression.

  • err_flag( bool ) –

    True on an error. EG: Invalid expression. A divide by zero is not an error but good(:) will be set to False.

  • info( 1D array of TaoExpressionInfoStruct, optional ) –

    Is the value valid?, etc. Example: 'orbit.x[23]|meas' is not good if orbit.x[23]|good_meas or orbit.x[23]|good_user is False.

  • stack( 1D array of TaoEvalNodeStruct, optional ) –

    Array of nodes of variable names. This is useful to check what datums or variables are used in the expression.

tao_evaluate_expression_new

Fortran source: tao/code/tao_interface.f90

tao_evaluate_expression_new(expression: str, n_size: typing.SupportsInt | typing.SupportsIndex, use_good_user: bool, print_err: bool | None = None, dflt_component: str | None = None, dflt_source: str | None = None, dflt_ele_ref: pybmad._pybmad.EleStruct | None = None, dflt_ele_start: pybmad._pybmad.EleStruct | None = None, dflt_ele: pybmad._pybmad.EleStruct | None = None, dflt_dat_or_var_index: str | None = None, dflt_uni: typing.SupportsInt | typing.SupportsIndex | None = None, dflt_eval_point: typing.SupportsInt | typing.SupportsIndex | None = None, dflt_s_offset: typing.SupportsFloat | typing.SupportsIndex | None = None, dflt_orbit: pybmad._pybmad.CoordStruct | None = None, datum: pybmad._pybmad.TaoDataStruct | None = None) -> pybmad._pybmad.TaoEvaluateExpressionNew

Wrapper for Fortran routine tao_evaluate_expression_new

Parameters:
  • expression (str) –

    Arithmetic expression.

  • n_size (int) –

    Size of the value array. If the expression evaluates to a a scalar, each value in the value array will get this value. If n_size = 0, the natural size is determined by the expression itself.

  • use_good_user (bool) –

    Use the good_user logical in evaluating good(:)

  • print_err (bool) –

    If False then supress evaluation error messages. This does not affect syntax error messages. Default is True.

  • dflt_component (str) –

    Component to use if not specified in the expression. 'model' (default), 'base', or 'design'.

  • dflt_source (str) –

    Default source ('lat', 'data', etc.). Default is ''.

  • dflt_ele_ref (EleStruct) –

    Default reference element.

  • dflt_ele_start (EleStruct) –

    Default start element for ranges.

  • dflt_ele (EleStruct) –

    Default element to evaluate at.

  • dflt_dat_or_var_index (str) –

    Default datum or variable index to use.

  • dflt_uni (int) –

    Default universe to use. If 0 or not present, use viewed universe.

  • dflt_eval_point (int) –

    Default eval_point. anchor_end$ (default), anchor_center\(, or anchor_beginning\).

  • dflt_s_offset (float) –

    Default offset of eval_point. Default = 0.

  • dflt_orbit (CoordStruct) –

    Default orbit to evaluate at.

  • datum (TaoDataStruct) –

    If present, check to see that the expression does not depend upon a datum that will be evaluated after this datum. If so, this is an error.

Returns:
  • value( 1D array of float ) –

    Value of arithmetic expression.

  • err_flag( bool ) –

    True on an error. EG: Invalid expression. A divide by zero is not an error but good(:) will be set to False.

  • info( 1D array of TaoExpressionInfoStruct, optional ) –

    Is the value valid?, etc. Example: 'orbit.x[23]|meas' is not good if orbit.x[23]|good_meas or orbit.x[23]|good_user is False.

  • stack( 1D array of TaoEvalNodeStruct, optional ) –

    Array of nodes of variable names. This is useful to check what datums or variables are used in the expression.

tao_evaluate_expression_old

Fortran source: tao/code/tao_interface.f90

tao_evaluate_expression_old(expression: str, n_size: typing.SupportsInt | typing.SupportsIndex, use_good_user: bool, print_err: bool | None = None, dflt_component: str | None = None, dflt_source: str | None = None, dflt_ele_ref: pybmad._pybmad.EleStruct | None = None, dflt_ele_start: pybmad._pybmad.EleStruct | None = None, dflt_ele: pybmad._pybmad.EleStruct | None = None, dflt_dat_or_var_index: str | None = None, dflt_uni: typing.SupportsInt | typing.SupportsIndex | None = None, dflt_eval_point: typing.SupportsInt | typing.SupportsIndex | None = None, dflt_s_offset: typing.SupportsFloat | typing.SupportsIndex | None = None, dflt_orbit: pybmad._pybmad.CoordStruct | None = None, datum: pybmad._pybmad.TaoDataStruct | None = None) -> pybmad._pybmad.TaoEvaluateExpressionOld

Wrapper for Fortran routine tao_evaluate_expression_old

Parameters:
  • expression (str) –

    Arithmetic expression.

  • n_size (int) –

    Size of the value array. If the expression evaluates to a a scalar, each value in the value array will get this value. If n_size = 0, the natural size is determined by the expression itself.

  • use_good_user (bool) –

    Use the good_user logical in evaluating good(:)

  • print_err (bool) –

    If False then supress evaluation error messages. This does not affect syntax error messages. Default is True.

  • dflt_component (str) –

    Component to use if not specified in the expression. 'model' (default), 'base', or 'design'.

  • dflt_source (str) –

    Default source ('lat', 'data', etc.). Default is ''.

  • dflt_ele_ref (EleStruct) –

    Default reference element.

  • dflt_ele_start (EleStruct) –

    Default start element for ranges.

  • dflt_ele (EleStruct) –

    Default element to evaluate at.

  • dflt_dat_or_var_index (str) –

    Default datum or variable index to use.

  • dflt_uni (int) –

    Default universe to use. If 0 or not present, use viewed universe.

  • dflt_eval_point (int) –

    Default eval_point. anchor_end$ (default), anchor_center\(, or anchor_beginning\).

  • dflt_s_offset (float) –

    Default offset of eval_point. Default = 0.

  • dflt_orbit (CoordStruct) –

    Default orbit to evaluate at.

  • datum (TaoDataStruct) –

    If present, check to see that the expression does not depend upon a datum that will be evaluated after this datum. If so, this is an error.

Returns:
  • value( 1D array of float ) –

    Value of arithmetic expression.

  • err_flag( bool ) –

    True on an error. EG: Invalid expression. A divide by zero is not an error but good(:) will be set to False.

  • info( 1D array of TaoExpressionInfoStruct, optional ) –

    Is the value valid?, etc. Example: 'orbit.x[23]|meas' is not good if orbit.x[23]|good_meas or orbit.x[23]|good_user is False.

  • stack( 1D array of TaoEvalNodeStruct, optional ) –

    Array of nodes of variable names. This is useful to check what datums or variables are used in the expression.

tao_evaluate_lat_or_beam_data

Fortran source: tao/code/tao_data_and_eval_mod.f90

tao_evaluate_lat_or_beam_data(data_name: str, print_err: bool, default_source: str, dflt_ele_ref: pybmad._pybmad.EleStruct | None = None, dflt_ele_start: pybmad._pybmad.EleStruct | None = None, dflt_ele: pybmad._pybmad.EleStruct | None = None, dflt_component: str | None = None, dflt_uni: typing.SupportsInt | typing.SupportsIndex | None = None, dflt_eval_point: typing.SupportsInt | typing.SupportsIndex | None = None, dflt_s_offset: typing.SupportsFloat | typing.SupportsIndex | None = None) -> pybmad._pybmad.TaoEvaluateLatOrBeamData

! private tao_scratch_values_calc, tao_eval_floor_orbit, tao_ele_geometry_with_misalignments

Subroutine tao_evaluate_lat_or_beam_data (err, data_name, values, print_err, default_source, default_source, dflt_ele_ref, dflt_ele_start, dflt_ele, dflt_component, dflt_uni, dflt_eval_point, dflt_s_offset)

Routine to evaluate data with a lat or beam source of the form: @lat::[&]|

Parameters:
  • data_name (str) –

    data name.

  • print_err (bool) –

    Print error message?

  • dflt_ele_ref (EleStruct) –

    Default reference element.

  • dflt_ele_start (EleStruct) –

    Default start element.

  • dflt_ele (EleStruct) –

    Default element to evaluate at.

  • dflt_component (str) –

    Default component: 'model' (default), 'base', or 'design'.

  • dflt_uni (int) –

    Default universe to use.

  • dflt_eval_point (int) –

    Default eval_point. anchor_end$ (default), anchor_center\(, or anchor_beginning\).

  • dflt_s_offset (float) –

    Default offset of eval_point. Default = 0.

Returns:
  • err( bool ) –

    True if there is an error. False otherwise.

  • values( 1D array of float ) –

    Array of datum valuse.

tao_evaluate_stack_old

Fortran source: tao/code/tao_data_and_eval_mod.f90

tao_evaluate_stack_old(stack: pybmad._pybmad.TaoEvalNodeStructArray1D, n_size_in: typing.SupportsInt | typing.SupportsIndex, use_good_user: bool, print_err: bool, expression: str, info_in: pybmad._pybmad.TaoExpressionInfoStructAlloc1D | None = None) -> pybmad._pybmad.TaoEvaluateStackOld

Subroutine tao_evaluate_stack_old (stack, n_size_in, use_good_user, value, info, err_flag, print_err, expression)

Routine to evaluate an expression stack.

Parameters:
  • stack (1D array of TaoEvalNodeStruct) –

    Expression stack

  • n_size_in (int) –

    Desired array size. If the expression evaluates to a a scalar, each value in the value array will get this value. If n_size = 0, the natural size is determined by the expression itself.

  • use_good_user (bool) –

    Use the good_user logical in evaluating good(:)

  • print_err (bool) –

    If False then supress evaluation error messages. This does not affect syntax error messages. Default is True.

  • expression (str) –

    Original expression. Used for error messages.

Returns:
  • value( 1D array of float ) –

    Value of arithmetic expression.

  • err_flag( bool ) –

    True on error. False otherwise

tao_evaluate_tree

Fortran source: tao/code/tao_interface.f90

tao_evaluate_tree(tao_tree: pybmad._pybmad.TaoEvalNodeStruct, n_size: typing.SupportsInt | typing.SupportsIndex, use_good_user: bool, print_err: bool, expression: str, info_in: pybmad._pybmad.TaoExpressionInfoStructAlloc1D | None = None) -> pybmad._pybmad.TaoEvaluateTree

Wrapper for Fortran routine tao_evaluate_tree

Parameters:
  • tao_tree (TaoEvalNodeStruct) –

    Expression tree

  • n_size (int) –
  • use_good_user (bool) –

    Use the good_user logical in evaluating good(:)

  • print_err (bool) –

    If False then supress evaluation error messages. This does not affect syntax error messages. Default is True.

  • expression (str) –

    Original expression. Used for error messages.

  • info_in (1D array of TaoExpressionInfoStruct) –
Returns:
  • value( 1D array of float ) –

    Value(s) of the arithmetic expression.

  • err_flag( bool ) –

    True on error. False otherwise

tao_evaluate_tune

Fortran source: tao/code/tao_interface.f90

tao_evaluate_tune(q_str: str, q0: typing.SupportsFloat | typing.SupportsIndex, delta_input: bool) -> float

Wrapper for Fortran routine tao_evaluate_tune

Parameters:
  • q_str (str) –

    String expression.

  • q0 (float) –

    Default to use if q_str evaluates to zero. Also used to set the integer part of the tune.

  • delta_input (bool) –

    If true then qa_str and qb_str are deltas from present tune.

Returns:
  • q_val( float ) –

    Tune value. Set zero if there is an error.

tao_expression_hash_substitute

Fortran source: tao/code/tao_data_and_eval_mod.f90

tao_expression_hash_substitute(expression_in: str, eval_ele: pybmad._pybmad.EleStruct | None = None) -> str

Subroutine tao_expression_hash_substitute(expression_in, expression_out, eval_ele)

Routine to, in the expression, substitute the evaluation lattice element name in place of hash ("#") characters. Care is taken to only do this where it makes sense. For example, "Q1##3" where here "##3" means the third instance of Q1, does not qualify.

Specifically, a substitution will be done if the character before the hash and the character after are one of: [,]-*+/:|@<>, or a blank character, or the beginning or end of the expression

Parameters:
  • expression_in (str) –

    Expression.

  • eval_ele (EleStruct) –

    Evaluation element name to substitute in. If not present, expression will not be modified.

Returns:
  • expression_out( str ) –

    Expression with substitutions made.

tao_expression_tree_to_string

Fortran source: tao/code/tao_expression_tree_mod.f90

tao_expression_tree_to_string(tree: pybmad._pybmad.TaoEvalNodeStruct, include_root: bool | None = None, n_node: typing.SupportsInt | typing.SupportsIndex | None = None, parent: pybmad._pybmad.TaoEvalNodeStruct | None = None) -> str

Function tao_expression_tree_to_string (tree, include_root, n_node, parent) result(str_out)

Routine to convert an expression tree to a expression string.

Parameters:
  • tree (TaoEvalNodeStruct) –

    Tree to print.

  • include_root (bool) –

    Default is True. If True, do not inculde in the output string the root node. Note: If the root node is of type root$, this node is always ignored.

  • n_node (int) –

    Internal use only. Used with recursive calls.

  • parent (TaoEvalNodeStruct) –

    Internal use only. Used with recusive calls.

Returns:
  • str_out( str ) –

    Expression string.

tao_find_plot_region

Fortran source: tao/code/tao_interface.f90

tao_find_plot_region(where: str, print_flag: bool | None = None) -> pybmad._pybmad.TaoFindPlotRegion

Wrapper for Fortran routine tao_find_plot_region

Parameters:
  • where (str) –

    Region name.

  • print_flag (bool) –

    If present and False then surpress error messages. Default is True.

Returns:
  • err( bool ) –

    Set True on error. False otherwise.

  • region( (TaoPlotRegionStruct, optional) ) –

    Region found.

tao_fixer

Fortran source: tao/code/tao_interface.f90

tao_fixer(switch_: str, word1: str, word2: str) -> None

Wrapper for Fortran routine tao_fixer

Parameters:
  • word1 (str) –

    First word of command.

  • word2 (str) –

    Secton word of command.

tao_floor_to_screen

Fortran source: tao/code/tao_interface.f90

tao_floor_to_screen(graph: pybmad._pybmad.TaoGraphStruct, r_floor: typing.Annotated[collections.abc.Sequence[typing.SupportsFloat | typing.SupportsIndex], "FixedSize(3)"]) -> pybmad._pybmad.TaoFloorToScreen

Wrapper for Fortran routine tao_floor_to_screen

Parameters:
  • graph (TaoGraphStruct) –

    Graph defining the projection plane.

  • r_floor (1D array of float (shape: 3)) –
Returns:
  • x_screen( float ) –

    x-coordinate of projected point.

  • y_screen( float ) –

    y-coordinate of projected point.

tao_floor_to_screen_coords

Fortran source: tao/code/tao_interface.f90

tao_floor_to_screen_coords(graph: pybmad._pybmad.TaoGraphStruct, floor: pybmad._pybmad.FloorPositionStruct) -> pybmad._pybmad.FloorPositionStruct

Wrapper for Fortran routine tao_floor_to_screen_coords

Parameters:
Returns:

tao_geodesic_lm_optimizer

Fortran source: tao/code/tao_geodesic_lm_optimizer_mod.f90

tao_geodesic_lm_optimizer() -> bool

Subroutine tao_geodesic_lm_optimizer (abort)

Routine to minimize the merit function by varying variables until the "data" as calculated from the model matches the measured data.

This subroutine is a wrapper for the "geodesic" Levenburg - Marquardt method.

Returns:
  • abort( bool ) –

    Set True if an user stop signal detected.

tao_get_data

Fortran source: tao/code/tao_data_and_eval_mod.f90

tao_get_data() -> pybmad._pybmad.TaoGetData

Subroutine tao_get_data (data_value, data_weight, data_meas_value, dat_ix_dModel)

Subroutine to get the values of the data used in optimization and put them in an array. The data is ordered starting with the first universe

Returns:
  • data_value( 1D array of float, optional ) –

    Data model values.

  • data_weight( 1D array of float, optional ) –

    Data weights in the merit function.

  • data_meas_value( 1D array of float, optional ) –

    Data values when the data was taken.

  • data_ix_dModel( 1D array of int, optional ) –

    Data ix_dModel indices

tao_get_opt_vars

Fortran source: tao/code/tao_interface.f90

tao_get_opt_vars() -> pybmad._pybmad.TaoGetOptVars

Wrapper for Fortran routine tao_get_opt_vars

Returns:
  • var_value( 1D array of float, optional ) –

    Variable model values.

  • var_step( 1D array of float, optional ) –

    Variable step sizes.

  • var_delta( 1D array of float, optional ) –

    Variable Merit deltas.

  • var_weight( 1D array of float, optional ) –

    Variable weights in the merit function.

  • var_ix( 1D array of int, optional ) –

    Variable s.var(:) indexes

  • ignore_if_weight_is_zero( (bool, optional) ) –

    If present and True then ignore all variables whose merit weight is zero.

  • ignore_if_not_limited( (bool, optional) ) –

    If present and True then ignore all variables with limit constraint that are not limited.

tao_get_user_input

Fortran source: tao/code/tao_get_user_input_mod.f90

tao_get_user_input(prompt_str: str | None = None, wait_flag: bool | None = None, cmd_in: str | None = None) -> str

Subroutine tao_get_user_input (cmd_out, prompt_str, wait_flag, cmd_in)

Subroutine to get the next Tao command. In order of precedence, input may come from: 1) s%com%cmd string (if s%com%use_cmd_here is set to True). Used for recalling commands from the history stack. 3) A command file. 4) The cmd_in argument (if present). Used, for example, when interfacing with Python. 5) The terminal.

Note: A saved command string is present if a prior input string contained multiple commands. For example, the following string is read from a command file or terminal or passed via cmd_in: "show ele 1; set opti de; run" Then cmd_out would be "show ele 1" and "set opti de; run" would be saved for the next call to this routine.

Note: In single character mode, the input precedence order is ignored and input is taken from the terminal.

Parameters:
  • prompt_str (str) –

    Primpt string to print at terminal. If not present then s.global.prompt_string will be used.

  • wait_flag (bool) –

    Used for single mode: Wait state for get_a_char call.

  • cmd_in (str) –

    Command to be used in place getting user input.

Returns:
  • cmd_out( str ) –

    Command from the user.

tao_graph_controller_setup

Fortran source: tao/code/tao_graph_setup_mod.f90

tao_graph_controller_setup(graph: pybmad._pybmad.TaoGraphStruct) -> None

Wrapper for Fortran routine tao_graph_controller_setup

Parameters:

tao_graph_data_setup

Fortran source: tao/code/tao_graph_setup_mod.f90

tao_graph_data_setup(plot: pybmad._pybmad.TaoPlotStruct, graph: pybmad._pybmad.TaoGraphStruct) -> None

Wrapper for Fortran routine tao_graph_data_setup

Parameters:

tao_graph_data_slice_setup

Fortran source: tao/code/tao_graph_setup_mod.f90

tao_graph_data_slice_setup(plot: pybmad._pybmad.TaoPlotStruct, graph: pybmad._pybmad.TaoGraphStruct) -> None

Wrapper for Fortran routine tao_graph_data_slice_setup

Parameters:

tao_graph_dynamic_aperture_setup

Fortran source: tao/code/tao_graph_setup_mod.f90

tao_graph_dynamic_aperture_setup(plot: pybmad._pybmad.TaoPlotStruct, graph: pybmad._pybmad.TaoGraphStruct) -> None

Wrapper for Fortran routine tao_graph_dynamic_aperture_setup

Parameters:

tao_graph_histogram_setup

Fortran source: tao/code/tao_graph_setup_mod.f90

tao_graph_histogram_setup(plot: pybmad._pybmad.TaoPlotStruct, graph: pybmad._pybmad.TaoGraphStruct) -> None

Wrapper for Fortran routine tao_graph_histogram_setup

Parameters:

tao_graph_name

Fortran source: tao/code/tao_interface.f90

tao_graph_name(graph: pybmad._pybmad.TaoGraphStruct, use_region: bool | None = None) -> str

Wrapper for Fortran routine tao_graph_name

Parameters:
  • graph (TaoGraphStruct) –

    Graph

  • use_region (bool) –

    If present and True then use the region name instead of the plot name. Region name is 'NULL_REGION' if there is no assocaited region.

Returns:
  • graph_name( str ) –

    Appropriate name.

tao_graph_phase_space_setup

Fortran source: tao/code/tao_graph_setup_mod.f90

tao_graph_phase_space_setup(plot: pybmad._pybmad.TaoPlotStruct, graph: pybmad._pybmad.TaoGraphStruct) -> None

Wrapper for Fortran routine tao_graph_phase_space_setup

Parameters:

tao_graph_s_min_max_calc

Fortran source: tao/code/tao_graph_setup_mod.f90

tao_graph_s_min_max_calc(graph: pybmad._pybmad.TaoGraphStruct, branch: pybmad._pybmad.BranchStruct) -> pybmad._pybmad.TaoGraphSMinMaxCalc

Subroutine tao_graph_s_min_max_calc(graph, branch, s_min, s_max)

Routine to calculate min and max for a graph when plot%x_axis_type is set to "s".

Parameters:
Returns:
  • s_min( float ) –

    Graph min. May be negative with graph.allow_wrap_around = T.

  • s_max( float ) –

    Graph max.

tao_graph_setup

Fortran source: tao/code/tao_graph_setup_mod.f90

tao_graph_setup(plot: pybmad._pybmad.TaoPlotStruct, graph: pybmad._pybmad.TaoGraphStruct) -> None

Wrapper for Fortran routine tao_graph_setup

Parameters:

tao_help

Fortran source: tao/code/tao_interface.f90

tao_help(what1: str, what2: str) -> pybmad._pybmad.TaoHelp

Wrapper for Fortran routine tao_help

Parameters:
  • what1 (str) –

    command to query. EG: "show".

  • what2 (str) –

    subcommand to query. EG: "element".

Returns:
  • lines( 1D array of str, optional ) –

    If present then the output will be put in this string array instead of printing to the terminal.

  • n_lines( (int, optional) ) –

    Must be present if lines is present. Number of lines used in the lines(:) array.

tao_init

Fortran source: tao/code/tao_interface.f90

tao_init() -> bool

Wrapper for Fortran routine tao_init

Returns:
  • err_flag( bool ) –

    Set Treu if there is an error. False otherwise.

tao_init_beam_in_universe

Fortran source: tao/code/tao_init_mod.f90

tao_init_beam_in_universe(u: pybmad._pybmad.TaoUniverseStruct, beam_init: pybmad._pybmad.BeamInitStruct, track_start: str, track_end: str, comb_ds_save: typing.SupportsFloat | typing.SupportsIndex) -> None

Wrapper for Fortran routine tao_init_beam_in_universe

Parameters:

tao_init_beams

Fortran source: tao/code/tao_init_mod.f90

tao_init_beams(init_file: str) -> None

Subroutine tao_init_beams (init_file)

Subroutine to initialize beam stuff.

Parameters:
  • init_file (str) –

    Tao initialization file. If blank, there is no file so just use the defaults.

tao_init_data

Fortran source: tao/code/tao_init_data_mod.f90

tao_init_data(data_file: str) -> None

Subroutine tao_init_data (data_file)

Subroutine to initialize the tao data structures.

Parameters:
  • data_file (str) –

    Tao data initialization file. If blank, there is no file so just use the defaults.

tao_init_data_end_stuff

Fortran source: tao/code/tao_init_data_mod.f90

tao_init_data_end_stuff() -> None

Wrapper for Fortran routine tao_init_data_end_stuff

tao_init_data_in_universe

Fortran source: tao/code/tao_init_data_mod.f90

tao_init_data_in_universe(u: pybmad._pybmad.TaoUniverseStruct, n_d2_add: typing.SupportsInt | typing.SupportsIndex, keep_existing_data: bool | None = None) -> None

Wrapper for Fortran routine tao_init_data_in_universe

Parameters:

tao_init_dynamic_aperture

Fortran source: tao/code/tao_init_mod.f90

tao_init_dynamic_aperture(init_file: str) -> None

Subroutine tao_init_dynamic_aperture (init_file)

Routine to initalize dynamic aperture simulations.

Parameters:
  • init_file (str) –

    File setting dynamic_aperture parameters.

tao_init_find_elements

Fortran source: tao/code/tao_interface.f90

tao_init_find_elements(u: pybmad._pybmad.TaoUniverseStruct, search_string: str, attribute: str | None = None) -> pybmad._pybmad.TaoInitFindElements

Wrapper for Fortran routine tao_init_find_elements

Parameters:
  • u (TaoUniverseStruct) –

    Universe to search

  • search_string (str) –

    What to search for

  • attribute (str) –

    Check that attribute of element is free to vary.

Returns:
  • eles( 1D array of ElePointerStruct ) –

    List of matching elements. Size is zero if no elements found.

  • found_one( (bool, optional) ) –

    Set True if a matching element is found. However: Not set if no matching element found.

tao_init_global

Fortran source: tao/code/tao_init_mod.f90

tao_init_global(init_file: str) -> None

Subroutine tao_init_global (init_file)

Subroutine to initialize the tao global structures.

Parameters:
  • init_file (str) –

    Tao initialization file. If blank, there is no file so just use the defaults.

tao_init_lattice

Fortran source: tao/code/tao_interface.f90

tao_init_lattice(lat_file: str, err_flag: bool) -> None

Wrapper for Fortran routine tao_init_lattice

Parameters:
  • lat_file (str) –
  • err_flag (bool) –

tao_init_plotting

Fortran source: tao/code/tao_interface.f90

tao_init_plotting(plot_file: str) -> None

Wrapper for Fortran routine tao_init_plotting

Parameters:
  • plot_file (str) –

tao_init_variables

Fortran source: tao/code/tao_init_variables_mod.f90

tao_init_variables(var_file: str) -> None

Subroutine tao_init_variables (var_file)

Subroutine to initialize the tao variable structures.

Parameters:
  • var_file (str) –

    Tao variable initialization file. If blank, there is no file so just use the defaults.

tao_inject_beam

Fortran source: tao/code/tao_lattice_calc_mod.f90

tao_inject_beam(u: pybmad._pybmad.TaoUniverseStruct, model: pybmad._pybmad.TaoLatticeStruct, ix_branch: typing.SupportsInt | typing.SupportsIndex) -> pybmad._pybmad.TaoInjectBeam

Subroutine tao_inject_beam (u, model, ix_branch, beam, init_ok)

This will initialize the beam for a given lattice branch.

Trying to inject a beam of one species into a branch with a different ref species (example: electron bunch into photon branch) is problematical. To avoid problems, Tao will set not inject (init_ok = False) if there is a mismatch.

Parameters:
  • u (TaoUniverseStruct) –

    Universe containing the lattice.

  • model (TaoLatticeStruct) –

    Universe parameters.

  • ix_branch (int) –

    Lattice branch index to inject into.

Returns:
  • beam( BeamStruct ) –

    Initial beam.

  • init_ok( bool ) –

    Set False if there are problems. True otherwise.

tao_inject_particle

Fortran source: tao/code/tao_lattice_calc_mod.f90

tao_inject_particle(u: pybmad._pybmad.TaoUniverseStruct, model: pybmad._pybmad.TaoLatticeStruct, ix_branch: typing.SupportsInt | typing.SupportsIndex) -> None

Wrapper for Fortran routine tao_inject_particle

Parameters:

tao_is_valid_name

Fortran source: tao/code/tao_interface.f90

tao_is_valid_name(name: str) -> pybmad._pybmad.TaoIsValidName

Wrapper for Fortran routine tao_is_valid_name

Parameters:
  • name (str) –

    Name to be checked.

Returns:
  • why_invalid( str ) –

    Why invalid description.

  • is_valid( bool ) –

    True if valid. False otherwise.

tao_json_cmd

Fortran source: tao/code/tao_interface.f90

tao_json_cmd(input_str: str) -> None

Wrapper for Fortran routine tao_json_cmd

Parameters:
  • input_str (str) –

    What to show.

tao_key_info_to_str

Fortran source: tao/code/tao_interface.f90

tao_key_info_to_str(ix_key: typing.SupportsInt | typing.SupportsIndex, ix_min_key: typing.SupportsInt | typing.SupportsIndex, ix_max_key: typing.SupportsInt | typing.SupportsIndex, key_str: str, header_str: str) -> None

Wrapper for Fortran routine tao_key_info_to_str

Parameters:
  • ix_key (int) –
  • ix_min_key (int) –
  • ix_max_key (int) –
  • key_str (str) –
  • header_str (str) –

tao_lat_bookkeeper

Fortran source: tao/code/tao_interface.f90

tao_lat_bookkeeper(u: pybmad._pybmad.TaoUniverseStruct, tao_lat: pybmad._pybmad.TaoLatticeStruct) -> bool

Wrapper for Fortran routine tao_lat_bookkeeper

Parameters:
Returns:
  • err_flag( bool ) –

    Set True if there is a problem. False otherwise.

tao_lat_emit_calc

Fortran source: tao/code/tao_interface.f90

tao_lat_emit_calc(plane: typing.SupportsInt | typing.SupportsIndex, emit_type: typing.SupportsInt | typing.SupportsIndex, ele: pybmad._pybmad.EleStruct, modes: pybmad._pybmad.NormalModesStruct) -> float

Wrapper for Fortran routine tao_lat_emit_calc

Parameters:
  • plane (int) –

    x_plane$ or y_plane$.

  • emit_type (int) –

    Either projected_emit$ or apparent_emit$

  • ele (EleStruct) –

    Element holding the Twiss and coupling parameters.

  • modes (NormalModesStruct) –

    Structure holding the emittances

Returns:
  • emit( float ) –

    emittance.

tao_lat_sigma_calc_needed

Fortran source: tao/code/tao_interface.f90

tao_lat_sigma_calc_needed(data_type: str, data_source: str, do_lat_sigma: bool) -> None

Wrapper for Fortran routine tao_lat_sigma_calc_needed

Parameters:
  • data_type (str) –
  • data_source (str) –
  • do_lat_sigma (bool) –

tao_lat_sigma_track

Fortran source: tao/code/tao_lattice_calc_mod.f90

tao_lat_sigma_track(tao_lat: pybmad._pybmad.TaoLatticeStruct, ix_branch: typing.SupportsInt | typing.SupportsIndex, print_err: bool | None = None, force_calc: bool | None = None) -> bool

Subroutine tao_lat_sigma_track (tao_lat, calc_ok, ix_branch, print_err, force_calc)

Routine to track the 6x6 sigma matrix through the lattice using the lattice linear transfer matrices.

Parameters:
  • tao_lat (TaoLatticeStruct) –

    Structure containing the lattice.

  • ix_branch (int) –

    Branch index to track through.

  • print_err (bool) –

    Default is False. Print error messages if, eg, lattice is unstable?

  • force_calc (bool) –

    Default is False. If True, force the calculation to be done.

Returns:
  • calc_ok( bool ) –

    Set True if there were no problems, False otherwise.

tao_lattice_branches_equal_tao_lattice_branches

Fortran source: tao/code/tao_struct.f90

tao_lattice_branches_equal_tao_lattice_branches(tlb1: pybmad._pybmad.TaoLatticeBranchStructArray1D, tlb2: pybmad._pybmad.TaoLatticeBranchStructArray1D) -> None

Wrapper for Fortran routine tao_lattice_branches_equal_tao_lattice_branches

Parameters:
  • tlb1 (1D array of TaoLatticeBranchStruct) –
  • tlb2 (1D array of TaoLatticeBranchStruct) –

tao_lattice_calc

Fortran source: tao/code/tao_interface.f90

tao_lattice_calc() -> pybmad._pybmad.TaoLatticeCalc

Wrapper for Fortran routine tao_lattice_calc

Returns:
  • calc_ok( bool ) –

    Set False if there was an error in the calculation like a particle was lost or a lat is unstable.

  • print_err( (bool, optional) ) –

    Default True. If False, do not print error messages if, for example, the lattice is unstable.

tao_lattice_equal_tao_lattice

Fortran source: tao/code/tao_struct.f90

tao_lattice_equal_tao_lattice(lat1: pybmad._pybmad.TaoLatticeStruct, lat2: pybmad._pybmad.TaoLatticeStruct) -> None

Wrapper for Fortran routine tao_lattice_equal_tao_lattice

Parameters:

tao_limit_calc

Fortran source: tao/code/tao_interface.f90

tao_limit_calc() -> bool

Wrapper for Fortran routine tao_limit_calc

Returns:
  • limited( bool ) –

    Set True if a variable is past a limit.

tao_lm_optimizer

Fortran source: tao/code/tao_lm_optimizer_mod.f90

tao_lm_optimizer() -> bool

Subroutine tao_lm_optimizer (abort)

Routine to minimize the merit function by varying variables until the "data" as calculated from the model matches the measured data.

This subroutine is a wrapper for the mrqmin routine of Numerical Recipes. See the Numerical Recipes writeup for more details. 'lm' stands for Levenburg - Marquardt. Otherwise known as LMDIF.

Returns:
  • abort( bool ) –

    Set True if an user stop signal detected.

tao_lmdif_optimizer

Fortran source: tao/code/tao_interface.f90

tao_lmdif_optimizer() -> bool

Wrapper for Fortran routine tao_lmdif_optimizer

Returns:
  • abort( bool ) –

    Set True if an user stop signal detected or there is a problem with calculating the merit function.

tao_load_this_datum

Fortran source: tao/code/tao_data_and_eval_mod.f90

tao_load_this_datum(vec: pybmad._pybmad.RealArray1D, ele_ref: pybmad._pybmad.EleStruct, ele_start: pybmad._pybmad.EleStruct, ele: pybmad._pybmad.EleStruct, datum_value: typing.SupportsFloat | typing.SupportsIndex, valid_value: bool, datum: pybmad._pybmad.TaoDataStruct, branch: pybmad._pybmad.BranchStruct, why_invalid: str | None = None, good: pybmad._pybmad.BoolAlloc1D | None = None) -> None

Wrapper for Fortran routine tao_load_this_datum

Parameters:

tao_locate_all_elements

Fortran source: tao/code/tao_interface.f90

tao_locate_all_elements(ele_list: str, ignore_blank: bool | None = None) -> pybmad._pybmad.TaoLocateAllElements

Wrapper for Fortran routine tao_locate_all_elements

Parameters:
  • ele_list (str) –

    String with element names using element list format.

  • ignore_blank (bool) –

    If present and true then do nothing if ele_list is blank. otherwise a blank is treated as an error.

Returns:
  • eles( 1D array of ElePointerStruct ) –

    : Array of elements in the model lat.

  • err( bool ) –

    Set true on error.

tao_locate_elements

Fortran source: tao/code/tao_interface.f90

tao_locate_elements(ele_list: str, ix_universe: typing.SupportsInt | typing.SupportsIndex, lat_type: typing.SupportsInt | typing.SupportsIndex | None = None, ignore_blank: bool | None = None, err_stat_level: typing.SupportsInt | typing.SupportsIndex | None = None, above_ubound_is_err: bool | None = None, ix_branch: typing.SupportsInt | typing.SupportsIndex | None = None, multiple_eles_is_err: bool | None = None) -> pybmad._pybmad.TaoLocateElements

Wrapper for Fortran routine tao_locate_elements

Parameters:
  • ele_list (str) –

    String with element names using element list format.

  • ix_universe (int) –

    Universe to search. -1 => search s.global.default_universe. -2 (all unis) => error. ix_universe is ignored if ele_list starts with a universe specifier "N@".

  • lat_type (int) –

    model$ (default), design\(, or base\).

  • ignore_blank (bool) –

    If present and true then do nothing if ele_list is blank. otherwise treated as an error.

  • err_stat_level (int) –

    Status level for error messages. If not present, print with level s_error\(. Use s_nooutput\) to prevent printing.

  • above_ubound_is_err (bool) –
  • ix_branch (int) –

    If present and non-negative then use this as the branch index for elements specified using an integer index (EG: "43"). If -1 use the default branch, search all branches.

  • multiple_eles_is_err (bool) –

    If present and True then matching to more than one element is an error.

Returns:
  • eles( 1D array of ElePointerStruct ) –

    : Array of elements in the model lat.

  • err( bool ) –

    Set true on error.

tao_mark_lattice_ele

Fortran source: tao/code/tao_interface.f90

tao_mark_lattice_ele(lat: pybmad._pybmad.LatStruct) -> None

Wrapper for Fortran routine tao_mark_lattice_ele

Parameters:
  • lat (LatStruct) –

    Input lattice This parameter is an input/output and is modified in-place. As an output, lat: Lattice with elements marked.

tao_merit

Fortran source: tao/code/tao_interface.f90

tao_merit() -> pybmad._pybmad.TaoMerit

Wrapper for Fortran routine tao_merit

Returns:
  • this_merit( float ) –

    Merit value.

  • calc_ok( (bool, optional) ) –

    Set False if there was an error in the calculation like a particle was lost or a lat is unstable.

tao_next_switch

Fortran source: tao/code/tao_command_mod.f90

tao_next_switch(line: str, switch_list: pybmad._pybmad.CharacterAlloc1D, return_next_word: bool, neg_num_not_switch: bool | None = None, print_err: bool | None = None) -> pybmad._pybmad.TaoNextSwitch

Subroutine tao_next_switch (line, switch_list, return_next_word, switch, err, neg_num_not_switch, print_err)

Subroutine look at the next word on the command line and match this word to a list of "switches" given by the switch_list argument.

If switch_list(1) starts with a "-" or "#" character, switches are assumed to start with this character. If switch_list(1) starts with any other character, everything is considered to be a switch.

Switch abbreviations are permitted.

If return_next_word = True then, when a non-switch word is encountered, the switch argument will be set to that word and that word will be removed from the line argument.

If return_next_word = False then, when a non-switch word is encountered, the switch argument will be set to '' and the non-switch word will be left on the line argument.

If the first non-blank character in line is a single or double quote. The word returned will be the substring from the initial quote mark to the next matching quote mark. The quote marks will be removed from the returned switch argument.

Parameters:
  • line (str) –

    Command line This parameter is an input/output and is modified in-place. As an output, line: Command line with first word removed if

  • switch_list (1D array of str) –

    List of valid switches.

  • return_next_word (bool) –

    See above.

  • neg_num_not_switch (bool) –

    If present and True then a word like "-34" will be treated as a non-switch.

  • print_err (bool) –

    Default is True. If False, do not print unknown switch error.

Returns:
  • line( str ) –

    Command line This parameter is an input/output and is modified in-place. As an output, line: Command line with first word removed if

  • err( bool ) –

    Set True if the next word begins with '-' but there is no match to anything in switch_list.

tao_next_word

Fortran source: tao/code/tao_command_mod.f90

tao_next_word(line: str) -> pybmad._pybmad.TaoNextWord

Subroutine tao_next_word (line, word)

Routine to return the next word in a line.

Words are delimited by a space character except if the space is within quotes. Additionally, spaces within brackets "(...)", "{...}", and "[...]" are ignored. Outer quote marks will be removed in the returned word.

Parameters:
  • line (str) –

    String to parse. This parameter is an input/output and is modified in-place. As an output, line: String with first word removed.

Returns:
  • line( str ) –

    String to parse. This parameter is an input/output and is modified in-place. As an output, line: String with first word removed.

  • word( str ) –

    First word of line.

tao_one_turn_map_calc_needed

Fortran source: tao/code/tao_interface.f90

tao_one_turn_map_calc_needed(data_type: str, data_source: str, do_one_turn_map: bool) -> None

Wrapper for Fortran routine tao_one_turn_map_calc_needed

Parameters:
  • data_type (str) –
  • data_source (str) –
  • do_one_turn_map (bool) –

tao_open_file

Fortran source: tao/code/tao_interface.f90

tao_open_file(file: str, file_name: str, error_severity: typing.SupportsInt | typing.SupportsIndex, binary: bool | None = None) -> int

Wrapper for Fortran routine tao_open_file

Parameters:
  • file (str) –
  • file_name (str) –

    File name.

  • error_severity (int) –

    Severity level used in the error message. Possibilities are s_fatal$, etc. See out_io doc for more details. Use -1 to not print a message if file cannot be opened.

  • binary (bool) –

    If present and True then open a binary file, Defaut is False.

Returns:
  • iunit( int ) –

    Logical unit number. Set to 0 if file not openable.

tao_open_scratch_file

Fortran source: tao/code/tao_interface.f90

tao_open_scratch_file() -> pybmad._pybmad.TaoOpenScratchFile

Wrapper for Fortran routine tao_open_scratch_file

Returns:
  • err( bool ) –

    Set True if there is an error. False otherwise.

  • iu( int ) –

    File handle unit number.

tao_optimization_status

Fortran source: tao/code/tao_interface.f90

tao_optimization_status(datum: pybmad._pybmad.TaoDataStruct) -> str

Wrapper for Fortran routine tao_optimization_status

Parameters:
Returns:
  • why_str( str ) –

    Optimization status of the datum.

tao_orbit_beta_wave_anal

Fortran source: tao/code/tao_wave_mod.f90

tao_orbit_beta_wave_anal(plot: pybmad._pybmad.TaoPlotStruct) -> None

Subroutine tao_orbit_beta_wave_anal (plot)

tao_oreint_building_wall_pt

Fortran source: tao/code/tao_interface.f90

tao_oreint_building_wall_pt(pt_in: pybmad._pybmad.TaoBuildingWallPointStruct) -> pybmad._pybmad.TaoBuildingWallPointStruct

Wrapper for Fortran routine tao_oreint_building_wall_pt

Parameters:
Returns:

tao_param_value_at_s

Fortran source: tao/code/tao_interface.f90

tao_param_value_at_s(dat_name: str, ele_to_s: pybmad._pybmad.EleStruct, ele_here: pybmad._pybmad.EleStruct, orbit: pybmad._pybmad.CoordStruct) -> pybmad._pybmad.TaoParamValueAtS

Wrapper for Fortran routine tao_param_value_at_s

Parameters:
  • dat_name (str) –
  • ele_to_s (EleStruct) –

    Element whose exit end is at the evaluation s-position.

  • ele_here (EleStruct) –

    Lattice element that overlaps the s-position ele.s.

  • orbit (CoordStruct) –

    Orbit at the evaluation s-position.

Returns:
  • err_flag( bool ) –

    Set true if parameter cannot be evaluated.

  • value( float ) –

    Parameter value.

  • why_invalid( (str, optional) ) –

    Set if err_flag = True to document why is there a problem.

  • print_err( (bool, optional) ) –

    Print error message on error? Default is True.

  • bad_datum( (bool, optional) ) –

    Data_type is malformed.

tao_param_value_routine

Fortran source: tao/code/tao_data_and_eval_mod.f90

tao_param_value_routine(str: str, use_good_user: bool, saved_prefix: str, stack: pybmad._pybmad.TaoEvalNodeStruct, err_flag: bool, print_err: bool, dflt_component: str | None = None, dflt_source: str | None = None, dflt_ele_ref: pybmad._pybmad.EleStruct | None = None, dflt_ele_start: pybmad._pybmad.EleStruct | None = None, dflt_ele: pybmad._pybmad.EleStruct | None = None, dflt_dat_or_var_index: str | None = None, dflt_uni: typing.SupportsInt | typing.SupportsIndex | None = None, dflt_eval_point: typing.SupportsInt | typing.SupportsIndex | None = None, dflt_s_offset: typing.SupportsFloat | typing.SupportsIndex | None = None, dflt_orbit: pybmad._pybmad.CoordStruct | None = None, datum: pybmad._pybmad.TaoDataStruct | None = None) -> None

Wrapper for Fortran routine tao_param_value_routine

Parameters:
  • str (str) –
  • use_good_user (bool) –
  • saved_prefix (str) –
  • stack (TaoEvalNodeStruct) –
  • err_flag (bool) –
  • print_err (bool) –
  • dflt_component (str) –
  • dflt_source (str) –
  • dflt_ele_ref (EleStruct) –
  • dflt_ele_start (EleStruct) –
  • dflt_ele (EleStruct) –
  • dflt_dat_or_var_index (str) –
  • dflt_uni (int) –
  • dflt_eval_point (int) –
  • dflt_s_offset (float) –
  • dflt_orbit (CoordStruct) –
  • datum (TaoDataStruct) –

tao_parse_command_args

Fortran source: tao/code/tao_interface.f90

tao_parse_command_args(cmd_line: str | None = None) -> bool

Wrapper for Fortran routine tao_parse_command_args

Parameters:
  • cmd_line (str) –
Returns:
  • error( bool ) –

    Set True if there is an error. False otherwise.

tao_parse_element_param_str

Fortran source: tao/code/tao_interface.f90

tao_parse_element_param_str(in_str: str) -> pybmad._pybmad.TaoParseElementParamStr

Wrapper for Fortran routine tao_parse_element_param_str

Parameters:
  • in_str (str) –

    String specifying a parameter of an element or elements.

Returns:
  • err( bool ) –

    Set True if there is a parse error. False otherwise.

  • uni( str ) –

    Universe substring.

  • element( str ) –

    Element name.

  • parameter( str ) –

    Element parameter name.

  • where( int ) –

    One of not_set\(, anchor_beginning\), anchor_center\(, or anchor_end\).

  • component( str ) –

    One of "model", "design", or "base".

tao_particle_data_value

Fortran source: tao/code/tao_graph_setup_mod.f90

tao_particle_data_value(data_type: str, p: pybmad._pybmad.CoordStructArray1D, ele: pybmad._pybmad.EleStruct, ix_bunch: typing.SupportsInt | typing.SupportsIndex) -> pybmad._pybmad.TaoParticleDataValue

Subroutine tao_particle_data_value (data_type, p, value, err, ele, ix_bunch)

Routine to calculate the value array of a data_type for an array of particles.

Parameters:
  • data_type (str) –

    Type of data.

  • p (1D array of CoordStruct) –

    coord_struct, Array of particles containing the data.

  • ele (EleStruct) –

    Needed for "Ja" evaluation.

  • ix_bunch (int) –

    Bunch index.

Returns:
  • value( 1D array of float ) –

    Array of values.

  • err( bool ) –

    Set True if there is an error. False otherwise.

tao_pause_cmd

Fortran source: tao/code/tao_interface.f90

tao_pause_cmd(time: typing.SupportsFloat | typing.SupportsIndex) -> None

Wrapper for Fortran routine tao_pause_cmd

Parameters:
  • time (float) –

    Time to pause in seconds.

tao_phase_space_axis_index

Fortran source: tao/code/tao_graph_setup_mod.f90

tao_phase_space_axis_index(data_type: str, err: bool) -> int

Function tao_phase_space_axis_index (data_type, err) result (ix_axis)

Routine to calculate the phase space axis index for a given data type.

Parameters:
  • data_type (str) –

    Type of data.

  • err (bool) –

    Set True if there is an error.

Returns:
  • ix_axis( int ) –

    Axis index.

tao_phase_wave_anal

Fortran source: tao/code/tao_wave_mod.f90

tao_phase_wave_anal(plot: pybmad._pybmad.TaoPlotStruct) -> None

Subroutine tao_phase_wave_anal (plot)

tao_pick_universe

Fortran source: tao/code/tao_interface.f90

tao_pick_universe(name_in: str, dflt_uni: typing.SupportsInt | typing.SupportsIndex | None = None, pure_uni: bool | None = None) -> pybmad._pybmad.TaoPickUniverse

Wrapper for Fortran routine tao_pick_universe

Parameters:
  • name_in (str) –

    data name with possible universe spec.

  • dflt_uni (int) –

    Default universe to use. Set to -1 if explicit universe is required.

  • pure_uni (bool) –

    Default is False. See above

Returns:
  • name_out( str ) –

    name_in without any "n@" beginning.

  • picked( 1D array of bool ) –

    Array showing picked universes. The array will be resized if necessary.

  • err( bool ) –

    Set True if an error is detected.

  • ix_uni( (int, optional) ) –

    Set to the picked universe with the highest index.

  • explicit_uni( (bool, optional) ) –

    Set True if name_in has explicit universe "n@" specification.

tao_pipe_cmd

Fortran source: tao/code/tao_interface.f90

tao_pipe_cmd(input_str: str) -> None

Wrapper for Fortran routine tao_pipe_cmd

Parameters:
  • input_str (str) –

    What to show.

tao_place_cmd

Fortran source: tao/code/tao_interface.f90

tao_place_cmd(where: str, who: str, no_buffer: bool | None = None) -> None

Wrapper for Fortran routine tao_place_cmd

Parameters:
  • where (str) –

    Region where the plot goes. Eg: 'top'.

  • who (str) –

    Type of plot. Eg: 'orbit'.

  • no_buffer (bool) –

    If present and True then prevents buffering in the case when s.global.external_plotting = T

tao_plot_cmd

Fortran source: tao/code/tao_interface.f90

tao_plot_cmd(where: str, component: str) -> None

Wrapper for Fortran routine tao_plot_cmd

Parameters:
  • where (str) –

    Region name to identify the plot to set.

  • component (str) –

    Who to plot. EG: 'meas - design'

tao_plot_data

Fortran source: tao/code/tao_plot_mod.f90

tao_plot_data(plot: pybmad._pybmad.TaoPlotStruct, graph: pybmad._pybmad.TaoGraphStruct) -> None

Subroutine tao_plot_data (plot, graph)

Routine to draw a graph with data and/or variable curves.

Parameters:

tao_plot_histogram

Fortran source: tao/code/tao_plot_mod.f90

tao_plot_histogram(plot: pybmad._pybmad.TaoPlotStruct, graph: pybmad._pybmad.TaoGraphStruct) -> None

Subroutine tao_plot_histogram (plot, graph)

Routine to draw one graph for the histogram analysis plot.

Parameters:

tao_plot_key_table

Fortran source: tao/code/tao_plot_mod.f90

tao_plot_key_table(plot: pybmad._pybmad.TaoPlotStruct, graph: pybmad._pybmad.TaoGraphStruct) -> None

Subroutine tao_plot_key_table (plot, graph)

Routine to draw a key table graph.

Parameters:

tao_plot_setup

Fortran source: tao/code/tao_interface.f90

tao_plot_setup() -> None

Wrapper for Fortran routine tao_plot_setup

tao_plot_struct_transfer

Fortran source: tao/code/tao_interface.f90

tao_plot_struct_transfer(plot_in: pybmad._pybmad.TaoPlotStruct) -> pybmad._pybmad.TaoPlotStruct

Wrapper for Fortran routine tao_plot_struct_transfer

Parameters:
Returns:

tao_plot_wave

Fortran source: tao/code/tao_plot_mod.f90

tao_plot_wave(plot: pybmad._pybmad.TaoPlotStruct, graph: pybmad._pybmad.TaoGraphStruct) -> None

Subroutine tao_plot_wave (plot, graph)

Routine to draw one graph for the wave analysis plot.

Parameters:

tao_pointer_to_building_wall_shape

Fortran source: tao/code/tao_interface.f90

tao_pointer_to_building_wall_shape(wall_name: str) -> pybmad._pybmad.TaoEleShapeStruct | None

Wrapper for Fortran routine tao_pointer_to_building_wall_shape

Parameters:
  • wall_name (str) –

    Name of the wall.

Returns:
  • e_shape( (TaoEleShapeStruct, optional) ) –

    Associated shape. Nullified if there is no associated shape.

tao_pointer_to_datum

Fortran source: tao/code/tao_interface.f90

tao_pointer_to_datum(d1: pybmad._pybmad.TaoD1DataStruct, ele_name: str) -> pybmad._pybmad.TaoDataStruct | None

Wrapper for Fortran routine tao_pointer_to_datum

Parameters:
  • d1 (TaoD1DataStruct) –

    D1 data struct to search.

  • ele_name (str) –

    Name of lattice element to match to.

Returns:
  • datum_ptr( (TaoDataStruct, optional) ) –

    Pointer to the matched datum. Will be null if no match found.

tao_pointer_to_datum_ele

Fortran source: tao/code/tao_data_and_eval_mod.f90

tao_pointer_to_datum_ele(lat: pybmad._pybmad.LatStruct, ele_name: str, ix_ele: typing.SupportsInt | typing.SupportsIndex, datum: pybmad._pybmad.TaoDataStruct, print_err: bool | None = None) -> pybmad._pybmad.TaoPointerToDatumEle

Function tao_pointer_to_datum_ele (lat, ele_name, ix_ele, datum, valid, why_invalid, print_err) result (ele)

Routine to see if an element index corresponds to an element with a definite location such as an overlay or multipass element.

If the element is a super_lord then the super_slave element at the exit end of the lord will be returned. Otherwise ix_loc will be set to ix_ele.

Parameters:
  • lat (LatStruct) –

    Lattice

  • ix_ele (int) –

    Index of element.

  • datum (TaoDataStruct) –

    Used for error messages and gives branch index.

  • print_err (bool) –

    Default is True. If False, do not print an error message.

Returns:
  • valid( bool ) –

    Set False if element does not have a definite location. Set True otherwise

  • why_invalid( (str, optional) ) –

    Tells why datum value is invalid.

  • ele( (EleStruct, optional) ) –

    : Pointer to the element. Set to NULL if not valid or no associated element.

tao_pointer_to_ele_shape

Fortran source: tao/code/tao_interface.f90

tao_pointer_to_ele_shape(ix_uni: typing.SupportsInt | typing.SupportsIndex, ele: pybmad._pybmad.EleStruct, ele_shape: pybmad._pybmad.TaoEleShapeStructArray1D, ix_shape_min: typing.SupportsInt | typing.SupportsIndex | None = None) -> pybmad._pybmad.TaoPointerToEleShape

Wrapper for Fortran routine tao_pointer_to_ele_shape

Parameters:
  • ix_uni (int) –

    Universe index.

  • ele (EleStruct) –

    Lattice element.

  • ele_shape (1D array of TaoEleShapeStruct) –

    Array of shapes to search.

  • ix_shape_min (int) –

    Index of minimum ele_shape(:) index to start search from. Default is 1. This parameter is an input/output and is modified in-place. As an output, ix_shape_min: Ele_shape(

Returns:
  • dat_var_name( (str, optional) ) –

    Name of datum or variable associated with e_shape. Will be set to "" if there is no associated datum or variable.

  • dat_var_value( (float, optional) ) –

    Value of datum or variable associated with e_shape. Will be set to zero if there is no associated datum or variable.

  • ix_shape_min( (int, optional) ) –

    Index of minimum ele_shape(:) index to start search from. Default is 1. This parameter is an input/output and is modified in-place. As an output, ix_shape_min: Ele_shape(

  • e_shape( (TaoEleShapeStruct, optional) ) –

    Associated shape. Nullified if there is no associated shape.

tao_pointer_to_tao_lat

Fortran source: tao/code/tao_interface.f90

tao_pointer_to_tao_lat(u: pybmad._pybmad.TaoUniverseStruct, lat_type: typing.SupportsInt | typing.SupportsIndex | None = None) -> pybmad._pybmad.TaoLatticeStruct | None

Wrapper for Fortran routine tao_pointer_to_tao_lat

Parameters:
  • u (TaoUniverseStruct) –

    Universe to work with

  • lat_type (int) –

    model$ (default), design\(, or base\).

Returns:
  • tao_lat( (TaoLatticeStruct, optional) ) –

    Tao_lat pointer. Points to u.model, u.design, or u.base

tao_pointer_to_universe

Fortran sources (overloaded):

tao_pointer_to_universe(args, *kwargs) Overloaded function.

  1. tao_pointer_to_universe(ix_uni: typing.SupportsInt | typing.SupportsIndex, neg2_to_default: bool | None = None) -> pybmad._pybmad.TaoUniverseStruct | None

Function tao_pointer_to_universe (...) result (u)

Routine to set a pointer to a universe.

This is an overloaded routine for the: tao_pointer_to_universe_int (ix_uni, neg2_to_default) result (u) tao_pointer_to_universe_str (string, neg2_to_default) result (u)

Note: With a string argument, this routine can only handle single universe picks. That is, it cannot handlle something like "[1,3,4]@...". To handle multiple universe picks, use: tao_pointer_to_universes

Parameters:
  • ix_uni (int) –

    Index to the s.u(:) array If ix_uni is -1 -> u(s.global.default_universe) will be used.

  • neg2_to_default (bool) –

    i_uni = -2 (all universes) maps to the default uni? Default if False.

Returns:
  • u( (TaoUniverseStruct, optional) ) –

    Universe pointer. u will be nullified if there is an error and an error message will be printed.

  • 2. tao_pointer_to_universe(string: str, neg2_to_default: bool | None = None) -> pybmad._pybmad.TaoPointerToUniverseStr
  • Function tao_pointer_to_universe (...) result (u)
  • Routine to set a pointer to a universe.
  • This is an overloaded routine for the:

    tao_pointer_to_universe_int (ix_uni, neg2_to_default) result (u) tao_pointer_to_universe_str (string, neg2_to_default) result (u)

  • Note( With a string argument, this routine can only handle single universe picks. ) –
  • That is, it cannot handlle something like "[1,3,4]@...". To handle multiple universe picks, use:

    tao_pointer_to_universes

Parameters:
  • string (str) –

    String in the form "@..." or, if no "@" is present, u will point to the default universe. This parameter is an input/output and is modified in-place. As an output, string: String with universe prefix stripped off.

  • neg2_to_default (bool) –

    i_uni = -2 (all universes) maps to the default uni? Default if False.

Returns:
  • string( str ) –

    String in the form "@..." or, if no "@" is present, u will point to the default universe. This parameter is an input/output and is modified in-place. As an output, string: String with universe prefix stripped off.

  • u( (TaoUniverseStruct, optional) ) –

    Universe pointer. u will be nullified if there is an error and an error message will be printed.

tao_pointer_to_universes

Fortran source: tao/code/tao_interface.f90

tao_pointer_to_universes(name_in: str, dflt_uni: typing.SupportsInt | typing.SupportsIndex | None = None) -> pybmad._pybmad.TaoPointerToUniverses

Wrapper for Fortran routine tao_pointer_to_universes

Parameters:
  • name_in (str) –

    data name with possible universe spec.

  • dflt_uni (int) –

    Default universe to use. Set to -1 if explicit universe is required.

Returns:
  • unis( 1D array of TaoUniversePointerStruct ) –

    Array of pointers to picked universes. The array will be resized if necessary.

  • err( bool ) –

    Set True if an error is detected.

  • name_out( (str, optional) ) –

    name_in without any "n@" beginning.

  • explicit_uni( (bool, optional) ) –

    Set True if name_in has explicit universe "n@" specification.

tao_pointer_to_var_in_lattice

Fortran source: tao/code/tao_init_variables_mod.f90

tao_pointer_to_var_in_lattice(var: pybmad._pybmad.TaoVarStruct, ix_uni: typing.SupportsInt | typing.SupportsIndex, ele: pybmad._pybmad.EleStruct) -> bool

Subroutine tao_pointer_to_var_in_lattice (var, ix_uni, ele, err)

Routine to add a pointer from a given Tao variable to the appropriate variable in a lattice.

Parameters:
  • var (TaoVarStruct) –

    Structure has the info of where to point.

  • ix_uni (int) –

    the universe to use

Returns:
  • err( bool ) –

    Set True if there is an error. False otherwise.

tao_pointer_to_var_in_lattice2

Fortran source: tao/code/tao_init_variables_mod.f90

tao_pointer_to_var_in_lattice2(var: pybmad._pybmad.TaoVarStruct, ix_uni: typing.SupportsInt | typing.SupportsIndex) -> bool

Subroutine tao_pointer_to_var_in_lattice2 (var, ix_uni, err)

Routine to add a pointer from a given Tao variable to the appropriate variable in a lattice.

Parameters:
  • var (TaoVarStruct) –

    Structure has the info of where to point.

  • ix_uni (int) –

    the universe to use

Returns:
  • err( bool ) –

    Set True if there is an error. False otherwise.

tao_print_command_line_info

Fortran source: tao/code/tao_interface.f90

tao_print_command_line_info() -> None

Wrapper for Fortran routine tao_print_command_line_info

tao_ptc_normal_form

Fortran source: tao/code/tao_interface.f90

tao_ptc_normal_form(do_calc: bool, tao_lat: pybmad._pybmad.TaoLatticeStruct, ix_branch: typing.SupportsInt | typing.SupportsIndex, rf_on: typing.SupportsInt | typing.SupportsIndex | None = None) -> None

Wrapper for Fortran routine tao_ptc_normal_form

Parameters:
  • do_calc (bool) –

    Set True to do the calculation.

  • tao_lat (TaoLatticeStruct) –

    Lattice to work on.

  • ix_branch (int) –

    Branch of lattice to work on.

  • rf_on (int) –

    RF state for calculation. yes\(, no\), or maybe$ (default) maybe$ means that RF state in branch is used.

tao_python_cmd

Fortran source: tao/code/tao_interface.f90

tao_python_cmd(input_str: str) -> None

Wrapper for Fortran routine tao_python_cmd

Parameters:
  • input_str (str) –

    What to show.

tao_quiet_set

Fortran source: tao/code/tao_interface.f90

tao_quiet_set(set: str) -> None

Wrapper for Fortran routine tao_quiet_set

Parameters:
  • set (str) –

    True is silent running is wanted.

tao_rad_int_calc_needed

Fortran source: tao/code/tao_interface.f90

tao_rad_int_calc_needed(data_type: str, data_source: str, do_rad_int: bool) -> None

Wrapper for Fortran routine tao_rad_int_calc_needed

Parameters:
  • data_type (str) –
  • data_source (str) –
  • do_rad_int (bool) –

tao_re_allocate_expression_info

Fortran source: tao/code/tao_interface.f90

tao_re_allocate_expression_info(info: pybmad._pybmad.TaoExpressionInfoStructAlloc1D, n: typing.SupportsInt | typing.SupportsIndex, exact: bool | None = None) -> None

Wrapper for Fortran routine tao_re_allocate_expression_info

Parameters:
  • info (1D array of TaoExpressionInfoStruct) –

    This parameter is an input/output and is modified in-place. As an output, info: Allocated array with size(re) >= n.

  • n (int) –

    Size wanted.

  • exact (bool) –

    If present and False then the size of the output array is permitted to be larger than n. Default is True.

tao_re_associate_node_array

Fortran source: tao/code/tao_expression_tree_mod.f90

tao_re_associate_node_array(tree: pybmad._pybmad.TaoEvalNodeStruct, n: typing.SupportsInt | typing.SupportsIndex, exact: bool | None = None) -> None

Subroutine tao_re_associate_node_array(tree, n, exact)

Routine to resize the tree%node(:) array.

Note: The data of the array is preserved but data at the end of the array will be lost if n is less than the original size of the array

Parameters:
  • tree (TaoEvalNodeStruct) –
  • n (int) –

    Size wanted.

  • exact (bool) –

    Default is False. If False, the size of the output array is permitted to be larger than n.

tao_re_execute

Fortran source: tao/code/tao_command_mod.f90

tao_re_execute(string: str, err: bool) -> None

Subroutine tao_re_exectue (string, err)

Subroutine to execute a previous command.

tao_read_cmd

Fortran source: tao/code/tao_interface.f90

tao_read_cmd(which: str, unis: str, file: str, silent: bool) -> None

Wrapper for Fortran routine tao_read_cmd

Parameters:
  • which (str) –
  • unis (str) –

    Universes to apply to

  • file (str) –
  • silent (bool) –

    Silent

tao_read_phase_space_index

Fortran source: tao/code/tao_interface.f90

tao_read_phase_space_index(name: str, ixc: typing.SupportsInt | typing.SupportsIndex, print_err: bool | None = None) -> int

Wrapper for Fortran routine tao_read_phase_space_index

Parameters:
  • name (str) –

    character array holding the index. Must be in the range 1-6.

  • ixc (int) –

    location within to evaluate index.

  • print_err (bool) –

    If present and False then do not print an error message

Returns:
  • ix_ps( int ) –

    Index at (:). Returns 0 if bad index.

tao_regression_test

Fortran source: tao/code/tao_interface.f90

tao_regression_test(cmd_str: str) -> None

Wrapper for Fortran routine tao_regression_test

Parameters:
  • cmd_str (str) –

tao_remove_blank_characters

Fortran source: tao/code/tao_interface.f90

tao_remove_blank_characters(str: str) -> pybmad._pybmad.TaoRemoveBlankCharacters

Wrapper for Fortran routine tao_remove_blank_characters

Parameters:
  • str (str) –

    Input string. This parameter is an input/output and is modified in-place. As an output, str: String with blank characters removed.

Returns:
  • str( str ) –

    Input string. This parameter is an input/output and is modified in-place. As an output, str: String with blank characters removed.

tao_run_cmd

Fortran source: tao/code/tao_interface.f90

tao_run_cmd(which: str) -> bool

Wrapper for Fortran routine tao_run_cmd

Parameters:
  • which (str) –

    which optimizer to use.

Returns:
  • abort( bool ) –

    Set True if the run was aborted by the user, an at minimum condition, a singular matrix condition, etc.. False otherwise.

tao_scale_cmd

Fortran source: tao/code/tao_scale_mod.f90

tao_scale_cmd(where: str, y_min_in: typing.SupportsFloat | typing.SupportsIndex, y_max_in: typing.SupportsFloat | typing.SupportsIndex, axis: str | None = None, include_wall: bool | None = None, gang: str | None = None, exact: bool | None = None, turn_autoscale_off: bool | None = None) -> None

Subroutine tao_scale_cmd (where, y_min_in, y_max_in, axis, include_wall, gang, exact, turn_autoscale_off)

Routine to scale a plot. If y_min = y_max, the scales will be chosen to show all the data.

Parameters:
  • where (str) –

    Region to scale. Eg: "top:x"

  • y_min_in (float) –

    Plot y-axis min value.

  • y_max_in (float) –

    Plot y-axis max value.

  • axis (str) –

    'y', 'y2', or '' (both). Default = ''.

  • include_wall (bool) –

    Used for floor_plan plots where a building wall is drawn and y_min_in = y_max_in. If present and True include the building wall position will be included in determining the the scale.

  • gang (str) –

    'gang', 'nogang', ''. Default = ''.

  • exact (bool) –

    Exact plot y_max, y_min to correspond to y_min_in, y_max_in? Default is False. Only relavent when y_min_in /= y_max_in.

  • turn_autoscale_off (bool) –

    If True (default) then turn off plot.autoscale_y logical for all plots that are scaled.

tao_scale_graph

Fortran source: tao/code/tao_scale_mod.f90

tao_scale_graph(graph: pybmad._pybmad.TaoGraphStruct, y_min: typing.SupportsFloat | typing.SupportsIndex, y_max: typing.SupportsFloat | typing.SupportsIndex, axis: str | None = None, include_wall: bool | None = None) -> pybmad._pybmad.TaoScaleGraph

Subroutine tao_scale_graph (graph, y_min, y_max, axis, include_wall, y_range, y2_range)

Routine to scale the y-axis and/or y2-axis of a graph If y_min = y_max then autoscaling will be done and the particular value of y_min and y_max is ignored. Note: y_min/y_max is ignored if scaling y2-axis and graph%y2_mirrors_y = T.

Parameters:
  • graph (TaoGraphStruct) –

    Graph with axis/axes to be scaled. This parameter is an input/output and is modified in-place. As an output, graph: Graph with scaled axis/axes.

  • y_min (float) –

    Axis [min, max] must cover [y_min, y_max] if not autoscaling.

  • y_max (float) –

    Axis [min, max] must cover [y_min, y_max] if not autoscaling.

  • axis (str) –

    Axis to scale. '' -> scale y and y2 (default). 'y' -> scale y-axis. 'y2' -> scale y2-axis

  • include_wall (bool) –

    Used for floor_plan plots where a building wall is drawn and y_min_in = y_max_in. If present and True include the building wall position will be included in determining the the scale.

Returns:
  • y_range( 1D array of float (shape: 2), optional ) –

    Only used by tao_scale_plot when ganging graphs.

  • y2_range( 1D array of float (shape: 2), optional ) –

    Only used by tao_scale_plot when ganging graphs.

tao_scale_ping_data

Fortran source: tao/code/tao_interface.f90

tao_scale_ping_data(u: pybmad._pybmad.TaoUniverseStruct) -> None

Wrapper for Fortran routine tao_scale_ping_data

Parameters:

tao_scale_plot

Fortran source: tao/code/tao_scale_mod.f90

tao_scale_plot(plot: pybmad._pybmad.TaoPlotStruct, y_min_in: typing.SupportsFloat | typing.SupportsIndex, y_max_in: typing.SupportsFloat | typing.SupportsIndex, axis: str | None = None, include_wall: bool | None = None, gang: str | None = None, skip_lat_layout: bool | None = None) -> None

Subroutine tao_scale_plot (plot, y_min_in, y_max_in, axis, include_wall, gang, skip_lat_layout)

Routine to scale the y-axis and/or y2-axis of the graphs of the plot. If y_min_in = y_max_in then autoscaling will be done and the particular value of y_min_in and y_max_in is ignored.

Parameters:
  • plot (TaoPlotStruct) –

    Plot with graphs to be scaled. This parameter is an input/output and is modified in-place. As an output, plot: Plot with scaled graphs.

  • y_min_in (float) –

    Axis [min, max] must cover [y_min_in, y_max_in] if not autoscaling.

  • y_max_in (float) –

    Axis [min, max] must cover [y_min_in, y_max_in] if not autoscaling.

  • axis (str) –

    Axis to scale. '' -> scale y and y2 (default). 'y' -> scale y-axis. 'y2' -> scale y2-axis

  • include_wall (bool) –

    Used for floor_plan plots where a building wall is drawn and y_min_in = y_max_in. If present and True include the building wall position will be included in determining the the scale.

  • gang (str) –

    If autoscale then make all graph y-axes the same and/or make all y2-axes the same? '' -> (default) Use setting of plot.autoscale_gang_y 'gang' -> Gang graphs. 'nogang' -> Do not gang graphs.

  • skip_lat_layout (bool) –

    If True, skip scaling any lat_layout graphs. Default is false.

tao_scratch_values_calc

Fortran source: tao/code/tao_data_and_eval_mod.f90

tao_scratch_values_calc(ele_ref: pybmad._pybmad.EleStruct, ele_start: pybmad._pybmad.EleStruct, ele: pybmad._pybmad.EleStruct, datum: pybmad._pybmad.TaoDataStruct, branch: pybmad._pybmad.BranchStruct, orbit: pybmad._pybmad.CoordStructArray1D) -> None

Wrapper for Fortran routine tao_scratch_values_calc

Parameters:

tao_set_beam_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_beam_cmd(who: str, value_str: str, branch_str: str) -> None

Subroutine tao_set_beam_cmd (who, value_str, branch_str)

Routine to set various beam parameters.

Parameters:
  • who (str) –

    which parameter to set.

  • value_str (str) –

    Value to set to.

  • branch_str (str) –

    Branch to use. '' => branch 0.

tao_set_beam_init_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_beam_init_cmd(who: str, value_str: str, branch_str: str) -> None

Subroutine tao_set_beam_init_cmd (who, value_str, branch_str)

Routine to set beam_init variables

Parameters:
  • who (str) –

    which beam_init variable to set

  • value_str (str) –

    Value to set to.

  • branch_str (str) –

    Branch to use. '' => branch 0

tao_set_bmad_com_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_bmad_com_cmd(who: str, value_str: str) -> None

Subroutine tao_set_bmad_com_cmd (who, value_str)

Routine to set bmad_com variables

Parameters:
  • who (str) –

    which bmad_com variable to set

  • value_str (str) –

    Value to set to.

tao_set_branch_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_branch_cmd(branch_str: str, component_str: str, value_str: str) -> None

Subroutine tao_set_branch_cmd (branch_str, component_str, value_str)

Routine to set lattice branch values.

Parameters:
  • branch_str (str) –

    Which branch to set.

  • component_str (str) –

    Which branch parameter to set.

  • value_str (str) –

    What value to set it to.

tao_set_calculate_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_calculate_cmd(switch_: str | None = None) -> None

Subroutine tao_set_calculate_cmd (switch)

Toggles off lattice calc and plotting.

tao_set_curve_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_curve_cmd(curve_name: str, component: str, value_str: str) -> None

Subroutine tao_set_curve_cmd (curve_name, component, value_str)

Routine to set var values.

Parameters:
  • curve_name (str) –

    Which curve to set.

  • component (str) –

    Which component to set.

  • value_str (str) –

    What value to set it to.

tao_set_curve_invalid

Fortran source: tao/code/tao_graph_setup_mod.f90

tao_set_curve_invalid(curve: pybmad._pybmad.TaoCurveStruct, why_invalid: str, print_err: bool | None = None) -> None

Subroutine tao_set_curve_invalid (curve, why_invalid, print_err)

Routine to set curve%valid to False.

Parameters:
  • curve (TaoCurveStruct) –

    Curve to set. This parameter is an input/output and is modified in-place. As an output, curve: Curve properly set.

  • why_invalid (str) –

    Invalid information.

  • print_err (bool) –

    If present and True then also print an error message.

tao_set_data_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_data_cmd(who_str: str, value_str: str, silent: bool | None = None) -> None

Subroutine tao_set_data_cmd (who_str, value_str, silent)

Routine to set data values.

Parameters:
  • who_str (str) –

    Which data component(s) to set.

  • value_str (str) –

    What value to set it to.

tao_set_data_useit_opt

Fortran source: tao/code/tao_interface.f90

tao_set_data_useit_opt(data: pybmad._pybmad.TaoDataStructArray1D | None = None) -> None

Wrapper for Fortran routine tao_set_data_useit_opt

Parameters:
  • data (1D array of TaoDataStruct) –

    Data to work on. Default is all data in all universes.

tao_set_default_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_default_cmd(who_str: str, value_str: str) -> None

Subroutine tao_set_default_cmd (who_str, value_str)

Routine to set default values.

Parameters:
  • who_str (str) –

    Which default component(s) to set.

  • value_str (str) –

    What value to set it to.

tao_set_drawing_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_drawing_cmd(drawing: pybmad._pybmad.TaoDrawingStruct, component: str, value_str: str) -> None

Subroutine tao_set_drawing_cmd (drawing, component, value_str)

Routine to set floor_plan and lat_layout parameters.

Parameters:
  • drawing (TaoDrawingStruct) –

    s.plot_page.floor_plan or s.plot_page.lat_layout.

  • component (str) –

    Which shape component to set.

  • value_str (str) –

    Value to set to.

tao_set_dynamic_aperture_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_dynamic_aperture_cmd(who: str, value_str: str) -> None

Subroutine tao_set_dynamic_aperture_cmd (who, value_str)

Sets dynamic aperture parameters.

Parameters:
  • who (str) –

    which parameter to set.

  • value_str (str) –

    Value to set to.

tao_set_elements_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_elements_cmd(ele_list: str, attribute: str, value: str, update: bool) -> None

Subroutine tao_set_elements_cmd (ele_list, attribute, value, update)

Sets element parameters.

Parameters:
  • ele_list (str) –

    which elements.

  • attribute (str) –

    Attribute to set.

  • value (str) –

    Value to set.

tao_set_floor_plan_axis_label

Fortran source: tao/code/tao_plot_mod.f90

tao_set_floor_plan_axis_label(graph: pybmad._pybmad.TaoGraphStruct, axis_in: pybmad._pybmad.QpAxisStruct, axis_out: pybmad._pybmad.QpAxisStruct, which: str) -> None

Wrapper for Fortran routine tao_set_floor_plan_axis_label

Parameters:

tao_set_geodesic_lm_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_geodesic_lm_cmd(who: str, value_str: str) -> None

Subroutine tao_set_geodesic_lm_cmd (who, value_str)

Routine to set geodesic_lm variables

Parameters:
  • who (str) –

    which geodesic_lm variable to set

  • value_str (str) –

    Value to set to.

tao_set_global_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_global_cmd(who: str, value_str: str) -> None

Subroutine tao_set_global_cmd (who, value_str)

Routine to set global variables

Parameters:
  • who (str) –

    which global variable to set

  • value_str (str) –

    Value to set to.

tao_set_graph_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_graph_cmd(graph_name: str, component: str, value_str: str) -> None

Subroutine tao_set_graph_cmd (graph_name, component, value_str)

Routine to set var values.

Parameters:
  • graph_name (str) –

    Which graph to set.

  • component (str) –

    Which component to set.

  • value_str (str) –

    What value to set it to.

tao_set_integer_value

Fortran source: tao/code/tao_set_mod.f90

tao_set_integer_value(var_str: str, value_str: str, min_val: typing.SupportsInt | typing.SupportsIndex | None = None, max_val: typing.SupportsInt | typing.SupportsIndex | None = None, print_err: bool | None = None) -> pybmad._pybmad.TaoSetIntegerValue

Subroutine tao_set_integer_value (var, var_str, value_str, error, min_val, max_val, print_err)

Subroutine to read and set the value of an integer varialbe.

If the value is out of the range [min_val, max_val] then an error message will be generated and the variable will not be set.

Parameters:
  • var_str (str) –

    Used for error messages.

  • value_str (str) –

    String with encoded value.

  • min_val (int) –

    Minimum value.

  • max_val (int) –

    Maximum value.

  • print_err (bool) –

    If True, print error message. Default is true

Returns:
  • var( int ) –

    Variable to set.

  • error( bool ) –

    Set True on an error. False otherwise.

tao_set_invalid

Fortran source: tao/code/tao_interface.f90

tao_set_invalid(datum: pybmad._pybmad.TaoDataStruct, message: str, exterminate: bool | None = None, err_level: typing.SupportsInt | typing.SupportsIndex | None = None, print_err: bool | None = None) -> str

Wrapper for Fortran routine tao_set_invalid

Parameters:
  • datum (TaoDataStruct) –

    Bad datum.

  • message (str) –

    Error message.

  • exterminate (bool) –

    Default is False. If True, set datum.exists to False so that Tao will ignore this datum from now on.

  • err_level (int) –

    s_error$ (default), s_warn$, etc.

  • print_err (bool) –

    Default is True. If False, do not print an error message.

Returns:
  • why_invalid( (str, optional) ) –

    Set to message if present.

tao_set_key_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_key_cmd(key_str: str, cmd_str: str) -> None

Subroutine tao_set_key_cmd (key_str, cmd_str)

Associates a command with a key press for single mode.

Parameters:
  • key_str (str) –

    keyboard key.

  • cmd_str (str) –

    Command associated with key.

tao_set_lattice_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_lattice_cmd(dest_lat: str, source_lat: str) -> None

Subroutine tao_set_lattice_cmd (dest_lat, source_lat)

Sets a lattice equal to another. This will also update the data structs

Parameters:
  • dest_lat (str) –

    Maybe: 'model', 'design', or 'base' with optional '@n' at beginning to indicate the universe

  • source_lat (str) –

    Maybe: 'model', 'design', or 'base'

tao_set_logical_value

Fortran source: tao/code/tao_set_mod.f90

tao_set_logical_value(var_str: str, value_str: str) -> pybmad._pybmad.TaoSetLogicalValue

Subroutine tao_set_logical_value (var, var_str, value_str, error)

Subroutine to read and set the value of an logical varialbe.

If the value is out of the range [min_val, max_val] then an error message will be generated and the variable will not be set.

Parameters:
  • var_str (str) –

    Used for error messages.

  • value_str (str) –

    String with encoded value.

Returns:
  • var( bool ) –

    Variable to set.

  • error( bool ) –

    Set True on an error. False otherwise.

tao_set_openmp_n_threads

Fortran source: tao/code/tao_set_mod.f90

tao_set_openmp_n_threads(n_threads: typing.SupportsInt | typing.SupportsIndex) -> None

Subroutine tao_set_openmp_n_threads (n_threads)

Routine to set OpenMP thread count. Errors if OpenMP is not available.

Parameters:
  • n_threads (int) –

    Number of threads.

tao_set_opt_vars

Fortran source: tao/code/tao_interface.f90

tao_set_opt_vars(var_vec: pybmad._pybmad.RealArray1D, print_limit_warning: bool | None = None) -> None

Wrapper for Fortran routine tao_set_opt_vars

Parameters:
  • var_vec (1D array of float) –

    Vector of variables.

  • print_limit_warning (bool) –

    Print a warning if the value is past the variable's limits. Default is True.

tao_set_opti_de_param_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_opti_de_param_cmd(who: str, value_str: str) -> None

Subroutine tao_set_opti_de_param_cmd (who, value_str)

Routine to set opti_de_param variables

Parameters:
  • who (str) –

    which opti_de_param variable to set

  • value_str (str) –

    Value to set to.

tao_set_particle_start_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_particle_start_cmd(who: str, value_str: str) -> None

Subroutine tao_set_particle_start_cmd (who, value_str)

Routine to set particle_start variables.

Parameters:
  • who (str) –

    which particle_start variable to set

  • value_str (str) –

    Value to set to.

tao_set_plot_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_plot_cmd(plot_name: str, component: str, value_str: str) -> None

Subroutine tao_set_plot_cmd (plot_name, component, value_str)

Routine to set plot parameters.

Parameters:
  • plot_name (str) –

    Which plot to set.

  • component (str) –

    Which component to set.

  • value_str (str) –

    What value to set it to.

tao_set_plot_page_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_plot_page_cmd(component: str, value_str: str, value_str2: str | None = None) -> None

Subroutine tao_set_plot_page_cmd (component, value_str, value_str2)

Set various aspects of the plotting window

Parameters:
  • component (str) –

    Which component to set.

  • value_str (str) –

    What value to set to.

  • value_str2 (str) –

    2nd value if component is an array.

tao_set_ptc_com_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_ptc_com_cmd(who: str, value_str: str) -> None

Subroutine tao_set_ptc_com_cmd (who, value_str)

Routine to set ptc_com variables

Parameters:
  • who (str) –

    which ptc_com variable to set

  • value_str (str) –

    Value to set to.

tao_set_qp_axis_struct

Fortran source: tao/code/tao_set_mod.f90

tao_set_qp_axis_struct(qp_axis_name: str, component: str, qp_axis: pybmad._pybmad.QpAxisStruct, value: str) -> pybmad._pybmad.TaoSetQpAxisStruct

Subroutine tao_set_qp_axis_struct (qp_axis_name, component, qp_axis, value, error, ix_uni)

Routine to set qp_axis_names of a qp_axis_struct.

Parameters:
  • qp_axis_name (str) –

    qp_axis name. Used for error messages.

  • component (str) –

    qp_axis component name.

  • qp_axis (QpAxisStruct) –

    qp_axis_struct with component to modify This parameter is an input/output and is modified in-place. As an output, qp_axis: qp_axis_struct with changed component value.

  • value (str) –

    Component value.

Returns:
  • error( bool ) –

    Set true if there is an error. False otherwise.

  • ix_uni( (int, optional) ) –

    Tao universe number in case the value depends upon a parameter of a particular universe.

tao_set_qp_point_struct

Fortran source: tao/code/tao_set_mod.f90

tao_set_qp_point_struct(qp_point_name: str, component: str, qp_point: pybmad._pybmad.QpPointStruct, value: str) -> pybmad._pybmad.TaoSetQpPointStruct

Subroutine tao_set_qp_point_struct (qp_point_name, component, qp_point, value, error, ix_uni)

Routine to set qp_point_names of a qp_point_struct.

Parameters:
  • qp_point_name (str) –

    qp_point name. Used for error messages.

  • component (str) –

    qp_point component name.

  • qp_point (QpPointStruct) –

    qp_point_struct with component to modify This parameter is an input/output and is modified in-place. As an output, qp_point: qp_point_struct with changed component value.

  • value (str) –

    Component value.

Returns:
  • error( bool ) –

    Set true if there is an error. False otherwise.

  • ix_uni( (int, optional) ) –

    Tao universe number in case the value depends upon a parameter of a particular universe.

tao_set_qp_rect_struct

Fortran source: tao/code/tao_set_mod.f90

tao_set_qp_rect_struct(qp_rect_name: str, component: str, qp_rect: pybmad._pybmad.QpRectStruct, value: str) -> pybmad._pybmad.TaoSetQpRectStruct

Subroutine tao_set_qp_rect_struct (qp_rect_name, component, qp_rect, value, error, ix_uni)

Routine to set qp_rect_names of a qp_rect_struct.

Parameters:
  • qp_rect_name (str) –

    qp_rect name. Used for error messages.

  • component (str) –

    qp_rect component name.

  • qp_rect (QpRectStruct) –

    qp_rect_struct with component to modify This parameter is an input/output and is modified in-place. As an output, qp_rect: qp_rect_struct with changed component value.

  • value (str) –

    Component value.

Returns:
  • error( bool ) –

    Set true if there is an error. False otherwise.

  • ix_uni( (int, optional) ) –

    Tao universe number in case the value depends upon a parameter of a particular universe.

tao_set_ran_state_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_ran_state_cmd(state_string: str) -> None

Subroutine tao_set_ran_state_cmd (state_string)

Sets the random number generator state.

Parameters:
  • state_string (str) –

    Encoded random number state.

tao_set_real_value

Fortran source: tao/code/tao_set_mod.f90

tao_set_real_value(var_str: str, value_str: str, min_val: typing.SupportsFloat | typing.SupportsIndex | None = None, max_val: typing.SupportsFloat | typing.SupportsIndex | None = None, dflt_uni: typing.SupportsInt | typing.SupportsIndex | None = None) -> pybmad._pybmad.TaoSetRealValue

Subroutine tao_set_real_value (var, var_str, value_str, error, min_val, max_val, dflt_uni)

Subroutine to read and set the value of a real variable.

If the value is out of the range [min_val, max_val] then an error message will be generated and the variable will not be set.

Parameters:
  • var_str (str) –

    Used for error messages.

  • value_str (str) –

    String with encoded value.

  • min_val (float) –

    Minimum value.

  • max_val (float) –

    Maximum value.

  • dflt_uni (int) –

    Default universe used to evaluate parameters.

Returns:
  • var( float ) –

    Variable to set.

  • error( bool ) –

    Set True on an error. False otherwise.

tao_set_region_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_region_cmd(region_name: str, component: str, value_str: str) -> None

Subroutine tao_set_region_cmd (region_name, component, value_str)

Routine to set region parameters.

Parameters:
  • region_name (str) –

    Which region to set.

  • component (str) –

    Which component to set.

  • value_str (str) –

    What value to set it to.

tao_set_space_charge_com_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_space_charge_com_cmd(who: str, value_str: str) -> None

Subroutine tao_set_space_charge_com_cmd (who, value_str)

Routine to set space_charge_com variables

Parameters:
  • who (str) –

    which space_charge_com variable to set

  • value_str (str) –

    Value to set to.

tao_set_symbolic_number_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_symbolic_number_cmd(sym_str: str, num_str: str | None = None, val: typing.SupportsFloat | typing.SupportsIndex | None = None) -> None

Subroutine tao_set_symbolic_number_cmd (sym_str, num_str, val)

Associates a given symbol with a given number. Note: Either num_str or val argument must be present.

Parameters:
  • sym_str (str) –

    Symbol.

  • num_str (str) –

    Symbol value expression.

  • val (float) –

    Value of symbol

tao_set_tune_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_tune_cmd(branch_str: str, mask_str: str, print_list: bool, qa_str: str, qb_str: str, delta_input: bool) -> None

Subroutine tao_set_tune_cmd (branch_str, mask_str, print_list, qa_str, qb_str, delta_input)

Routine to set the transverse tunes.

Parameters:
  • branch_str (str) –

    List of branches to apply tune set to.

  • mask_str (str) –

    List of quadrupoles to veto.

  • print_list (bool) –

    If True, print a list of elements varied and coefficients.

  • qa_str (str) –

    Expression for Qa tune.

  • qb_str (str) –

    Expression for Qb tune.

  • delta_input (bool) –

    If true then qa_str and qb_str are deltas from present tune.

tao_set_universe_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_universe_cmd(uni: str, who: str, what: str) -> None

Subroutine tao_set_universe_cmd (uni, who, what)

Sets a universe on or off, or sets the recalculate or twiss_calc logicals, etc.

Parameters:
  • uni (str) –

    which universe; 0 => current viewed universe

  • who (str) –

    "on", "off", "recalculate", "dynamic_aperture_calc", "one_turn_map_calc", or "twiss_calc"

  • what (str) –

    "on" or "off" for who = "dynamic_aperture_calc", "one_turn_map_calc" or "twiss_calc".

tao_set_var_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_var_cmd(var_str: str, value_str: str) -> None

Subroutine tao_set_var_cmd (var_str, value_str)

Routine to set var values.

Parameters:
  • var_str (str) –

    Which var name to set.

  • value_str (str) –

    What value to set it to.

tao_set_var_model_value

Fortran source: tao/code/tao_interface.f90

tao_set_var_model_value(var: pybmad._pybmad.TaoVarStruct, value: typing.SupportsFloat | typing.SupportsIndex, print_limit_warning: bool | None = None) -> None

Wrapper for Fortran routine tao_set_var_model_value

Parameters:
  • var (TaoVarStruct) –

    Variable to set

  • value (float) –

    Value to set to

  • print_limit_warning (bool) –

    Print a warning if the value is past the variable's limits. Default is True.

tao_set_var_useit_opt

Fortran source: tao/code/tao_interface.f90

tao_set_var_useit_opt() -> None

Wrapper for Fortran routine tao_set_var_useit_opt

tao_set_wave_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_wave_cmd(who: str, value_str: str) -> bool

Subroutine tao_set_wave_cmd (who, value_str, err)

Routine to set wave variables

Parameters:
  • who (str) –

    which wave variable to set

  • value_str (str) –

    Value to set to.

Returns:
  • err( bool ) –

    Set True if there is an error. False otherwise.

tao_set_z_tune_cmd

Fortran source: tao/code/tao_set_mod.f90

tao_set_z_tune_cmd(branch_str: str, q_str: str, delta_input: bool) -> None

Subroutine tao_set_z_tune_cmd (branch_str, q_str, delta_input)

Routine to set the z-tune.

Parameters:
  • branch_str (str) –

    List of branches to apply tune set to.

  • q_str (str) –

    Expression for Qc tune.

  • delta_input (bool) –

    If true then qa_str and qb_str are deltas from present tune.

tao_setup_key_table

Fortran source: tao/code/tao_interface.f90

tao_setup_key_table() -> None

Wrapper for Fortran routine tao_setup_key_table

tao_shape_init

Fortran source: tao/code/tao_interface.f90

tao_shape_init(shape: pybmad._pybmad.TaoEleShapeStruct, print_err: bool | None = None) -> bool

Wrapper for Fortran routine tao_shape_init

Parameters:
  • shape (TaoEleShapeStruct) –

    Shape

  • print_err (bool) –

    If True then print an error message if there is a problem. Default is True.

Returns:
  • err( bool ) –

    Set true if there is a problem translating the element class.

tao_show_cmd

Fortran source: tao/code/tao_interface.f90

tao_show_cmd(what: str) -> None

Wrapper for Fortran routine tao_show_cmd

Parameters:
  • what (str) –

    What to show.

tao_show_constraints

Fortran source: tao/code/tao_top10_mod.f90

tao_show_constraints(iunit: typing.SupportsInt | typing.SupportsIndex, form: str) -> None

Subroutine tao_show_constraints (iunit, form)

Routine to show a list of datums and variables and how they contribute to the merit function.

Parameters:
  • iunit (int) –

    File unit to write to. 0 => print to the terminal.

  • form (str) –

    What to output: 'ALL' -> All datums and variables. 'TOP10' -> Top datums and variables that contribute to the merit function.

tao_show_this

Fortran source: tao/code/tao_interface.f90

tao_show_this(what: str) -> pybmad._pybmad.TaoShowThis

Wrapper for Fortran routine tao_show_this

Parameters:
  • what (str) –

    What to show.

Returns:
  • result_id( str ) –

    ID string idendifying what was shown. Used by the Tao GUI.

  • lines( 1D array of str ) –

    Output.

  • nl( int ) –

    Number of lines(:).

tao_single_mode

Fortran source: tao/code/tao_interface.f90

tao_single_mode(char_: str) -> None

Wrapper for Fortran routine tao_single_mode

tao_single_track

Fortran source: tao/code/tao_lattice_calc_mod.f90

tao_single_track(tao_lat: pybmad._pybmad.TaoLatticeStruct, ix_branch: typing.SupportsInt | typing.SupportsIndex, print_err: bool | None = None) -> bool

Subroutine tao_single_track (tao_lat, calc_ok, ix_branch, print_err)

Routine to track a single particle and calculate lattice functions through a lattice.

Parameters:
  • tao_lat (TaoLatticeStruct) –

    Structure containing the lattice.

  • ix_branch (int) –

    Branch index to track through.

  • print_err (bool) –

    Default False. Print error messages if, eg, lattice is unstable?

Returns:
  • calc_ok( bool ) –

    Set True if there were no problems, False otherwise.

tao_spin_matrices_calc_needed

Fortran source: tao/code/tao_interface.f90

tao_spin_matrices_calc_needed(data_type: str, data_source: str, do_calc: bool) -> None

Wrapper for Fortran routine tao_spin_matrices_calc_needed

Parameters:
  • data_type (str) –
  • data_source (str) –
  • do_calc (bool) –

tao_spin_tracking_turn_on

Fortran source: tao/code/tao_interface.f90

tao_spin_tracking_turn_on() -> None

Wrapper for Fortran routine tao_spin_tracking_turn_on

tao_split_component

Fortran source: tao/code/tao_interface.f90

tao_split_component(comp_str: str) -> pybmad._pybmad.TaoSplitComponent

Wrapper for Fortran routine tao_split_component

Parameters:
  • comp_str (str) –

    Components. EG: 'meas - design'

Returns:
  • comp( 1D array of TaoDataVarComponentStruct ) –

    Array of individual components.

  • err( bool ) –

    Set True if there is an error, False otherwise.

tao_srdt_calc_needed

Fortran source: tao/code/tao_interface.f90

tao_srdt_calc_needed(data_type: str, data_source: str, do_srdt: typing.SupportsInt | typing.SupportsIndex) -> None

Wrapper for Fortran routine tao_srdt_calc_needed

Parameters:
  • data_type (str) –
  • data_source (str) –
  • do_srdt (int) –

tao_subin_uni_number

Fortran source: tao/code/tao_interface.f90

tao_subin_uni_number(name_in: str, ix_uni: typing.SupportsInt | typing.SupportsIndex) -> pybmad._pybmad.TaoSubinUniNumber

Wrapper for Fortran routine tao_subin_uni_number

Parameters:
  • name_in (str) –

    Input name with "#" character

  • ix_uni (int) –

    Universe index.

Returns:
  • name_out( str ) –

    Output name.

  • ok( bool ) –

    False if multiple universes and no "#" in name_in. True otherwise.

tao_svd_optimizer

Fortran source: tao/code/tao_svd_optimizer_mod.f90

tao_svd_optimizer() -> bool

Subroutine tao_svd_optimizer (abort)

Routine to minimize the merit function using svd.

Returns:
  • abort( bool ) –

    Set True if svd step increases the merit function.

tao_symbol_import_from_lat

Fortran source: tao/code/tao_interface.f90

tao_symbol_import_from_lat(lat: pybmad._pybmad.LatStruct) -> None

Wrapper for Fortran routine tao_symbol_import_from_lat

Parameters:

tao_taper_cmd

Fortran source: tao/code/tao_interface.f90

tao_taper_cmd(except_: str, uni_names: str) -> None

Wrapper for Fortran routine tao_taper_cmd

Parameters:
  • except (str) –

    List of elements not to vary.

  • uni_names (str) –

    Universes to taper.

tao_to_change_number

Fortran source: tao/code/tao_change_mod.f90

tao_to_change_number(num_str: str, n_size: typing.SupportsInt | typing.SupportsIndex, change_number: pybmad._pybmad.RealAlloc1D, abs_or_rel: str, err: bool) -> None

Wrapper for Fortran routine tao_to_change_number

Parameters:
  • num_str (str) –
  • n_size (int) –
  • change_number (1D array of float) –
  • abs_or_rel (str) –
  • err (bool) –

tao_to_int

Fortran source: tao/code/tao_data_and_eval_mod.f90

tao_to_int(str: str, i_int: typing.SupportsInt | typing.SupportsIndex, err: bool) -> None

Subroutine tao_to_int (str, i_int, err)

Converts a string to an integer

If the string str is blank then i_int = 0

tao_to_phase_and_coupling_reading

Fortran source: tao/code/tao_data_and_eval_mod.f90

tao_to_phase_and_coupling_reading(ele: pybmad._pybmad.EleStruct, why_invalid: str, datum: pybmad._pybmad.TaoDataStruct) -> pybmad._pybmad.TaoToPhaseAndCouplingReading

Subroutine tao_to_phase_and_coupling_reading (ele, bpm_data, valid_value)

Buffer routine for to_phase_and_coupling_reading.

Parameters:
Returns:

tao_to_real

Fortran source: tao/code/tao_interface.f90

tao_to_real(expression: str) -> pybmad._pybmad.TaoToReal

Wrapper for Fortran routine tao_to_real

Parameters:
  • expression (str) –

    arithmetic expression

Returns:
  • value( float ) –

    Value of arithmetic expression.

  • err_flag( bool ) –

    TRUE on error.

tao_too_many_particles_lost

Fortran source: tao/code/tao_lattice_calc_mod.f90

tao_too_many_particles_lost(beam: pybmad._pybmad.BeamStruct, no_beam: bool) -> None

Wrapper for Fortran routine tao_too_many_particles_lost

Parameters:

tao_top10_derivative_print

Fortran source: tao/code/tao_top10_mod.f90

tao_top10_derivative_print() -> None

Subroutine tao_top10_derivative_print ()

Routine to print out the top10 contributors to the merit function.

tao_top10_merit_categories_print

Fortran source: tao/code/tao_top10_mod.f90

tao_top10_merit_categories_print(iunit: typing.SupportsInt | typing.SupportsIndex) -> None

Subroutine tao_top10_merit_categories_print (iunit)

Routine to print the top data and variable categories that contribute to the merit function.

Parameters:
  • iunit (int) –

    File unit to write to. 0 => print to the terminal.

tao_top_level

Fortran source: tao/code/tao_interface.f90

tao_top_level(command: str | None = None) -> int

Wrapper for Fortran routine tao_top_level

Parameters:
  • command (str) –

    Tao command string. If present, getting user input from the terminal is bypassed. This is used when interfacing to Python.

Returns:
  • errcode( (int, optional) ) –

    Return error code: 0 => OK, Not 0 => Err.

tao_tracking_ele_index

Fortran source: tao/code/tao_data_and_eval_mod.f90

tao_tracking_ele_index(ele: pybmad._pybmad.EleStruct, datum: pybmad._pybmad.TaoDataStruct) -> pybmad._pybmad.TaoTrackingEleIndex

Function tao_tracking_ele_index(ele, datum, ix_branch) result (ix_ele)

Routine to return the index in the tracking part of a lattice that corresponds to ele.

Parameters:
Returns:
  • ix_ele( int ) –

    Element index associated with ele.

  • ix_branch( (int, optional) ) –

    Lattice branch associated with element

tao_turn_on_special_calcs_if_needed_for_plotting

Fortran source: tao/code/tao_interface.f90

tao_turn_on_special_calcs_if_needed_for_plotting() -> None

Wrapper for Fortran routine tao_turn_on_special_calcs_if_needed_for_plotting

tao_type_expression_tree

Fortran source: tao/code/tao_expression_tree_mod.f90

tao_type_expression_tree(tree: pybmad._pybmad.TaoEvalNodeStruct, indent: typing.SupportsInt | typing.SupportsIndex | None = None) -> None

Subroutine tao_type_expression_tree (tree, indent)

Routine to print an expression tree in tree form. Good for debugging.

Parameters:
  • tree (TaoEvalNodeStruct) –

    Tree to print.

  • indent (int) –

    Initial indent. Default is zero.

tao_uni_atsign_index

Fortran source: tao/code/tao_interface.f90

tao_uni_atsign_index(string: str) -> int

Function tao_uni_atsign_index(string) result (ix_amp)

Routine to return the index of an atsign ("@") character in a string if the atsign is being used as a separator between a universe spec and the rest of the string.

For example: string = "[1:3]@orbit.x[5] => ix_amp = 6 string = "orbit.x[5@0.2] => ix_amp = 0 (no universe "@" present)

Parameters:
  • string (str) –

    String to parse

Returns:
  • ix_amp( int ) –

    Index of universe "@". Set to zero if no universe "@" found.

tao_universe_index

Fortran source: tao/code/tao_interface.f90

tao_universe_index(i_uni: typing.SupportsInt | typing.SupportsIndex, neg2_to_default: bool | None = None) -> int

Wrapper for Fortran routine tao_universe_index

Parameters:
  • i_uni (int) –

    Nominal universe number.

  • neg2_to_default (bool) –

    i_uni = -2 (all universes) maps to the default uni? Default if False.

Returns:
  • i_this_uni( int ) –

    Universe number.

tao_use_data

Fortran source: tao/code/tao_interface.f90

tao_use_data(action: str, data_name: str) -> None

Wrapper for Fortran routine tao_use_data

Parameters:
  • action (str) –

    veto, use or restore

  • data_name (str) –

    the selected data

tao_use_var

Fortran source: tao/code/tao_interface.f90

tao_use_var(action: str, var_name: str) -> None

Wrapper for Fortran routine tao_use_var

Parameters:
  • action (str) –

    'use', 'veto', or 'restore'

  • var_name (str) –

    the selected variable name or all

tao_user_is_terminating_optimization

Fortran source: tao/code/tao_interface.f90

tao_user_is_terminating_optimization() -> bool

Wrapper for Fortran routine tao_user_is_terminating_optimization

Returns:
  • is_terminating( bool ) –

    Set True of '.' is detected. False otherwise.

tao_var1_name

Fortran source: tao/code/tao_interface.f90

tao_var1_name(var: pybmad._pybmad.TaoVarStruct) -> str

Wrapper for Fortran routine tao_var1_name

Parameters:
Returns:
  • var1_name( str ) –

    Appropriate name.

tao_var_attrib_name

Fortran source: tao/code/tao_interface.f90

tao_var_attrib_name(var: pybmad._pybmad.TaoVarStruct) -> str

Wrapper for Fortran routine tao_var_attrib_name

Parameters:
Returns:
  • var_attrib_name( str ) –

    Attribute list.

tao_var_check

Fortran source: tao/code/tao_interface.f90

tao_var_check(eles: pybmad._pybmad.ElePointerStructAlloc1D, attribute: str, silent: bool) -> None

Wrapper for Fortran routine tao_var_check

Parameters:
  • eles (1D array of ElePointerStruct) –

    Array of elements which have a changed attribute.

  • attribute (str) –

    Name of attribute changed.

  • silent (bool) –

    If True and the problem can be fixed, do not issue an error message.

tao_var_repoint

Fortran source: tao/code/tao_interface.f90

tao_var_repoint() -> None

Wrapper for Fortran routine tao_var_repoint

tao_var_show_use

Fortran source: tao/code/tao_interface.f90

tao_var_show_use(v1_var: pybmad._pybmad.TaoV1VarStruct, lines: pybmad._pybmad.CharacterAlloc1D | None = None, nl: typing.SupportsInt | typing.SupportsIndex | None = None) -> None

Wrapper for Fortran routine tao_var_show_use

Parameters:
  • v1_var (TaoV1VarStruct) –

    tao_v1_var_struct

  • lines (1D array of str) –
  • nl (int) –

tao_var_target_calc

Fortran source: tao/code/tao_interface.f90

tao_var_target_calc() -> None

Wrapper for Fortran routine tao_var_target_calc

tao_var_useit_plot_calc

Fortran source: tao/code/tao_interface.f90

tao_var_useit_plot_calc(graph: pybmad._pybmad.TaoGraphStruct, var: pybmad._pybmad.TaoVarStructArray1D) -> None

Wrapper for Fortran routine tao_var_useit_plot_calc

Parameters:

tao_var_write

Fortran source: tao/code/tao_top10_mod.f90

tao_var_write(out_file: str, show_good_opt_only: bool | None = None, tao_format: bool | None = None) -> None

Subroutine tao_var_write (out_file, show_good_opt_only, tao_format)

Routine to write the optimized variables. One file will be created for each universe. The created file will have three sections: 1) The variable values 2) The list of constraints. 3) A list of the top 10 constraints. If out_file = '' the information will be dumped to the terminal. In this case, only the variable values will be printed.

When tao_format = True, the output is in the form "set variable = " so the file can be used as a Tao command file. If tao_format = False, the format is suitable for inclusion in a Bmad lattice file.

Parameters:
  • out_file (str) –

    Name of output file. If blank. Ouput to the terminal.

  • show_good_opt_only (bool) –

    Write only the variables used in the optimization? Default is False.

  • tao_format (bool) –

    Output format. Default False. See above.

tao_veto_vars_with_zero_dmodel

Fortran source: tao/code/tao_dmerit_mod.f90

tao_veto_vars_with_zero_dmodel() -> None

Subroutine tao_veto_vars_with_zero_dmodel ()

Routine to veto all variables with zero effect on data used in the merit function.

tao_wave_analysis

Fortran source: tao/code/tao_wave_mod.f90

tao_wave_analysis(plot: pybmad._pybmad.TaoPlotStruct) -> None

Subroutine tao_wave_analysis (plot)

Routine to do a wave anaysis.

Parameters:
  • plot (TaoPlotStruct) –

    Plot region setup by tao_wave_cmd. This parameter is an input/output and is modified in-place. As an output, plot: Plot with wave analysis curves.

tao_wave_cmd

Fortran source: tao/code/tao_wave_mod.f90

tao_wave_cmd(curve_name: str, plot_place: str, err_flag: bool) -> None

Subroutine tao_wave_cmd (curve_name, plot_place, err_flag)

Routine to do the initial setup for wave plotting. The wave analysis is done by the routine tao_wave_analysis.

Parameters:
  • curve_name (str) –

    Character(*) curve for wave analysis.

  • plot_place (str) –

    Character(*) place on plot page to put the wave plot.

tao_wave_fit

Fortran source: tao/code/tao_wave_mod.f90

tao_wave_fit(curve: pybmad._pybmad.TaoCurveStruct, ix1: typing.SupportsInt | typing.SupportsIndex, n_dat: typing.SupportsInt | typing.SupportsIndex, coef: pybmad._pybmad.RealArray1D, rms: pybmad._pybmad.RealArray1D, f1: pybmad._pybmad.RealArray1D, f2: pybmad._pybmad.RealArray1D | None = None, f3: pybmad._pybmad.RealArray1D | None = None, f4: pybmad._pybmad.RealArray1D | None = None) -> None

Subroutine tao_wave_fit (curve, ix1, n_dat, coef, rms, f1, f2, f3, f4)

Routine for fitting the curve data to up to four functions using a least squares SVD fit.

Parameters:
  • curve (TaoCurveStruct) –

    Curve containing the data.

  • ix1 (int) –

    Index of first point in the data array.

  • n_dat (int) –

    Number of data points.

  • coef (1D array of float) –

    Fit coefficients.

  • rms (1D array of float) –

    Variances with rms(n_func+1) = sqrt(chi^2/n_dat).

  • f1 (1D array of float) –

    First fit function.

  • f2 (1D array of float) –

    Second fit function.

  • f3 (1D array of float) –

    third fit function.

  • f4 (1D array of float) –

    fourth fit function.

tao_write_cmd

Fortran source: tao/code/tao_interface.f90

tao_write_cmd(what: str) -> None

Wrapper for Fortran routine tao_write_cmd

Parameters:
  • what (str) –

    What to output. See the code for more details.

tao_write_lines

Fortran source: tao/code/tao_top10_mod.f90

tao_write_lines(iunit: typing.SupportsInt | typing.SupportsIndex, line: pybmad._pybmad.CharacterAlloc1D) -> None

Subroutine tao_write_lines (iunit, line)

Subroutine to write out a series of lines to a file or to the terminal. It is assumed that any file has already been opened.

Parameters:
  • iunit (int) –

    File unit to write to. 0 => print to the terminal.

  • line (1D array of str) –

    A series of lines.

tao_x_axis_cmd

Fortran source: tao/code/tao_interface.f90

tao_x_axis_cmd(where: str, what: str) -> None

Wrapper for Fortran routine tao_x_axis_cmd

Parameters:
  • where (str) –

    Region to axis. Eg: "top"

  • what (str) –

    "s" or "index"

tao_x_scale_cmd

Fortran source: tao/code/tao_x_scale_mod.f90

tao_x_scale_cmd(where: str, x_min_in: typing.SupportsFloat | typing.SupportsIndex, x_max_in: typing.SupportsFloat | typing.SupportsIndex, include_wall: bool | None = None, gang: str | None = None, exact: bool | None = None, turn_autoscale_off: bool | None = None) -> bool

Subroutine tao_x_scale_cmd (where, x_min_in, x_max_in, err, include_wall, gang, exact, turn_autoscale_off)

Routine to scale a plot. If x_min = x_max Then the scales will be chosen to show all the data.

Parameters:
  • where (str) –

    Region to scale. Eg: "top"

  • x_min_in (float) –

    Plot x-axis min value.

  • x_max_in (float) –

    Plot x-axis max value.

  • include_wall (bool) –

    Used for floor_plan plots where a building wall is drawn and y_min_in = y_max_in. If present and True include the building wall position will be included in determining the the scale.

  • gang (str) –

    'gang', 'nogang', ''. Default = ''.

  • exact (bool) –

    Exact plot y_max, y_min to correspond to y_min_in, y_max_in? Default is False. Only relavent when y_min_in /= y_max_in.

  • turn_autoscale_off (bool) –

    If True (default) then turn off plot.autoscale_x logical for all plots that are scaled.

Returns:
  • err( bool ) –

    Set to True if the plot cannot be found. False otherwise.

tao_x_scale_graph

Fortran source: tao/code/tao_x_scale_mod.f90

tao_x_scale_graph(graph: pybmad._pybmad.TaoGraphStruct, x_min: typing.SupportsFloat | typing.SupportsIndex, x_max: typing.SupportsFloat | typing.SupportsIndex, include_wall: bool | None = None, have_scaled: bool | None = None) -> None

Wrapper for Fortran routine tao_x_scale_graph

Parameters:
  • graph (TaoGraphStruct) –
  • x_min (float) –
  • x_max (float) –
  • include_wall (bool) –
  • have_scaled (bool) –

tao_x_scale_plot

Fortran source: tao/code/tao_x_scale_mod.f90

tao_x_scale_plot(plot: pybmad._pybmad.TaoPlotStruct, x_min_in: typing.SupportsFloat | typing.SupportsIndex, x_max_in: typing.SupportsFloat | typing.SupportsIndex, include_wall: bool | None = None, gang: str | None = None) -> bool

Subroutine tao_x_scale_plot (plot, x_min_in, x_max_in, include_wall, gang, have_scaled)

Routine to scale a plot. If x_min = x_max Then the scales will be chosen to show all the data.

Parameters:
  • plot (TaoPlotStruct) –

    Plot to scale. Eg: "top"

  • x_min_in (float) –

    Plot x-axis min value.

  • x_max_in (float) –

    Plot x-axis max value.

  • include_wall (bool) –

    Used for floor_plan plots where a building wall is drawn and y_min_in = y_max_in. If present and True include the building wall position will be included in determining the the scale.

  • gang (str) –

    'gang', 'nogang', ''. Default = ''.

Returns:
  • have_scaled( (bool, optional) ) –

    Has a graph been scaled?