syned.storage_ring package

Subpackages

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

current()[source]

Returns the electron current in A.

Return type:

float

electron_speed()[source]

Returns the electron velocity in c units.

Return type:

float

emittance(dispersion=True)[source]
energy()[source]

Returns the electron energy in GeV.

Return type:

float

gamma()[source]

returns the Gamma or Lorentz factor.

Return type:

float

get_dispersion_all()[source]
get_dispersion_horizontal()[source]
get_dispersion_vertical()[source]
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_no_dispersion_all()[source]
get_twiss_no_dispersion_horizontal()[source]
get_twiss_no_dispersion_vertical()[source]
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

has_dispersion()[source]
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

lorentz_factor()[source]

returns the Gamma or Lorentz factor.

Return type:

float

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: SynedObject

Defines 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.

get_name()[source]

Returns the name of the light source.

Return type:

str

syned.storage_ring.light_source module

class syned.storage_ring.light_source.LightSource(name='Undefined', electron_beam=None, magnetic_structure=None)[source]

Bases: SynedObject

Base 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

get_name()[source]

Returns the name of the light source.

Return type:

str

syned.storage_ring.magnetic_structure module

class syned.storage_ring.magnetic_structure.MagneticStructure[source]

Bases: SynedObject

Base clase for magnetic structures (from where BM, Wiggler and Undulator will heritate)

Module contents