syned.storage_ring package
Subpackages
- syned.storage_ring.magnetic_structures package
- Submodules
- syned.storage_ring.magnetic_structures.bending_magnet module
BendingMagnetBendingMagnet.calculate_critical_energy()BendingMagnet.calculate_critical_energy_from_magnetic_field()BendingMagnet.calculate_magnetic_field()BendingMagnet.calculate_magnetic_radius()BendingMagnet.get_critical_energy()BendingMagnet.get_magnetic_field()BendingMagnet.get_magnetic_radius()BendingMagnet.horizontal_divergence()BendingMagnet.initialize_from_magnetic_field_divergence_and_electron_energy()BendingMagnet.initialize_from_magnetic_radius_divergence_and_electron_energy()BendingMagnet.length()BendingMagnet.magnetic_field()BendingMagnet.radius()
- syned.storage_ring.magnetic_structures.insertion_device module
InsertionDeviceInsertionDevice.K()InsertionDevice.K_horizontal()InsertionDevice.K_vertical()InsertionDevice.length()InsertionDevice.magnetic_field_horizontal()InsertionDevice.magnetic_field_vertical()InsertionDevice.number_of_periods()InsertionDevice.period_length()InsertionDevice.set_K_horizontal_from_magnetic_field()InsertionDevice.set_K_vertical_from_magnetic_field()
- syned.storage_ring.magnetic_structures.undulator module
UndulatorUndulator.approximated_coherent_fraction()Undulator.approximated_coherent_fraction_horizontal()Undulator.approximated_coherent_fraction_vertical()Undulator.gaussian_central_cone_aperture()Undulator.get_K_from_photon_energy()Undulator.get_photon_sizes_and_divergences()Undulator.get_resonance_ring()Undulator.get_sigmas_radiation()Undulator.initialize_as_vertical_undulator()Undulator.resonance_energy()Undulator.resonance_frequency()Undulator.resonance_wavelength()Undulator.undulator_full_emitted_power()
- syned.storage_ring.magnetic_structures.wiggler module
- Module contents
Submodules
syned.storage_ring.electron_beam module
Base class for electron beams.
This class is intentionally shorten for simplicity. Usually we would need to consider also the electron distribution within the beam.
- class syned.storage_ring.electron_beam.ElectronBeam(energy_in_GeV=1.0, energy_spread=0.0, current=0.1, number_of_bunches=400, moment_xx=0.0, moment_xxp=0.0, moment_xpxp=0.0, moment_yy=0.0, moment_yyp=0.0, moment_ypyp=0.0, dispersion_x=0.0, dispersion_y=0.0, dispersionp_x=0.0, dispersionp_y=0.0)[source]
Bases:
SynedObject- get_moments_all(dispersion=True)[source]
Returns all moments.
- Returns:
( <x^2>, <x x’>, <x’^2>, <y^2>, <y y’>, <y’^2>)
- Return type:
tuple
- get_moments_horizontal(dispersion=True)[source]
Returns the moments in the horizontal direction.
- Returns:
( <x^2>, <x x’>, <x’^2>)
- Return type:
tuple
- get_moments_vertical(dispersion=True)[source]
Returns the moments in the vertical direction.
- Returns:
( <y^2>, <y y’>, <y’^2>)
- Return type:
tuple
- get_sigmas_all(dispersion=True)[source]
Returns all sigmas.
- Returns:
(sigma_x, sigma_x’, sigma_y, sigma_y’)
- Return type:
tuple
- get_sigmas_horizontal(dispersion=True)[source]
Returns the sigmas in horizontal direction.
- Returns:
(sigma_x, sigma_x’)
- Return type:
tuple
- get_sigmas_vertical(dispersion=True)[source]
Returns the sigmas in vertical direction.
- Returns:
(sigma_y, sigma_y’)
- Return type:
tuple
- get_twiss_all()[source]
Returns all Twiss parameters. (The energy disperion is not considered.)
- Returns:
(emittance_x, alpha_x, beta_x, emittance_y, alpha_y, beta_y).
- Return type:
tuple
- get_twiss_horizontal()[source]
Returns the Twiss parameters in horizontal direction. (The energy disperion is considered.)
- Returns:
(emittance_x, alpha_x, beta_x).
- Return type:
tuple
- get_twiss_vertical()[source]
Returns the Twiss parameters in vertical direction. (The energy disperion is not considered.)
- Returns:
(emittance_y, alpha_y, beta_y).
- Return type:
tuple
- classmethod initialize_as_pencil_beam(energy_in_GeV=1.0, energy_spread=0.0, current=0.1, **params)[source]
Creates an electron pencil beam.
- Parameters:
energy_in_GeV (float, optional) – The electron energy in GeV.
energy_spread (float, optional) – The electron energy spread (in a fraction of the energy_in_GeV).
current (float, optional) – The electron beam current intensity in A.
params – other keyword parameters accepted by ElectronBeam (if used, the result may not be a pencil beam.)
- Return type:
instance of ElectronBeam
- set_dispersion_all(eta_x, etap_x, eta_y, etap_y)[source]
Sets the dispersion values.
- Parameters:
eta_x (float) – The eta value in horizontal.
etap_x (float) – The eta’ value in horizontal.
eta_y (float) – The eta value in vertical.
etap_y (float) – The eta’ value in vertical.
- set_dispersion_horizontal(eta_x, etap_x)[source]
Sets the horizontal dispersion values.
- Parameters:
eta_x (float) – The eta value in horizontal.
etap_x (float) – The eta’ value in horizontal.
- set_dispersion_vertical(eta_y, etap_y)[source]
Sets the vertical dispersion values.
- Parameters:
eta_y (float) – The eta value in vertical.
etap_y (float) – The eta’ value in vertical.
- set_energy_from_gamma(gamma)[source]
Sets the electron energy from the gamma value (Lorentz factor).
- Parameters:
gamma (float) –
- set_moments_all(moment_xx, moment_xxp, moment_xpxp, moment_yy, moment_yyp, moment_ypyp)[source]
Sets the moments.
- Parameters:
moment_xx (float) – The <x^2> moment.
moment_xxp (float) – The <x x’> moment.
moment_xpxp (float,) – The <x’^2> moment.
moment_yy (float) – The <y^2> moment.
moment_yyp (float) – The <y y’> moment.
moment_ypyp (float) – The <y’^2> moment.
- set_moments_horizontal(moment_xx, moment_xxp, moment_xpxp)[source]
Sets the moments in the horizontal direction.
- Parameters:
moment_xx (float) – The <x^2> moment.
moment_xxp (float) – The <x x’> moment.
moment_xpxp (float,) – The <x’^2> moment.
- set_moments_vertical(moment_yy, moment_yyp, moment_ypyp)[source]
Sets the moments in the vertical direction.
- Parameters:
moment_yy (float) – The <y^2> moment.
moment_yyp (float) – The <y y’> moment.
moment_ypyp (float) – The <y’^2> moment.
- set_sigmas_all(sigma_x=0.0, sigma_xp=0.0, sigma_y=0.0, sigma_yp=0.0)[source]
Sets the electron beam parameters from the sigma values in both horizontal and vertical direction.
- Parameters:
sigma_x (float, optional) – The sigma in real space (horizontal).
sigma_xp (float, optional) – The sigma in divergence space (horizontal).
sigma_y (float, optional) – The sigma in real space (vertical).
sigma_yp (float, optional) – The sigma in divergence space (vertical).
- set_sigmas_horizontal(sigma_x=0.0, sigma_xp=0.0)[source]
Sets the electron beam parameters from the sigma values in horizontal direction.
- Parameters:
sigma_x (float, optional) – The sigma in real space.
sigma_xp (float, optional) – The sigma in divergence space.
- set_sigmas_vertical(sigma_y=0.0, sigma_yp=0.0)[source]
Sets the electron beam parameters from the sigma values in vertical direction.
- Parameters:
sigma_y (float, optional) – The sigma in real space.
sigma_yp (float, optional) – The sigma in divergence space.
- set_twiss_all(emittance_x, alpha_x, beta_x, emittance_y, alpha_y, beta_y, **kwargs)[source]
Sets the electron beam parameters from the Twiss values.
- Parameters:
emittance_x (float) – The emittance value in horizontal.
alpha_x (float) – The alpha value in horizontal.
beta_x (float) – The beta value in horizontal.
emittance_y (float) – The emittance value in vertical.
alpha_y (float) – The alpha value in vertical.
beta_y (float) – The beta value in vertical.
- set_twiss_horizontal(emittance_x, alpha_x, beta_x, **kwargs)[source]
Sets the electron beam parameters from the Twiss values in the horizontal direction.
- Parameters:
emittance_x (float) – The emittance value in horizontal.
alpha_x (float) – The alpha value in horizontal.
beta_x (float) – The beta value in horizontal.
eta_x (float, optional) – The eta value in horizontal.
etap_x (float, optional) – The eta’ value in horizontal.
- set_twiss_vertical(emittance_y, alpha_y, beta_y, **kwargs)[source]
Sets the electron beam parameters from the Twiss values in the vertical direction.
- Parameters:
emittance_y (float) – The emittance value in vertical.
alpha_x (float) – The alpha value in vertical.
beta_x (float) – The beta value in vertical.
eta_x (float, optional) – The eta value.
etap_x (float, optional) – The eta’ value in vertical.
syned.storage_ring.empty_light_source module
- Base class for LighSource, which contains:
a name
an electron beam
a magnetic structure
- class syned.storage_ring.empty_light_source.EmptyLightSource(name='Empty')[source]
Bases:
SynedObjectDefines an empty light source. This is for creating “movable” beamlines (using Beamline()). These are beamlines that do not have a particular light source.
- Parameters:
name (str, optional) – The name of the (empty) light source.
syned.storage_ring.light_source module
- class syned.storage_ring.light_source.LightSource(name='Undefined', electron_beam=None, magnetic_structure=None)[source]
Bases:
SynedObjectBase class for LighSource. A light source contains: * a name * an electron beam * a magnetic structure
- Parameters:
name (str, optional) – The light source name.
electron_beam (instance of ElectronBeam, optional) – The electron beam. If None, it is initialized with ElectronBeam().
magnetic_structure (instance of MagneticStructure, optional) – The electron beam. If None, it is initialized with MagneticStructure().
- get_electron_beam()[source]
Returns the electron beam.
- Return type:
instance of ElectronBeam
- get_magnetic_structure()[source]
Returns the magnetic structure.
- Return type:
instance of MagneticStructure
syned.storage_ring.magnetic_structure module
- class syned.storage_ring.magnetic_structure.MagneticStructure[source]
Bases:
SynedObjectBase clase for magnetic structures (from where BM, Wiggler and Undulator will heritate)