pysrw.lib.srwlib.SRWLWfr#
- class pysrw.lib.srwlib.SRWLWfr(_arEx=None, _arEy=None, _typeE='f', _eStart=0, _eFin=0, _ne=0, _xStart=0, _xFin=0, _nx=0, _yStart=0, _yFin=0, _ny=0, _zStart=0, _partBeam=None)[source]#
Bases:
object
Radiation Wavefront (Electric Field)
- __init__(_arEx=None, _arEy=None, _typeE='f', _eStart=0, _eFin=0, _ne=0, _xStart=0, _xFin=0, _nx=0, _yStart=0, _yFin=0, _ny=0, _zStart=0, _partBeam=None)[source]#
- Parameters:
_arEx – horizontal complex electric field component array; NOTE: only ‘f’ (float) is supported for the moment (Jan. 2011)
_arEy – vertical complex electric field component array
_typeE – electric field numerical type: ‘f’ (float) or ‘d’ (double)
_eStart – initial value of photon energy (/time)
_eFin – final value of photon energy (/time)
_ne – numbers of points vs photon energy
_xStart – initial value of horizontal positions
_xFin – final value of horizontal positions
_nx – numbers of points vs horizontal positions
_yStart – initial vertical positions
_yFin – final value of vertical positions
_ny – numbers of points vs vertical positions
_zStart – longitudinal position
_partBeam – particle beam source; strictly speaking, it should be just SRWLParticle; however, “multi-electron” information can appear useful for those cases when “multi-electron intensity” can be deduced from the “single-electron” one by convolution
Some additional parameters, that are not included in constructor arguments: Rx, Ry: instant wavefront radii dRx, dRy: error of wavefront radii xc, yc: transverse coordinates of wavefront instant “source center” avgPhotEn: average photon energy for time-domain simulations presCA: presentation/domain: 0- coordinates, 1- angles presFT: presentation/domain: 0- frequency (photon energy), 1- time unitElFld: electric field units: 0- arbitrary, 1- sqrt(Phot/s/0.1%bw/mm^2) arElecPropMatr: effective 1st order “propagation matrix” for electron beam parameters arMomX, arMomY: statistical moments (of Wigner distribution); to check the exact number of moments required arWfrAuxData: array of auxiliary wavefront data
Methods
__init__
([_arEx, _arEy, _typeE, _eStart, ...])- param _arEx:
horizontal complex electric field component array; NOTE: only 'f' (float) is supported for the moment (Jan. 2011)
addE
(_wfr[, _meth])Add Another Electric Field Wavefront :param _wfr: wavefront to be added :param _meth: method of adding the wavefront _wfr: 0- simple addition assuming _wfr to have same mesh as this wavefront 1- add using bilinear interpolation (taking into account meshes of the two wavefronts) 2- add using bi-quadratic interpolation (taking into account meshes of the two wavefronts) 3- add using bi-cubic interpolation (taking into account meshes of the two wavefronts)
allocate
(_ne, _nx, _ny[, _EXNeeded, ...])Allocate Electric Field data :param _ne: number of points vs photon energy / time :param _nx: number of points vs horizontal position / angle :param _ny: number of points vs vertical position / angle :param _EXNeeded: switch specifying whether Ex data is necessary or not (1 or 0) :param _EYNeeded: switch specifying whether Ey data is necessary or not (1 or 0) :param _typeE: numerical type of Electric Field data: float (single precision) or double ('f' or 'd'); double is not yet supported :param _backupNeeded: switch specifying whether backup of Electric Field data (arExAux, arEyAux) should be created or not (1 or 0)
calc_stokes
(_stokes[, _n_stokes_comp, ...])Calculate Stokes parameters from Electric Field
copy_comp
(_stokes)Copy compenents of Electric Field to Stokes structure
delE
([_type, _treatEX, _treatEY])Delete Electric Field data :param _type: type of data to be deleted: 0- arEx, arEy, arExAux, arEyAux; 1- arEx, arEy only; 2- arExAux, arEyAux only :param _treatEX: switch specifying whether Ex data should be deleted or not (1 or 0) :param _treatEY: switch specifying whether Ey data should be deleted or not (1 or 0)
sim_src_offset
(_dx, _dxp, _dy, _dyp[, ...])Simulate offset of the wavefront source in horizontal / vertical position and/or angle (version using opt.
- addE(_wfr, _meth=0)[source]#
Add Another Electric Field Wavefront :param _wfr: wavefront to be added :param _meth: method of adding the wavefront _wfr: 0- simple addition assuming _wfr to have same mesh as this wavefront 1- add using bilinear interpolation (taking into account meshes of the two wavefronts) 2- add using bi-quadratic interpolation (taking into account meshes of the two wavefronts) 3- add using bi-cubic interpolation (taking into account meshes of the two wavefronts)
- allocate(_ne, _nx, _ny, _EXNeeded=1, _EYNeeded=1, _typeE='f', _backupNeeded=0)[source]#
Allocate Electric Field data :param _ne: number of points vs photon energy / time :param _nx: number of points vs horizontal position / angle :param _ny: number of points vs vertical position / angle :param _EXNeeded: switch specifying whether Ex data is necessary or not (1 or 0) :param _EYNeeded: switch specifying whether Ey data is necessary or not (1 or 0) :param _typeE: numerical type of Electric Field data: float (single precision) or double (‘f’ or ‘d’); double is not yet supported :param _backupNeeded: switch specifying whether backup of Electric Field data (arExAux, arEyAux) should be created or not (1 or 0)
- calc_stokes(_stokes, _n_stokes_comp=4, _rx_avg=0, _ry_avg=0, _xc_avg=0, _yc_avg=0)[source]#
Calculate Stokes parameters from Electric Field
- delE(_type=0, _treatEX=1, _treatEY=1)[source]#
Delete Electric Field data :param _type: type of data to be deleted: 0- arEx, arEy, arExAux, arEyAux; 1- arEx, arEy only; 2- arExAux, arEyAux only :param _treatEX: switch specifying whether Ex data should be deleted or not (1 or 0) :param _treatEY: switch specifying whether Ey data should be deleted or not (1 or 0)