toolbox Package¶
action
Module¶
Phase-space variable conversions related to action. Single-RF case without intensity effects is considered.
- Authors
Helga Timko
-
blond.toolbox.action.
action_from_oscillation_amplitude
(RFStation, dtmax, timestep=0, Np_histogram=None)¶ Returns the relative action for given oscillation amplitude in time, assuming single-harmonic RF system and no intensity effects. Action is normalised to the value at the separatrix, given in units of 1. Optional: RF parameters at a given timestep (default = 0) are used. Optional: Number of points for histogram output
-
blond.toolbox.action.
action_from_phase_amplitude
(x2)¶ Returns the relative action for given oscillation amplitude in time. Action is normalised to the value at the separatrix, given in units of 1.
-
blond.toolbox.action.
oscillation_amplitude_from_coordinates
(Ring, RFStation, dt, dE, timestep=0, Np_histogram=None)¶ Returns the oscillation amplitude in time for given particle coordinates, assuming single-harmonic RF system and no intensity effects. Optional: RF parameters at a given timestep (default = 0) are used. Optional: Number of points for histogram output
-
blond.toolbox.action.
phase_amplitude_from_tune
(tune)¶ Find the amplitude of synchrotron oscillations in phase corresponding to a given tune w.r.t. the central synchrotron frequency
-
blond.toolbox.action.
tune_from_phase_amplitude
(phimax)¶ Find the tune w.r.t. the central synchrotron frequency corresponding to a given amplitude of synchrotron oscillations in phase
-
blond.toolbox.action.
x
(phimax)¶
-
blond.toolbox.action.
x2
(phimax)¶
diffusion
Module¶
Numerical diffusion model based on Ivanov (1992). Stationary single-harmonic RF bucket is considered.
- Authors
Helga Timko
-
blond.toolbox.diffusion.
phase_noise_diffusion
(Ring, RFStation, spectrum, distribution, distributionBins, Ngrids=200, M=1, iterations=100000, figdir=None)¶ Calculate diffusion in action space according to a given double-sided phase noise spectrum, on a uniform grid in oscillation amplitude. The spectrum is defined on the grid points (Ngrids + 1 points) for all M. The particle distribution in action is defined on the grids (Ngrids points). Returns the diffused action distribution. Optional: define number of side-bands (M) to be taken into account, default is M = 1; N.B. this will only give impair modes for phase noise. Optional: number of iterations to track. Optional: save figures into directory ‘figdir’.
filters_and_fitting
Module¶
- **Fitting and filters routines to be used alone or with the Profile class in
the beam package. **
- Authors
Danilo Quartullo, Alexandre Lasheen, Juan F. Esteban Mueller
-
blond.toolbox.filters_and_fitting.
beam_profile_filter_chebyshev
(Y_array, X_array, filter_option)¶ This routine is filtering the beam profile with a type II Chebyshev filter. The input is a library having the following structure and informations:
filter_option = {‘type’:’chebyshev’, ‘pass_frequency’:pass_frequency, ‘stop_frequency’:stop_frequency, ‘gain_pass’:gain_pass, ‘gain_stop’:gain_stop}
The function returns nCoefficients, the number of coefficients used in the filter. You can also add the following option to plot and return the filter transfer function:
filter_option = {…, ‘transfer_function_plot’:True}
-
blond.toolbox.filters_and_fitting.
fwhm
(Y_array, X_array, shift=0)¶ Computation of the bunch length and position from the FWHM assuming Gaussian line density.
-
blond.toolbox.filters_and_fitting.
fwhm_multibunch
(Y_array, X_array, n_bunches, bunch_spacing_buckets, bucket_size_tau, bucket_tolerance=0.4, shift=0)¶ Computation of the bunch length and position from the FWHM assuming Gaussian line density for multibunch case.
-
blond.toolbox.filters_and_fitting.
gauss
(x, *p)¶ Defined as:
\[A \, e^{\frac{\left(x-x_0\right)^2}{2\sigma_x^2}}\]
-
blond.toolbox.filters_and_fitting.
gaussian_fit
(Y_array, X_array, p0)¶ Gaussian fit of the profile, in order to get the bunch length and position. Returns fit values in units of s.
-
blond.toolbox.filters_and_fitting.
rms
(Y_array, X_array)¶ Computation of the RMS bunch length and position from the line density (bunch length = 4sigma).
-
blond.toolbox.filters_and_fitting.
rms_multibunch
(Y_array, X_array, n_bunches, bunch_spacing_buckets, bucket_size_tau, bucket_tolerance=0.4)¶ Computation of the rms bunch length (4sigma) and position.
logger
Module¶
Logging messages
- Authors
Helga Timko
-
class
blond.toolbox.logger.
Logger
(debug=False)¶ Bases:
object
Class to log messages coming from other classes. Messages contain {Time stamp} {Class name} {Log level} {Message}. Errors, warnings and info are logged into the console. To disable logging, call Logger().disable()
- Parameters
debug (bool) – Log DEBUG messages in ‘debug.log’; default is False
-
disable
()¶ Disables all logging.
next_regular
Module¶
Optimised next_regular routine to generate Hamming numbers: the output will contain at least one factor 2.
- Authors
Alexandre Lasheen, Juan F. Esteban Mueller, Danilo Quartullo
-
blond.toolbox.next_regular.
next_regular
(target)¶ Find the next regular number greater than or equal to target. Regular numbers are composites of the prime factors 2, 3, and 5. Also known as 5-smooth numbers or Hamming numbers, these are the optimal size for inputs to FFTPACK.
Target must be a positive integer.
parameter_scaling
Module¶
Scaling of longitudinal beam and machine parameters, with user interface.
- Authors
Konstantinos Iliakis, Helga Timko
-
class
blond.toolbox.parameter_scaling.
ParameterScaling
¶ Bases:
object
-
addactions
(mainWindow)¶
-
bucket_parameters
()¶
-
bunch_length_from_emittance
(emittance)¶
-
cbEnergyHandler
(text)¶
-
cbGammaTHandler
(text)¶
-
property
dE_b
¶
-
property
delta_b
¶
-
property
emittance
¶
-
emittance_from_bunch_length
(four_sigma_bunch_length)¶
-
frequencies
()¶
-
property
integral
¶
-
pbHandler
()¶
-
property
phi_b
¶
-
relativistic_quantities
()¶
-
retranslateUi
(mainWindow)¶
-
setupUi
(mainWindow)¶
-
tune
()¶
-
tomoscope
Module¶
** CERN Tomoscope-related functions to generate particle distribution or probability density.**
- Authors
Helga Timko
-
blond.toolbox.tomoscope.
distribution_from_tomoscope_data
(dataDir, nPart, cutoff=1000, seed=1234, plotFig=True, saveDistr=False)¶ ‘dataDir’ is the directory of directories of offline-processed tomoscope data containing ‘plotinfo.data’ and ‘image001.data’ Use ‘cutoff’ to eliminate measurement noise (use values around 50-100). Use ‘seed’ to change the random number seed. Use ‘plotFig = True’ to plot and save figures. Use ‘saveDistr = True’ to save particle coordinates.