at.acceptance.acceptance#
Acceptance computation
Functions
|
Computes the acceptance at |
|
Computes the 1D acceptance at |
|
Computes the 1D horizontal acceptance at |
|
Computes the 1D vertical acceptance at refpts observation points |
|
Computes the 1D momentum acceptance at refpts observation points |
- get_1d_acceptance(ring, plane, resolution, amplitude, nturns=1024, refpts=None, dp=None, grid_mode=GridMode.RADIAL, use_mp=False, verbose=False, divider=2, shift_zero=1e-06, start_method=None)[source]#
Computes the 1D acceptance at
refptsobservation pointsSee
get_acceptance()- Parameters:
ring (Lattice) – Lattice definition
plane (str) – Plane to scan for the acceptance. Allowed values are:
'x','xp','y','yp','dp','ct'resolution (float) – Minimum distance between 2 grid points
amplitude (float) –
Search range:
GridMode.CARTESIAN/RADIAL: max. amplitudeGridMode.RECURSIVE: initial step
refpts (Union[Type[Element], Element, Callable[[Element], bool], str, None, int, Sequence[int], bool, Sequence[bool], RefptsCode]) – Observation points. Default: start of the machine
grid_mode (Optional[GridMode]) –
defines the evaluation grid:
GridMode.CARTESIAN: full [\(\:x, y\:\)] gridGridMode.RADIAL: full [\(\:r, \theta\:\)] gridGridMode.RECURSIVE: radial recursive search
use_mp (Optional[bool]) – Use python multiprocessing (
patpass(), default uselattice_pass()). In case multi-processing is not enabled,grid_modeis forced toGridMode.RECURSIVE(most efficient in single core)divider (Optional[int]) – Value of the divider used in
GridMode.RECURSIVEboundary searchshift_zero (Optional[float]) – Epsilon offset applied on all 6 coordinates
start_method (Optional[str]) – Python multiprocessing start method. The default
Noneuses the python default that is considered safe. Available parameters:'fork','spawn','forkserver'. The default for linux is'fork', the default for MacOS and Windows is'spawn'.'fork'may used for MacOS to speed-up the calculation or to solve runtime errors, however it is considered unsafe.
- Returns:
boundary – (len(refpts),2) array: 1D acceptance
tracked – (n,) array: Coordinates of tracked particles
survived – (n,) array: Coordinates of surviving particles
In case of multiple
trackedandsurvivedare lists of arrays, with one array per ref. point.Note
When``use_mp=True`` all the available CPUs will be used. This behavior can be changed by setting
at.DConstant.patpass_poolsizeto the desired value
- get_acceptance(ring, planes, npoints, amplitudes, nturns=1024, refpts=None, dp=None, offset=None, bounds=None, grid_mode=GridMode.RADIAL, use_mp=False, verbose=True, divider=2, shift_zero=1e-06, start_method=None)[source]#
Computes the acceptance at
repftsobservation points- Parameters:
ring (Lattice) – Lattice definition
planes – max. dimension 2, Plane(s) to scan for the acceptance. Allowed values are:
'x','xp','y','yp','dp','ct'npoints – (len(planes),) array: number of points in each dimension
amplitudes –
(len(planes),) array: set the search range:
GridMode.CARTESIAN/RADIAL: max. amplitudeGridMode.RECURSIVE: initial step
refpts (Union[Type[Element], Element, Callable[[Element], bool], str, None, int, Sequence[int], bool, Sequence[bool], RefptsCode]) – Observation points. Default: start of the machine
offset (Sequence[float]) – initial orbit. Default: closed orbit
bounds –
defines the tracked range: range=bounds*amplitude. It can be use to select quadrants. For example, default values are:
GridMode.CARTESIAN: ((-1, 1), (0, 1))GridMode.RADIAL/RECURSIVE: ((0, 1), (\(\pi\), 0))
grid_mode (Optional[GridMode]) –
defines the evaluation grid:
GridMode.CARTESIAN: full [\(\:x, y\:\)] gridGridMode.RADIAL: full [\(\:r, \theta\:\)] gridGridMode.RECURSIVE: radial recursive search
use_mp (Optional[bool]) – Use python multiprocessing (
patpass(), default uselattice_pass()).divider (Optional[int]) – Value of the divider used in
GridMode.RECURSIVEboundary searchshift_zero (Optional[float]) – Epsilon offset applied on all 6 coordinates
start_method (Optional[str]) – Python multiprocessing start method. The default
Noneuses the python default that is considered safe. Available parameters:'fork','spawn','forkserver'. The default for linux is'fork', the default for MacOS and Windows is'spawn'.'fork'may used for MacOS to speed-up the calculation or to solve runtime errors, however it is considered unsafe.
- Returns:
boundary – (2,n) array: 2D acceptance
survived – (2,n) array: Coordinates of surviving particles
tracked – (2,n) array: Coordinates of tracked particles
In case of multiple refpts, return values are lists of arrays, with one array per ref. point.
Examples
>>> bf,sf,gf = ring.get_acceptance(planes, npoints, amplitudes) >>> plt.plot(*gf,'.') >>> plt.plot(*sf,'.') >>> plt.plot(*bf) >>> plt.show()
Note
When``use_mp=True`` all the available CPUs will be used. This behavior can be changed by setting
at.DConstant.patpass_poolsizeto the desired value
- get_horizontal_acceptance(ring, resolution, amplitude, *args, **kwargs)[source]#
Computes the 1D horizontal acceptance at
refptsobservation pointsSee
get_acceptance()- Parameters:
ring (Lattice) – Lattice definition
resolution (float) – Minimum distance between 2 grid points
amplitude (float) –
Search range:
GridMode.CARTESIAN/RADIAL: max. amplitudeGridMode.RECURSIVE: initial step
- Keyword Arguments:
nturns – Number of turns for the tracking
refpts – Observation points. Default: start of the machine
dp – static momentum offset
grid_mode –
defines the evaluation grid:
GridMode.CARTESIAN: full [\(\:x, y\:\)] gridGridMode.RADIAL: full [\(\:r, \theta\:\)] gridGridMode.RECURSIVE: radial recursive search
use_mp – Use python multiprocessing (
patpass(), default uselattice_pass()). In case multi-processing is not enabled,grid_modeis forced toGridMode.RECURSIVE(most efficient in single core)verbose – Print out some information
divider – Value of the divider used in
GridMode.RECURSIVEboundary searchshift_zero – Epsilon offset applied on all 6 coordinates
start_method – Python multiprocessing start method. The default
Noneuses the python default that is considered safe. Available parameters:'fork','spawn','forkserver'. The default for linux is'fork', the default for MacOS and Windows is'spawn'.'fork'may used for MacOS to speed-up the calculation or to solve runtime errors, however it is considered unsafe.
- Returns:
boundary – (len(refpts),2) array: 1D acceptance
tracked – (n,) array: Coordinates of tracked particles
survived – (n,) array: Coordinates of surviving particles
In case of multiple
trackedandsurvivedare lists of arrays, with one array per ref. point.Note
When``use_mp=True`` all the available CPUs will be used. This behavior can be changed by setting
at.DConstant.patpass_poolsizeto the desired value
- get_momentum_acceptance(ring, resolution, amplitude, *args, **kwargs)[source]#
Computes the 1D momentum acceptance at refpts observation points
See
get_acceptance()- Parameters:
ring (Lattice) – Lattice definition
resolution (float) – Minimum distance between 2 grid points
amplitude (float) –
Search range:
GridMode.CARTESIAN/RADIAL: max. amplitudeGridMode.RECURSIVE: initial step
- Keyword Arguments:
nturns – Number of turns for the tracking
refpts – Observation points. Default: start of the machine
dp – static momentum offset
grid_mode –
defines the evaluation grid:
GridMode.CARTESIAN: full [\(\:x, y\:\)] gridGridMode.RADIAL: full [\(\:r, \theta\:\)] gridGridMode.RECURSIVE: radial recursive search
use_mp – Use python multiprocessing (
patpass(), default uselattice_pass()). In case multi-processing is not enabled,grid_modeis forced toGridMode.RECURSIVE(most efficient in single core)verbose – Print out some information
divider – Value of the divider used in
GridMode.RECURSIVEboundary searchshift_zero – Epsilon offset applied on all 6 coordinates
start_method – Python multiprocessing start method. The default
Noneuses the python default that is considered safe. Available parameters:'fork','spawn','forkserver'. The default for linux is'fork', the default for MacOS and Windows is'spawn'.'fork'may used for MacOS to speed-up the calculation or to solve runtime errors, however it is considered unsafe.
- Returns:
boundary – (len(refpts),2) array: 1D acceptance
tracked – (n,) array: Coordinates of tracked particles
survived – (n,) array: Coordinates of surviving particles
In case of multiple
trackedandsurvivedare lists of arrays, with one array per ref. point.Note
When``use_mp=True`` all the available CPUs will be used. This behavior can be changed by setting
at.DConstant.patpass_poolsizeto the desired value
- get_vertical_acceptance(ring, resolution, amplitude, *args, **kwargs)[source]#
Computes the 1D vertical acceptance at refpts observation points
See
get_acceptance()- Parameters:
ring (Lattice) – Lattice definition
resolution (float) – Minimum distance between 2 grid points
amplitude (float) –
Search range:
GridMode.CARTESIAN/RADIAL: max. amplitudeGridMode.RECURSIVE: initial step
- Keyword Arguments:
nturns – Number of turns for the tracking
refpts – Observation points. Default: start of the machine
dp – static momentum offset
grid_mode –
defines the evaluation grid:
GridMode.CARTESIAN: full [\(\:x, y\:\)] gridGridMode.RADIAL: full [\(\:r, \theta\:\)] gridGridMode.RECURSIVE: radial recursive search
use_mp – Use python multiprocessing (
patpass(), default uselattice_pass()). In case multi-processing is not enabled,grid_modeis forced toGridMode.RECURSIVE(most efficient in single core)verbose – Print out some information
divider – Value of the divider used in
GridMode.RECURSIVEboundary searchshift_zero – Epsilon offset applied on all 6 coordinates
start_method – Python multiprocessing start method. The default
Noneuses the python default that is considered safe. Available parameters:'fork','spawn','forkserver'. The default for linux is'fork', the default for MacOS and Windows is'spawn'.'fork'may used for MacOS to speed-up the calculation or to solve runtime errors, however it is considered unsafe.
- Returns:
boundary – (len(refpts),2) array: 1D acceptance
tracked – (n,) array: Coordinates of tracked particles
survived – (n,) array: Coordinates of surviving particles
In case of multiple
trackedandsurvivedare lists of arrays, with one array per ref. point.Note
When``use_mp=True`` all the available CPUs will be used. This behavior can be changed by setting
at.DConstant.patpass_poolsizeto the desired value