Module traceon.focus
Module containing a single function to find the focus of a beam of electron trajecories.
Functions
def focus_position(positions)
-
Find the focus of the given trajectories (which are returned from
Tracer.__call__()
). The focus is found using a least square method by considering the final positions and velocities of the given trajectories and linearly extending the trajectories backwards.Parameters
positions
:iterable
of(N,6) np.ndarray float64
- Trajectories of electrons, as returned by
Tracer.__call__()
Returns
(3,) np.ndarray of float64, representing the position of the focus