pysrw.wavefronts.WavefrontMultiWavelength#
- class pysrw.wavefronts.WavefrontMultiWavelength(observer, fromWavelength, toWavelength, numPoints)[source]#
Bases:
SRWLWfr
Class to represent the spectral distribution of the radiation field. Notice that the points of the spectrum are uniformly sampled by SRW in the frequency (or photon energy) axis. These points are therefore not uniformely distributed in wavelength.
- Parameters:
observer – an observation mesh instance of
Observer
. The spectrum is computed at the centre of the observer. The extension and the resolution of the observer are ignored.fromWavelength – lower wavelength in nanometers.
toWavelength – upper wavelength in nanometers.
numPoints – number of wavelengths to simulate.
Methods
__init__
(observer, fromWavelength, ...)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)
getSpectrumI
([pol, practicalUnits])Compute the spectral distribution of the selected polarization
Extract the array of each field component from the wavefront.
sim_src_offset
(_dx, _dxp, _dy, _dyp[, ...])Simulate offset of the wavefront source in horizontal / vertical position and/or angle (version using opt.
- getSpectrumI(pol='TOT', practicalUnits=True)[source]#
- Compute the spectral distribution of the selected polarization
component.
- Parameters:
pol (optional) – one of the
POL
polarization states or an angle in degrees for any arbitrary linear polarization. Defaults to “TOT”.practicalUnits (optional) – if True, the intensity is computed in ph/(s mm^2 nm) otherwise the default ph/(s mm^2 0.1%BW) are used. Defaults to True.
- Returns:
- a dictionary containing the photon energy axis
(uniform sampling), the corresponding wavelength axis and the intensity data.
- Return type:
dict