Units

Units#

Here is a summary of the units used for the simulation quantities

  • length/position: m

  • angles: rad

  • beam energy: ZGeV

  • radiation energy: eV

  • radiation wavelength: nm

  • radiation intensity: ph / (s mm^2 nm) (default) or ph / (s mm^2 0.1%BW)

  • radiation polarization angle: deg

Known issues and tips#

  • SRW hangs when a standard computation function is called after a multiprocessing function in the same session. This problem concerns the functions imported from srwl. To avoid this issue, you can use dummy multiprocessing functions using one process only (i.e. setting up a fully multiprocess script with numProcess=1 when you don’t need parallel computation.

  • among the calculation methods, manual should be avoided as it is quite difficult to tune the simulation parameters and achieve an acceptable output.

  • the observer should be placed away from the beam. Although SRW rises an error only if the observer is less than one wavelength far from the magnet container limit, it’s recommended to keep a much higher distance to avoid artefacts.

  • the module is not entirely optimized for memory saving purposes. Objects are sometimes deepcopied for a simpler and more flexible usage. This can be a problem when dealing with heavy wavefront objects (>100 MB) on RAM limited computers. Using a lower level scripting, especially for the wavefront manipulation part, can mitigate this problem.

  • wavefront resizing is a powerful tool, but it should be used carefully. Increasing the resolution before propagation can significantly improve results and is typically less resource-intensive than computing the initial wavefront with a finer mesh. During focusing stages, cropping the wavefront (possibly combined with resolution enhancement) is an efficient way to conserve memory, as it eliminates large regions of extremely low intensity outside the focused light spot.

  • Auto-resize options are discouraged in multi-particle simulations, as there is no guarantee that the output wavefront will always have the same mesh, thus bothering the analysis of the results.