febid.monte_carlo.etrajectory.ETrajectory#
- class ETrajectory[source]#
Bases:
MC_Sim_Base
A class responsible for the generation and scattering of electron trajectories
Methods
get_crossing_point
Get next two crossing points and a flag showing if volume boundaries are met
Calculate norming factor with the given number of generated trajectories
Simulate trajectory of the electrons with a specified starting position.
Simulate trajectory of the electrons with a specified starting position.
Create normally distributed electron positions and run trajectory mapping
Create normally distributed electron positions and run trajectory mapping in Cython
Plot a scatter plot of the (x,y) points with 2D histograms depicting axial distribution
Generate a specified number of points according to a Gaussian distribution.
Generate a specified number of points according to a Super Gaussian distribution.
Save passes to a text file or by pickling
Initialise the instance and set all the necessary parameters
Attributes
NA
elementary_charge
shape
shape_abs
- get_next_crossing(coords)[source]#
Get next two crossing points and a flag showing if volume boundaries are met
- Parameters:
coords –
- Returns:
- get_norm_factor(N=None)[source]#
Calculate norming factor with the given number of generated trajectories
- Parameters:
N – number of trajectories
- Returns:
- map_trajectory(x0, y0)[source]#
Simulate trajectory of the electrons with a specified starting position.
- Parameters:
x0 – x-positions of the electrons
y0 – y-positions of the electrons
- Returns:
- map_trajectory_verbose(x0, y0)[source]#
Simulate trajectory of the electrons with a specified starting position. Version with step-by-step output to console.
- Parameters:
x0 – x-positions of the electrons
y0 – y-positions of the electrons
- Returns:
- map_wrapper(y0, x0, N=0)[source]#
Create normally distributed electron positions and run trajectory mapping
- Parameters:
y0 – y-position of the beam, nm
x0 – x-position of the beam, nm
N – number of electrons to create
- Returns:
- map_wrapper_cy(y0, x0, N=0)[source]#
Create normally distributed electron positions and run trajectory mapping in Cython
- Parameters:
y0 – y-position of the beam, nm
x0 – x-position of the beam, nm
N – number of electrons to create
- Returns:
- plot_distribution(x, y, func=None)[source]#
Plot a scatter plot of the (x,y) points with 2D histograms depicting axial distribution
- Parameters:
x – array of x-coordinates
y – array of y-coordinates
func – 2D probability density function
- Returns:
- rnd_gauss_xy(x0, y0, N)[source]#
Generate a specified number of points according to a Gaussian distribution. Standard deviation and order of the super gaussian are class properties.
- Parameters:
x0 – mean along X-axis
y0 – mean along Y-axis
N – number of points to generate
- Returns:
two arrays of N-length with x and y positions
- rnd_super_gauss(x0, y0, N)[source]#
Generate a specified number of points according to a Super Gaussian distribution. Standard deviation and order of the super gaussian are class properties.
- Parameters:
x0 – mean along X-axis
y0 – mean along Y-axis
N – number of points to generate
- Returns:
two arrays of N-length with x and y positions