pysrw.lib.srwlib.SRWLOptCryst#

class pysrw.lib.srwlib.SRWLOptCryst(_d_sp, _psi0r, _psi0i, _psi_hr, _psi_hi, _psi_hbr, _psi_hbi, _tc, _ang_as, _nvx=0, _nvy=0, _nvz=-1, _tvx=1, _tvy=0, _uc=1, _e_avg=0, _ang_roll=0)[source]#

Bases: SRWLOpt

Optical Element: Ideal Crystal

__init__(_d_sp, _psi0r, _psi0i, _psi_hr, _psi_hi, _psi_hbr, _psi_hbi, _tc, _ang_as, _nvx=0, _nvy=0, _nvz=-1, _tvx=1, _tvy=0, _uc=1, _e_avg=0, _ang_roll=0)[source]#
Parameters:
  • _d_sp – (_d_space) crystal reflecting planes d-spacing (John’s dA) [A]

  • _psi0r – real part of 0-th Fourier component of crystal polarizability (John’s psi0c.real) (units?)

  • _psi0i – imaginary part of 0-th Fourier component of crystal polarizability (John’s psi0c.imag) (units?)

  • _psi_hr – (_psiHr) real part of H-th Fourier component of crystal polarizability (John’s psihc.real) (units?)

  • _psi_hi – (_psiHi) imaginary part of H-th Fourier component of crystal polarizability (John’s psihc.imag) (units?)

  • _psi_hbr – (_psiHBr:) real part of -H-th Fourier component of crystal polarizability (John’s psimhc.real) (units?)

  • _psi_hbi – (_psiHBi:) imaginary part of -H-th Fourier component of crystal polarizability (John’s psimhc.imag) (units?)

  • _tc – crystal thickness [m] (John’s thicum)

  • _ang_as – (_Tasym) asymmetry angle [rad] (John’s alphdg)

  • _nvx – horizontal coordinate of outward normal to crystal surface (John’s angles: thdg, chidg, phidg)

  • _nvy – vertical coordinate of outward normal to crystal surface (John’s angles: thdg, chidg, phidg)

  • _nvz – longitudinal coordinate of outward normal to crystal surface (John’s angles: thdg, chidg, phidg)

  • _tvx – horizontal coordinate of central tangential vector (John’s angles: thdg, chidg, phidg)

  • _tvy – vertical coordinate of central tangential vector (John’s angles: thdg, chidg, phidg)

  • _uc – crystal use case: 1- Bragg Reflection, 2- Bragg Transmission (Laue cases to be added)

  • _e_avg – average photon energy [eV] the crystal should be alligned for: if it is not 0, and _nvx, _nvy, _nvz, _tvx, _tvy are not defined, then crystal orientation will be calculated based on _uc, _e_avg and _ang_roll

  • _ang_roll – roll angle [rad] (i.e. angle of diffraction plane angle rotation about incident beam axis) the crystal should be alligned for: it is only taken into account when _e_avg != 0

Methods

__init__(_d_sp, _psi0r, _psi0i, _psi_hr, ...)

param _d_sp:

(_d_space) crystal reflecting planes d-spacing (John's dA) [A]

estim_en_fr_ang_inc(_ang)

Estimates photon energy from given incidence angle (in kinematic approx.) :param _ang: incidence angle [rad] :return: estimated photon energy [eV]

find_orient(_en[, _ang_dif_pl, _uc])

Finds optimal crystal orientation in the input beam frame (i.e. surface normal and tangential vectors) and the orientation of the output beam frame (i.e. coordinates of the longitudinal and horizontal vectors in the input beam frame) :param _en: photon energy [eV] :param _ang_dif_pl: diffraction plane angle (0 corresponds to the vertical deflection; pi/2 to the horizontal deflection; any value in between is allowed) :param _uc: crystal use case: 1- Bragg Reflection, 2- Bragg Transmission (Laue cases to be added) :return: list of two triplets of vectors: out[0] is the list of 3 base vectors [tangential, saggital, normal] defining the crystal orientation out[1] is the list of 3 base vectors [ex, ey, ez] defining orientation of the output beam frame the cartesian coordinates of all these vectors are given in the frame of the input beam.

get_ang_inc(_e)

Estimates incidence angle for given photon energy (close to Bragg angle?) :param _e: photon energy [eV] :return: estimated incidence angle [rad]

get_orient([_e])

Returns data on orientation of optical element in the frame of incident beam (should be called after the optical element was completely set up) :return: list of two triplets of vectors: out[0] is the list of 3 base vectors [tangential, saggital, normal] defining the crystal orientation out[1] is the list of 3 base vectors [ex, ey, ez] defining orientation of the output beam frame the cartesian coordinates of all these vectors are given in the frame of the input beam

randomize()

Randomizes parameters of optical element according to self.RandParam to simulate e.g. impact of vibrations on coherence (in P-C calculations).

set_orient([_nvx, _nvy, _nvz, _tvx, _tvy])

Defines Crystal Orientation in the frame of the Incident Photon beam :param _nvx: horizontal coordinate of normal vector :param _nvy: vertical coordinate of normal vector :param _nvz: longitudinal coordinate of normal vector :param _tvx: horizontal coordinate of tangential vector :param _tvy: vertical coordinate of tangential vector

set_rand_par(_rand_par)

Sets list of params to be eventually randomized in some types of calculations :param _rand_par: list of params to be randomized; each element of this list should be: ['param_name', val_avg, val_range, meth]

estim_en_fr_ang_inc(_ang)[source]#

Estimates photon energy from given incidence angle (in kinematic approx.) :param _ang: incidence angle [rad] :return: estimated photon energy [eV]

find_orient(_en, _ang_dif_pl=0, _uc=1)[source]#

Finds optimal crystal orientation in the input beam frame (i.e. surface normal and tangential vectors) and the orientation of the output beam frame (i.e. coordinates of the longitudinal and horizontal vectors in the input beam frame) :param _en: photon energy [eV] :param _ang_dif_pl: diffraction plane angle (0 corresponds to the vertical deflection; pi/2 to the horizontal deflection; any value in between is allowed) :param _uc: crystal use case: 1- Bragg Reflection, 2- Bragg Transmission (Laue cases to be added) :return: list of two triplets of vectors:

out[0] is the list of 3 base vectors [tangential, saggital, normal] defining the crystal orientation out[1] is the list of 3 base vectors [ex, ey, ez] defining orientation of the output beam frame the cartesian coordinates of all these vectors are given in the frame of the input beam

get_ang_inc(_e)[source]#

Estimates incidence angle for given photon energy (close to Bragg angle?) :param _e: photon energy [eV] :return: estimated incidence angle [rad]

get_orient(_e=0)[source]#

Returns data on orientation of optical element in the frame of incident beam (should be called after the optical element was completely set up) :return: list of two triplets of vectors:

out[0] is the list of 3 base vectors [tangential, saggital, normal] defining the crystal orientation out[1] is the list of 3 base vectors [ex, ey, ez] defining orientation of the output beam frame the cartesian coordinates of all these vectors are given in the frame of the input beam

set_orient(_nvx=0, _nvy=0, _nvz=-1, _tvx=1, _tvy=0)[source]#

Defines Crystal Orientation in the frame of the Incident Photon beam :param _nvx: horizontal coordinate of normal vector :param _nvy: vertical coordinate of normal vector :param _nvz: longitudinal coordinate of normal vector :param _tvx: horizontal coordinate of tangential vector :param _tvy: vertical coordinate of tangential vector