pysrw.lib.srwlib.SRWLMagFld3D#

class pysrw.lib.srwlib.SRWLMagFld3D(_arBx=None, _arBy=None, _arBz=None, _nx=0, _ny=0, _nz=0, _rx=0, _ry=0, _rz=0, _nRep=1, _interp=1, _arX=None, _arY=None, _arZ=None)[source]#

Bases: SRWLMagFld

Magnetic Field: Arbitrary 3D

__init__(_arBx=None, _arBy=None, _arBz=None, _nx=0, _ny=0, _nz=0, _rx=0, _ry=0, _rz=0, _nRep=1, _interp=1, _arX=None, _arY=None, _arZ=None)[source]#
Parameters:
  • _arBx – horizontal magnetic field component array [T]

  • _arBy – vertical magnetic field component array [T]

  • _arBz – longitudinal magnetic field component array [T]

  • _nx – number of magnetic field data points in the horizontal direction

  • _ny – number of magnetic field data points in the vertical direction

  • _nz – number of magnetic field data points in the longitudinal direction

  • _rx – range of horizontal coordinate for which the field is defined [m]

  • _ry – range of vertical coordinate for which the field is defined [m]

  • _rz – range of longitudinal coordinate for which the field is defined [m]

  • _nRep – “number of periods”, i.e. number of times the field is “repeated” in the longitudinal direction

  • _interp – interpolation method to use (e.g. for trajectory calculation), 1- bi-linear (3D), 2- (bi-)quadratic (3D), 3- (bi-)cubic (3D)

  • _arX – optional array of horizontal transverse coordinate of an irregular 3D mesh (if this array is defined, rx will be ignored)

  • _arY – optional array of vertical transverse coordinate of an irregular 3D mesh (if this array is defined, ry will be ignored)

  • _arZ – optional array of longitudinal coordinate of an irregular 3D mesh (if this array is defined, rz will be ignored)

Methods

__init__([_arBx, _arBy, _arBz, _nx, _ny, ...])

param _arBx:

horizontal magnetic field component array [T]

add_const([_bx, _by, _bz])

Adds constant magnetic field to the entire tabulated field (to simulate e.g. background magnetic field effects) :param _bx: horizontal magnetic field component to add [T] :param _by: vertical magnetic field component to add [T] :param _bz: longitudinal magnetic field component to add [T].

save_ascii(_file_path[, _xc, _yc, _zc])

Auxiliary function to write tabulated Arbitrary 3D Magnetic Field data to ASCII file

add_const(_bx=0, _by=0, _bz=0)[source]#

Adds constant magnetic field to the entire tabulated field (to simulate e.g. background magnetic field effects) :param _bx: horizontal magnetic field component to add [T] :param _by: vertical magnetic field component to add [T] :param _bz: longitudinal magnetic field component to add [T]

save_ascii(_file_path, _xc=0, _yc=0, _zc=0)[source]#

Auxiliary function to write tabulated Arbitrary 3D Magnetic Field data to ASCII file