ochubar / SRW

Synchrotron Radiation Workshop
Other
82 stars 69 forks source link

How to simulate tapered undulator in srw_python? #6

Open tyjisinap opened 8 years ago

tyjisinap commented 8 years ago

It is easy to simulate tapered undulator in the srw_igor. is there a similar function in srw_python?

ochubar commented 8 years ago

Hello Yajun,

Yes, it is indeed easy to calculate spectral flux from a tapered undulator using SRW under Igor Pro (srw_igor). One has to specify undulator type as “tapered” in a drop-down box and define a taper parameter (Nu*dE/E) in the dialog accessible from Igor menu: SRWE->Undulator->Periodic Magnetic Field->Create and Modify… as illustrated in the attached graphic file. Then the spectral flux can be calculated the same way as for a non-tapered undulator, i.e. by: SRWE->Undulator->Compute Stokes…

Unfortunately, this was not yet ported to the Python version of SRW (as of Feb. 2016).

However, both in Igor and in Python versions, it is possible to define “arbitrary” tabulated magnetic field (e.g. the one of a tapered undulator), and calculate either single-electron spectral flux per unit surface, or a “multi-electron” one (using the “macro-particle” method). In “srw_igor”, this latter calculation can be done using “proc SrwIntArbMCCreate” (which can be found in “SRW Radiation StokesArb.ipf” file). In “srw_python”, this can be done with “def srwl_wfr_emit_prop_multi_e” function (which is defined in “srwlib.py” file); it can run in “parallel” mode (via MPI/mpi4py).

OC

From: Yajun Tong [mailto:notifications@github.com] Sent: Tuesday, January 26, 2016 8:36 PM To: ochubar/SRW SRW@noreply.github.com Subject: [SRW] How to simulate tapered undulator in srw_python? (#6)

It is easy to simulate tapered undulator in the srw_igor is there a similar function in srw_python?

— Reply to this email directly or view it on GitHubhttps://github.com/ochubar/SRW/issues/6.