Element and Lattice
Element
An Element aggregates all data for a single lattice element: head metadata,
general attributes, Twiss parameters, orbit, transfer matrix, floor
coordinates, multipoles, wake fields, chamber walls, and more.
Data is loaded on-demand via from_tao() or fill(), controlled by
defaults and per-field boolean flags. The class-level DEFAULTS set
determines which fields are loaded when defaults=True.
pytao.model.Element
Bases: TaoBaseModel
Represents a Tao element with various attributes used in simulations.
Each attribute marked with a default value may be filled in or updated on-demand.
Attributes:
| Name | Type | Description |
|---|---|---|
ele_id |
str
|
The element name or identifier. |
which |
"base", "model", or "design"
|
|
head |
ElementHead
|
The head data of the element. |
attrs |
GeneralAttributes or None, default=None
|
General attributes associated with the element. The information held
differs depending on the element's key (i.e., |
chamber_walls |
list[ElementChamberWall] or None, default=None
|
List of chamber walls. |
control_vars |
dict[str, float] or None, default=None
|
Dictionary of control variables with their corresponding current values. |
floor |
ElementFloorAll or None, default=None
|
Floor positions. |
grid_field |
list[ElementGridField] or None, default=None
|
List of grid field data. |
lord_slave |
list[tao_classes.ElementLordSlave] or None, default=None
|
List of lord-slave relationships. |
mat6 |
ElementMat6 or None, default=None
|
Mat6 (linear transfer map) information. |
multipoles |
AnyElementMultipoles or None, default=None
|
Multipoleattributes. |
orbit |
ElementOrbit or None, default=None
|
Orbit attributes. |
photon |
ElementPhoton or None, default=None
|
Photon attributes. |
twiss |
ElementTwiss or None, default=None
|
Twiss parameters. |
wake |
ElementWake or None, default=None
|
Wake attributes. |
wall3d |
list[ElementWall3D] or None, default=None
|
List of 3D walls. |
Attributes
pytao.model.Element.attribs
property
attribs
General attributes - name to value dictionary.
pytao.model.Element.id
property
id
The fully-qualified ElementID, including universe/branch/key.
pytao.model.Element.symplectic_error
property
symplectic_error
Symplectic error.
pytao.model.Element.vec0
property
vec0
0th order transport vector.
Functions
pytao.model.Element.fill
fill(tao, *, head=True, attrs=True, bunch_params=True, comb=False, control_vars=True, floor=True, lord_slave=True, photon=True, orbit=True, twiss=True, grid_field=True, grid_field_points=False, mat6=True, chamber_walls=True, wall3d=True, wall3d_table=False, multipoles=True, wake=True, comb_data=None, use_cache=True)
Fills various attributes of the Tao object based on the provided flags.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tao
|
Tao
|
The Tao instance to retrieve information from. |
required |
head
|
bool
|
Update the head attribute. |
True
|
attrs
|
bool
|
Fill attribute data. |
True
|
bunch_params
|
bool
|
Fill bunch parameters. |
True
|
comb
|
bool or None
|
Fill comb data. If available, pass in |
False
|
comb_data
|
Comb or None
|
Only relevant if |
None
|
control_vars
|
bool
|
Fill control variables. |
True
|
floor
|
bool
|
Fill the floor attribute. |
True
|
lord_slave
|
bool
|
Fill lord-slave relationships. |
True
|
photon
|
bool
|
Fill the photon attribute. |
True
|
orbit
|
bool
|
Fill orbit data. |
True
|
twiss
|
bool
|
Fill Twiss parameters. |
True
|
grid_field
|
bool
|
Fill grid field data. |
True
|
grid_field_points
|
bool
|
Fill grid field points data. Default is False. |
False
|
mat6
|
bool
|
Fill MAT6 data. |
True
|
chamber_walls
|
bool
|
Fill chamber wall data. |
True
|
wall3d
|
bool
|
Fill 3D wall data. |
True
|
wall3d_table
|
bool
|
Fill 3D wall table data. Default is False. |
False
|
multipoles
|
bool
|
Fill multipole data. |
True
|
wake
|
bool
|
Fill wake data. |
True
|
use_cache
|
bool
|
use cached data if available. Will not overwrite already-fetched data. |
True
|
Source code in pytao/model/ele/ele.py
2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 | |
pytao.model.Element.from_tao
classmethod
from_tao(tao, ele, *, which='model', defaults=True, attrs=FillDefault('attrs'), bunch_params=FillDefault('bunch_params'), chamber_walls=FillDefault('chamber_walls'), comb=FillDefault('comb'), control_vars=FillDefault('control_vars'), floor=FillDefault('floor'), grid_field=FillDefault('grid_field'), grid_field_points=FillDefault('grid_field_points'), lord_slave=FillDefault('lord_slave'), mat6=FillDefault('mat6'), multipoles=FillDefault('multipoles'), orbit=FillDefault('orbit'), photon=FillDefault('photon'), twiss=FillDefault('twiss'), wake=FillDefault('wake'), wall3d=FillDefault('wall3d'), wall3d_table=FillDefault('wall3d_table'), comb_data=None)
Create an Element by querying Tao.
Use defaults to fill the most commonly-used element information.
To disregard the defaults, individual items may be excluded by passing
False, or included by passing True.
Notes
Defaults for the data to query are set as follows:
from pytao.model import Element print(Element.DEFAULTS) {'attrs', 'bunch_params', 'chamber_walls', 'control_vars', 'floor', 'grid_field', 'lord_slave', 'mat6', 'multipoles', 'orbit', 'photon', 'twiss', 'wake', 'wall3d'}
With the following, the default will change to only query attrs:
Element.DEFAULTS = {"attrs"}
Examples:
Get an Element with the defaults (loads attrs, twiss, orbit, etc.):
>>> ele = Element.from_tao(tao, "1")
Get an Element but skip orbit calculations:
>>> ele = Element.from_tao(tao, "1", orbit=False)
Get an Element AND add comb data (usually off):
>>> ele = Element.from_tao(tao, "1", comb=True)
Get a minimal Element (disable everything explicit):
>>> ele = Element.from_tao(tao, "1", defaults=False)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tao
|
Tao
|
The Tao instance. |
required |
ele
|
int, str, or ElementID
|
The element identifier. |
required |
which
|
"base", "model", or "design"
|
Specifies which Tao lattice to use, by default "model". |
'model'
|
defaults
|
bool
|
Fill default items. Defaults are set by name in |
True
|
attrs
|
bool
|
Fill general attributes. |
FillDefault('attrs')
|
bunch_params
|
bool
|
Fill bunch parameters. |
FillDefault('bunch_params')
|
chamber_walls
|
bool
|
Fill chamber wall data. |
FillDefault('chamber_walls')
|
comb
|
bool
|
Fill comb data. If available, pass in |
False
|
comb_data
|
Comb or None
|
Only relevant if |
None
|
control_vars
|
bool
|
Fill control variables. |
FillDefault('control_vars')
|
floor
|
bool
|
Fill floor data. |
FillDefault('floor')
|
grid_field
|
bool
|
Fill grid field data. |
FillDefault('grid_field')
|
grid_field_points
|
bool
|
Fill grid field points data. |
False
|
lord_slave
|
bool
|
Fill lord-slave relationships. |
FillDefault('lord_slave')
|
mat6
|
bool
|
Fill mat6 data. |
FillDefault('mat6')
|
multipoles
|
bool
|
Fill multipole data. |
FillDefault('multipoles')
|
orbit
|
bool
|
Fill orbit data. |
FillDefault('orbit')
|
photon
|
bool
|
Fill photon data. |
FillDefault('photon')
|
twiss
|
bool
|
Fill twiss parameters. |
FillDefault('twiss')
|
wake
|
bool
|
Fill wake data. |
FillDefault('wake')
|
wall3d
|
bool
|
Fill 3D wall data. |
FillDefault('wall3d')
|
wall3d_table
|
bool
|
Fill 3D wall table data. |
FillDefault('wall3d_table')
|
Source code in pytao/model/ele/ele.py
1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 | |
Lattice
A Lattice is a tuple of Element objects with lookup dictionaries
by name, key (element type), and index.
pytao.model.Lattice
Bases: TaoBaseModel
A Bmad Lattice, or more commonly a single branch of a full lattice.
Attributes:
| Name | Type | Description |
|---|---|---|
which |
"base", "model", or "design"
|
|
elements |
tuple of Element
|
A tuple containing elements that make up the lattice. |
Attributes
pytao.model.Lattice.by_element_index
property
by_element_index
A dictionary of element index to Element.
pytao.model.Lattice.by_element_key
property
by_element_key
A dictionary of element key to list of Elements with that key.
pytao.model.Lattice.by_element_name
property
by_element_name
A dictionary of element name to Element.
Functions
pytao.model.Lattice.from_file
classmethod
from_file(filename, *, format=None)
Load Tao model data from a previously-written file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str or Path
|
|
required |
Returns:
| Type | Description |
|---|---|
Lattice
|
|
Source code in pytao/model/ele/ele.py
2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 | |
pytao.model.Lattice.from_tao_eles
classmethod
from_tao_eles(tao, eles, *, which='model', comb_data=None, comb=False, **kwargs)
Create a Lattice object from a list of element names, indices, or IDs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tao
|
Tao
|
|
required |
eles
|
list of int, str, or ElementID
|
Element names, indices, or identifiers. |
required |
which
|
"base", "model", or "design"
|
|
"model"
|
**kwargs
|
dict
|
Additional keyword arguments passed to |
{}
|
Returns:
| Type | Description |
|---|---|
Lattice
|
|
Source code in pytao/model/ele/ele.py
2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 | |
pytao.model.Lattice.from_tao_tracking
classmethod
from_tao_tracking(tao, *, track_start=None, track_end=None, which='model', orbit=True, twiss=True, ix_branch='', ix_uni='', **kwargs)
Create a Lattice object from tracking elements of the lattice.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tao
|
Tao
|
|
required |
which
|
"base", "model", or "design"
|
|
"model"
|
track_start
|
str
|
The first element to get information from (inclusive). Defaults to element 0. |
None
|
track_end
|
str
|
The last element to get information from (inclusive). Defaults to the last element in the lattice. |
None
|
orbit
|
bool
|
Orbit information is included by default. |
True
|
twiss
|
bool
|
Twiss information is included by default. |
True
|
ix_branch
|
str
|
Branch index, by default "" |
''
|
ix_uni
|
str
|
Universe index, by default "" |
''
|
**kwargs
|
dict
|
Additional keyword arguments passed to |
{}
|
Returns:
| Type | Description |
|---|---|
Lattice
|
|
Source code in pytao/model/ele/ele.py
2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 | |
pytao.model.Lattice.from_tao_unique
classmethod
from_tao_unique(tao, *, which='model', track_start=None, track_end=None, ix_branch='', ix_uni='', **kwargs)
Create a Lattice object from unique elements of the lattice.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tao
|
Tao
|
|
required |
which
|
"base", "model", or "design"
|
|
"model"
|
track_start
|
str
|
The first element to get information from (inclusive). Defaults to element 0. This does not need to be a unique element itself. |
None
|
track_end
|
str
|
The last element to get information from (inclusive). Defaults to the last element in the lattice. This does not need to be a unique element itself. |
None
|
ix_branch
|
str
|
Branch index, by default "" |
''
|
ix_uni
|
str
|
Universe index, by default "" |
''
|
**kwargs
|
dict
|
Additional keyword arguments passed to |
{}
|
Returns:
| Type | Description |
|---|---|
Lattice
|
|
Source code in pytao/model/ele/ele.py
2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 | |
ElementID
Parses and represents Tao's element identifier syntax, including universe, branch, key, name, match number, and offset.
pytao.model.ElementID
Bases: BaseModel
An element identifier, which breaks apart a Tao element identifier into its components.
An element "name" (which can match to multiple elements) in Tao can be of the form
{~}{uni@}{branch>>}{key::}ele_id{##N}{+/-offset}
where
| Syntax | Description |
|---|---|
~ |
Negation character. See below. |
key |
Optional key name ("quadrupole", "sbend", etc.) |
uni |
Index of universe. |
branch |
Name or index of branch. May contain the wild cards * and %. |
ele_id |
Name or index of element. May contain the wild cards * and %. |
| If a name and no branch is given, all branches are searched. | |
| If an index and no branch is given, branch 0 is assumed. | |
##N |
N = integer. N^th instance of ele_id in the branch. |
+/-offset |
Element offset. For example, Q1+1 is the element after Q1 and Q1-2 is the second element |
before Q1. Modulo arithmetic is used so the offset wraps around the ends of the lattice. |
|
EG: BEGINNING-1 gives the END element and END+1 gives the BEGINNING element. |
Note: An old syntax that is still supported is:
{key::}{branch>>}ele_id{##N}
An element range is of the form:
{key::}ele1:ele2
Where the range includes ele1 and ele2, and:
| Parameter | Description |
|---|---|
key |
Optional key name ("quadrupole", "sbend", etc.). Also key may be "type", "alias", or "descrip" |
| in which case the %type, %alias, or %descrip field is matched to instead of the element name. | |
ele1 |
Starting element of the range. |
ele2 |
Ending element of the range. |
Attributes
pytao.model.ElementID.tao_string
property
tao_string
This element represented in Tao command-line interface string form.
pytao.model.ElementID.without_universe
property
without_universe
This element ID, excluding the universe number.
Some Tao commands such as 'show lat' do not accept a universe number.
Returns:
| Type | Description |
|---|---|
ElementID
|
|
Functions
pytao.model.ElementID.from_tao
classmethod
from_tao(value)
Construct an ElementID from the Tao string representation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
ElementID
|
|
Source code in pytao/model/ele/ele.py
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 | |
pytao.model.ElementID.from_tao_any
classmethod
from_tao_any(value, *, split_range=False)
Create the most appropriate instance of an Element class for the given Tao element string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
A string representing an element identifier, a list of elements, or an intersection of elements. |
required |
Returns:
| Type | Description |
|---|---|
ElementID, ElementList, or ElementIntersection
|
|
Source code in pytao/model/ele/ele.py
453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 | |
pytao.model.ElementID.from_tao_old_syntax
classmethod
from_tao_old_syntax(value)
Convert a Tao old syntax Element identifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
ElementID
|
|
Source code in pytao/model/ele/ele.py
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 | |
GeneralAttributes
Dynamic container for element-type-specific attributes (e.g., L, K1,
angle). Supports case-insensitive access. Each attribute is an Attr
with name, data, units, type, and a settable flag.
pytao.model.GeneralAttributes
Bases: TaoModel
Element Sub-Models
These are the data classes that populate the fields of Element.
ElementHead
pytao.model.ElementHead
Bases: TaoModel
Structure which corresponds to Tao pipe ele:head 1, for example.
Attributes:
| Name | Type | Description |
|---|---|---|
alias |
str
|
Another name. |
descrip |
str
|
Description string. |
has_ab_multipoles |
bool
|
|
has_ac_kick |
bool
|
|
has_control |
bool
|
|
has_floor |
bool
|
|
has_kt_multipoles |
bool
|
|
has_lord_slave |
bool
|
|
has_mat6 |
bool
|
|
has_methods |
bool
|
|
has_multipoles_elec |
bool
|
|
has_photon |
bool
|
|
has_spin_taylor |
bool
|
|
has_taylor |
bool
|
|
has_twiss |
bool
|
|
has_wake |
bool
|
|
has_wall3d |
int
|
|
is_on |
bool
|
For turning element on/off. |
ix_branch |
int
|
Index in lat%branch(:) array. Note: lat%ele => lat%branch(0). |
ix_ele |
int
|
Index in branch ele(0:) array. Set to ix_slice_slave$ = -2 for |
slice_slave$ elements. |
|
|
key |
str
|
Element class (quadrupole, etc.). |
name |
str
|
name of element. |
num_cartesian_map |
int
|
|
num_cylindrical_map |
int
|
|
num_gen_grad_map |
int
|
|
num_grid_field |
int
|
|
ref_time |
float
|
Time ref particle passes exit end. |
s |
float
|
longitudinal ref position at the exit end. |
s_start |
float
|
longitudinal ref position at entrance_end |
type |
str
|
type name. |
universe |
int
|
|
ElementTwiss
pytao.model.ElementTwiss
Bases: TaoModel
Structure which corresponds to Tao pipe ele:twiss 1, for example.
Attributes:
| Name | Type | Description |
|---|---|---|
alpha_a |
float
|
|
alpha_b |
float
|
|
beta_a |
float
|
|
beta_b |
float
|
|
dalpha_dpz_a |
float
|
|
dalpha_dpz_b |
float
|
|
dbeta_dpz_a |
float
|
|
dbeta_dpz_b |
float
|
|
deta_dpz_a |
float
|
|
deta_dpz_b |
float
|
|
deta_dpz_x |
float
|
|
deta_dpz_y |
float
|
|
deta_ds_a |
float
|
|
deta_ds_b |
float
|
|
deta_dsx |
float
|
|
deta_dsy |
float
|
|
detap_dpz_a |
float
|
|
detap_dpz_b |
float
|
|
detap_dpz_x |
float
|
|
detap_dpz_y |
float
|
|
eta_a |
float
|
|
eta_b |
float
|
|
eta_x |
float
|
|
eta_y |
float
|
|
etap_a |
float
|
|
etap_b |
float
|
|
etap_x |
float
|
|
etap_y |
float
|
|
gamma_a |
float
|
|
gamma_b |
float
|
|
mode_flip |
bool
|
|
phi_a |
float
|
|
phi_b |
float
|
|
ElementOrbit
pytao.model.ElementOrbit
Bases: TaoModel
Structure which corresponds to Tao pipe ele:orbit 1, for example.
Attributes:
| Name | Type | Description |
|---|---|---|
beta |
float
|
Velocity / c_light. |
charge |
float
|
Macroparticle weight (which is different from particle species |
charge). For some space charge calcs the weight is in Coulombs. |
|
|
direction |
int
|
+1 or -1. Sign of longitudinal direction of motion (ds/dt). This is |
independent of the element orientation. |
|
|
dt_ref |
float
|
Used in: * time tracking for computing z. * by coherent photons = |
path_length/c_light. |
|
|
field |
sequence of floats
|
Photon E-field intensity (x,y). |
ix_ele |
int
|
Index of the lattice element the particle is in. May be -1 if element |
is not associated with a lattice. |
|
|
location |
str
|
upstream_end$, inside$, or downstream_end$ |
p0c |
float
|
For non-photons: Reference momentum. For photons: Photon momentum (not |
reference). |
|
|
phase |
sequence of floats
|
Photon E-field phase (x,y). For charged particles, phase(1) is RF |
phase. |
|
|
px |
float
|
|
py |
float
|
|
pz |
float
|
|
s |
float
|
Longitudinal position |
species |
str
|
positron$, proton$, etc. |
spin |
sequence of floats
|
Spin. |
state |
str
|
alive$, lost$, lost_neg_x_aperture$, lost_pz$, etc. |
t |
float
|
Absolute time (not relative to reference). Note: Quad precision! |
x |
float
|
|
y |
float
|
|
z |
float
|
|
ElementMat6
pytao.model.ElementMat6
Bases: TaoModel
Linear transfer map (mat6) data.
Attributes:
| Name | Type | Description |
|---|---|---|
mat6 |
NDArray of shape (6, 6)
|
|
vec0 |
NDArray
|
|
symplectic_error |
float
|
|
ElementFloorAll
pytao.model.ElementFloorAll
Bases: TaoBaseModel
Element floor positions based on optical trajectory - at its beginning, center, or end.
Attributes:
| Name | Type | Description |
|---|---|---|
which |
"base", "model", or "design"
|
|
beginning |
ElementFloor
|
The element position at the beginning. |
center |
ElementFloor
|
The element position at its center. |
end |
ElementFloor
|
The element position at its end. |
ElementFloor
pytao.model.ElementFloor
Bases: TaoBaseModel
Represents the floor position of an element.
Attributes:
| Name | Type | Description |
|---|---|---|
which |
"base", "model", or "design"
|
|
where |
"beginning", "center", or "end"
|
The location or placement of the element on the floor. |
actual |
(ElementFloorPosition, optional)
|
The actual position of the element on the floor. |
reference |
(ElementFloorPosition, optional)
|
The reference position of the element on the floor. |
slaves |
dict[int, ElementFloorItem]
|
A mapping of integer slave numbers to ElementFloorItem instances. |
ElementFloorPosition
pytao.model.ElementFloorPosition
Bases: TaoBaseModel
Represents the position and orientation of an element on the floor in a 3D space.
Attributes:
| Name | Type | Description |
|---|---|---|
x |
float, default 0.0
|
The x-coordinate of the position. |
y |
float, default 0.0
|
The y-coordinate of the position. |
z |
float, default 0.0
|
The z-coordinate of the position. |
theta |
float, default 0.0
|
The rotation around the x-axis in radians. |
phi |
float, default 0.0
|
The rotation around the y-axis in radians. |
psi |
float, default 0.0
|
The rotation around the z-axis in radians. |
wmat |
list of list of float, default empty list
|
The transformation matrix representing the orientation of the element. |
ElementBunchParams
pytao.model.ElementBunchParams
Bases: TaoModel
Structure which corresponds to Tao pipe bunch_params 1, for example.
Attributes:
| Name | Type | Description |
|---|---|---|
beam_saved |
bool
|
|
centroid_beta |
float
|
|
centroid_p0c |
float
|
|
centroid_t |
float
|
|
centroid_vec_1 |
float
|
|
centroid_vec_2 |
float
|
|
centroid_vec_3 |
float
|
|
centroid_vec_4 |
float
|
|
centroid_vec_5 |
float
|
|
centroid_vec_6 |
float
|
|
charge_live |
float
|
Charge of all non-lost particle |
direction |
int
|
|
ix_ele |
int
|
Lattice element where params evaluated at. |
location |
str
|
Location in element: upstream_end$, inside$, or downstream_end$ |
n_particle_live |
int
|
Number of non-lost particles |
n_particle_lost_in_ele |
int
|
Number lost in element (not calculated by Bmad) |
n_particle_tot |
int
|
Total number of particles |
rel_max_1 |
float
|
|
rel_max_2 |
float
|
|
rel_max_3 |
float
|
|
rel_max_4 |
float
|
|
rel_max_5 |
float
|
|
rel_max_6 |
float
|
|
rel_min_1 |
float
|
|
rel_min_2 |
float
|
|
rel_min_3 |
float
|
|
rel_min_4 |
float
|
|
rel_min_5 |
float
|
|
rel_min_6 |
float
|
|
s |
float
|
Longitudinal position. |
sigma_11 |
float
|
|
sigma_12 |
float
|
|
sigma_13 |
float
|
|
sigma_14 |
float
|
|
sigma_15 |
float
|
|
sigma_16 |
float
|
|
sigma_21 |
float
|
|
sigma_22 |
float
|
|
sigma_23 |
float
|
|
sigma_24 |
float
|
|
sigma_25 |
float
|
|
sigma_26 |
float
|
|
sigma_31 |
float
|
|
sigma_32 |
float
|
|
sigma_33 |
float
|
|
sigma_34 |
float
|
|
sigma_35 |
float
|
|
sigma_36 |
float
|
|
sigma_41 |
float
|
|
sigma_42 |
float
|
|
sigma_43 |
float
|
|
sigma_44 |
float
|
|
sigma_45 |
float
|
|
sigma_46 |
float
|
|
sigma_51 |
float
|
|
sigma_52 |
float
|
|
sigma_53 |
float
|
|
sigma_54 |
float
|
|
sigma_55 |
float
|
|
sigma_56 |
float
|
|
sigma_61 |
float
|
|
sigma_62 |
float
|
|
sigma_63 |
float
|
|
sigma_64 |
float
|
|
sigma_65 |
float
|
|
sigma_66 |
float
|
|
sigma_t |
float
|
RMS of time spread. |
species |
str
|
|
t |
float
|
Time. |
twiss_alpha_a |
float
|
|
twiss_alpha_b |
float
|
|
twiss_alpha_c |
float
|
|
twiss_alpha_x |
float
|
|
twiss_alpha_y |
float
|
|
twiss_alpha_z |
float
|
|
twiss_beta_a |
float
|
|
twiss_beta_b |
float
|
|
twiss_beta_c |
float
|
|
twiss_beta_x |
float
|
|
twiss_beta_y |
float
|
|
twiss_beta_z |
float
|
|
twiss_dalpha_dpz_a |
float
|
|
twiss_dalpha_dpz_b |
float
|
|
twiss_dalpha_dpz_c |
float
|
|
twiss_dalpha_dpz_x |
float
|
|
twiss_dalpha_dpz_y |
float
|
|
twiss_dalpha_dpz_z |
float
|
|
twiss_dbeta_dpz_a |
float
|
|
twiss_dbeta_dpz_b |
float
|
|
twiss_dbeta_dpz_c |
float
|
|
twiss_dbeta_dpz_x |
float
|
|
twiss_dbeta_dpz_y |
float
|
|
twiss_dbeta_dpz_z |
float
|
|
twiss_deta_dpz_a |
float
|
|
twiss_deta_dpz_b |
float
|
|
twiss_deta_dpz_c |
float
|
|
twiss_deta_dpz_x |
float
|
|
twiss_deta_dpz_y |
float
|
|
twiss_deta_dpz_z |
float
|
|
twiss_deta_ds_a |
float
|
|
twiss_deta_ds_b |
float
|
|
twiss_deta_ds_c |
float
|
|
twiss_deta_ds_x |
float
|
|
twiss_deta_ds_y |
float
|
|
twiss_deta_ds_z |
float
|
|
twiss_detap_dpz_a |
float
|
|
twiss_detap_dpz_b |
float
|
|
twiss_detap_dpz_c |
float
|
|
twiss_detap_dpz_x |
float
|
|
twiss_detap_dpz_y |
float
|
|
twiss_detap_dpz_z |
float
|
|
twiss_emit_a |
float
|
|
twiss_emit_b |
float
|
|
twiss_emit_c |
float
|
|
twiss_emit_x |
float
|
|
twiss_emit_y |
float
|
|
twiss_emit_z |
float
|
|
twiss_eta_a |
float
|
|
twiss_eta_b |
float
|
|
twiss_eta_c |
float
|
|
twiss_eta_x |
float
|
|
twiss_eta_y |
float
|
|
twiss_eta_z |
float
|
|
twiss_etap_a |
float
|
|
twiss_etap_b |
float
|
|
twiss_etap_c |
float
|
|
twiss_etap_x |
float
|
|
twiss_etap_y |
float
|
|
twiss_etap_z |
float
|
|
twiss_gamma_a |
float
|
|
twiss_gamma_b |
float
|
|
twiss_gamma_c |
float
|
|
twiss_gamma_x |
float
|
|
twiss_gamma_y |
float
|
|
twiss_gamma_z |
float
|
|
twiss_norm_emit_a |
float
|
|
twiss_norm_emit_b |
float
|
|
twiss_norm_emit_c |
float
|
|
twiss_norm_emit_x |
float
|
|
twiss_norm_emit_y |
float
|
|
twiss_norm_emit_z |
float
|
|
twiss_phi_a |
float
|
|
twiss_phi_b |
float
|
|
twiss_phi_c |
float
|
|
twiss_phi_x |
float
|
|
twiss_phi_y |
float
|
|
twiss_phi_z |
float
|
|
twiss_sigma_a |
float
|
|
twiss_sigma_b |
float
|
|
twiss_sigma_c |
float
|
|
twiss_sigma_p_a |
float
|
|
twiss_sigma_p_b |
float
|
|
twiss_sigma_p_c |
float
|
|
twiss_sigma_p_x |
float
|
|
twiss_sigma_p_y |
float
|
|
twiss_sigma_p_z |
float
|
|
twiss_sigma_x |
float
|
|
twiss_sigma_y |
float
|
|
twiss_sigma_z |
float
|
|
ElementMultipoles
pytao.model.ElementMultipoles
Bases: TaoModel
Structure which corresponds to Tao pipe ele:multipoles 13, for example.
Attributes:
| Name | Type | Description |
|---|---|---|
data |
ElementMultipoles_Data
|
Structure which corresponds to Tao |
example. |
|
|
multipoles_on |
bool
|
For turning multipoles on/off |
scale_multipoles |
bool or None
|
Are ab_multipoles within other elements (EG: quads, etc.) scaled by |
the strength of the element? |
|
ElementPhoton
pytao.model.ElementPhoton
Bases: ElementPhotonBase
Class representing a element's photon details.
Attributes:
| Name | Type | Description |
|---|---|---|
which |
"base", "model", or "design"
|
|
has_material |
bool
|
Whether |
has_pixel |
bool
|
Whether |
curvature |
ElementPhotonCurvature
|
Curvature of the photon element. |
material |
ElementPhotonMaterial
|
Material properties of the photon element. |
ElementWake
pytao.model.ElementWake
Bases: ElementWakeBase
ElementWall3D
pytao.model.ElementWall3D
Bases: ElementWall3DBase
ElementWall3D class representing a 3D wall element in a lattice.
Attributes:
| Name | Type | Description |
|---|---|---|
which |
"base", "model", or "design"
|
|
index |
int
|
The index of the wall element. |
table |
list of ElementWall3DTable or None, optional
|
A table containing wall element details. |
ElementChamberWall
pytao.model.ElementChamberWall
Bases: TaoBaseModel
Represents a chamber wall element in the lattice.
Attributes:
| Name | Type | Description |
|---|---|---|
which |
"base", "model", or "design"
|
|
index |
int
|
The index of the chamber wall of the element. |
x |
list of ElementChamberWall
|
A list of ElementChamberWall objects along the x-axis. |
y |
list of ElementChamberWall
|
A list of ElementChamberWall objects along the y-axis. |
ElementLordSlave
pytao.model.ElementLordSlave
Bases: TaoModel
Structure which corresponds to Tao pipe ele:lord_slave 1 1 x, for example.
Attributes:
| Name | Type | Description |
|---|---|---|
key |
str
|
|
location_name |
str
|
|
name |
str
|
|
status |
str
|
|
type |
str
|
|
ElementGridField
pytao.model.ElementGridField
Bases: ElementGridField
Comb
Cumulative bunch moment data across the lattice.
pytao.model.Comb
Bases: TaoModel
Functions
pytao.model.Comb.from_tao
classmethod
from_tao(tao, *, check_ds_save=True, ix_branch=0, **kwargs)
Create a Comb instance from Tao.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tao
|
Tao
|
|
required |
ix_branch
|
int
|
|
0
|
**kwargs
|
dict
|
Additional keyword arguments to pass to |
{}
|
Returns:
| Type | Description |
|---|---|
Comb
|
|
Source code in pytao/model/ele/comb.py
288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 | |
pytao.model.Comb.slice_by_s
slice_by_s(s_start, s_end, *, inclusive=True)
Slice the Comb data by 's' position between specified start and end values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
s_start
|
float
|
The starting s value of the slice. |
required |
s_end
|
float
|
The ending s value of the slice. |
required |
inclusive
|
bool
|
If True, the slice includes |
True
|
Returns:
| Type | Description |
|---|---|
Comb
|
A new instance of the Comb class with the sliced data. |
Source code in pytao/model/ele/comb.py
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | |
Helper Types
ElementRange
pytao.model.ElementRange
Bases: BaseModel
Multiple Tao elements.
Attributes
pytao.model.ElementRange.tao_string
property
tao_string
This element list represented in Tao command-line interface string form.
Functions
pytao.model.ElementRange.from_tao
classmethod
from_tao(value)
Convert a Tao representation of comma-delimited elements to an ElementList.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
ElementList or ElementRange
|
|
Source code in pytao/model/ele/ele.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |
ElementList
pytao.model.ElementList
Bases: BaseModel
Multiple Tao elements.
Attributes
pytao.model.ElementList.tao_string
property
tao_string
This element list represented in Tao command-line interface string form.
Functions
pytao.model.ElementList.from_tao
classmethod
from_tao(value)
Convert a Tao representation of comma-delimited elements to an ElementList.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
ElementList
|
|
Source code in pytao/model/ele/ele.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | |
ElementIntersection
pytao.model.ElementIntersection
Bases: BaseModel
An intersection of multiple Tao elements.
Attributes
pytao.model.ElementIntersection.tao_string
property
tao_string
This element intersection represented in Tao command-line interface string form.
Functions
pytao.model.ElementIntersection.from_tao
classmethod
from_tao(value)
Create an ElementIntersection instance from a Tao format, ampersand-delimited string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
|
required |
Returns:
| Type | Description |
|---|---|
ElementIntersection
|
|
Source code in pytao/model/ele/ele.py
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | |