Physics
Functions
- EVA.core.physics.functions.gaussian(x, mean, sigma, intensity=1.0, offset=0.0)
Calculates a Gaussian function for given input array.
\[f(x) = \frac{1}{\sigma\sqrt{2\pi}}\exp{-\frac{(x-\mu)^2}{2\sigma^2}}\]- Parameters:
x (
ndarray
) – x-values to calculate Gaussian formean (
float
) – mean of Gaussiansigma (
float
) – standard deviation of Gaussianintensity (
float
) – area of Gaussian, defaults is 1offset (
float
) – height intercept, default is 0
- Return type:
ndarray
- Returns:
Array of points corresponding to the Gaussian function.
- EVA.core.physics.functions.line(x, x0, x1)
Calculates a linear function for given input array.
\[f(x) = mx + c\]- Parameters:
x (
ndarray
) – Input array to calculate forx0 (
float
) – “c”, interceptx1 (
float
) – “m”, gradient
- Return type:
ndarray
- Returns:
Array of points corresponding to line function.
- EVA.core.physics.functions.quadratic(x, x0, x1, x2)
Calculates a quadratic function for given input array.
\[f(x) = ax^2 + bx + c\]- Parameters:
x (
ndarray
) – Input array to calculate forx0 (
float
) – “c”, 0th degree coefficientx1 (
float
) – “b”, 1st degree coefficientx2 (
float
) – “a”, 2nd degree coefficient
- Return type:
ndarray
- Returns:
Array of points corresponding to quadratic function.
Normalisation
- EVA.core.physics.normalisation.normalise_counts(ydata)
Normalise data to 10,000 counts.
- Parameters:
ydata (
ndarray
) – input array- Return type:
ndarray
- Returns:
Normalised array
- EVA.core.physics.normalisation.normalise_events(ydata, spills)
Normalise data by number of spill events in comment.dat file.
- Parameters:
ydata (
ndarray
) – input arrayspills (
int
) – number of spill events
- Return type:
ndarray
- Returns:
Normalised array
- Raises:
ValueError – If spills is empty (not loaded)