forked from ochubar/SRW
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
76 lines (62 loc) · 4.63 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
"Synchrotron Radiation Workshop" (SRW)
--------------------------------------
SRW is a physical optics computer code for calculation of detailed characteristics of Synchrotron Radiation (SR) generated by relativistic electrons in magnetic fields of arbitrary configuration and for simulation of the radiation wavefront propagation through optical systems of beamlines. Frequency-domain near-field methods are used for the SR calculation, and the Fourier-optics based approach is generally used for the wavefront propagation simulation. The code enables both fully- and partially-coherent radiation propagation simulations in steady-state and in frequency-/time-dependent regimes. With these features, the code has already proven its utility for a large number of applications in infrared, UV, soft and hard X-ray spectral range, in such important areas as analysis of spectral performances of new synchrotron radiation sources, optimization of user beamlines, development of new optical elements, source and beamline diagnostics, and even complete simulation of SR based experiments. Besides the SR applications, the code can be efficiently used for various simulations involving conventional lasers and other sources. SRW versions interfaced to Python and to IGOR Pro (WaveMetrics), as well as cross-platform library with C API, are available.
In the following writing, it is assumed that "SRW_Dev" is absolute path to the full SRW directory (obtained e.g. after downloading from repository).
Using pre-compiled SRW libraries and clients / bindings:
--------------------------------------------------------
The last ~"clean" releases of SRW for IGOR Pro and for Python can be found in SRW_Dev/env/release, in particular:
- installers (of compressed packages) can be found in SRW_Dev/env/release/install;
- unpacked folder of SRW for IGOR Pro (for Windows only) is:
SRW_Dev/env/release/srw_igor; this folder contains ReadMe.txt file with general "start-up" notes; detailed documentation for IGOR Pro version can be found in: SRW_Dev/env/release/srw_igor/SRW Help/SRW Help.ifn file (in IGOR formatted notebook format);
- unpacked folder of SRW for Python (for Windows and Linux) is: SRW_Dev/env/release/srw_python; this folder contains ReadMe.txt file with general "start-up" notes.
Besides, some recent pre-releases and current work versions of SRW for IGOR Pro and for Python can be found in: SRW_Dev/env/work.
Compiling and testing SRW Library and its Python and IGOR Pro bindings on Windows:
------------------------------------------------------------------
Microsoft Visual C++ 2008 (or later version) solution file (SRW.sln), which includes 4 projects:
- SRW Library (file SRWLIB.vcproj),
- SRW Python client / binding (file SRWLClientPython.vcproj),
- SRW IGOR Pro client / binding (file SRWLClientIgor.vcproj),
- SRW C demo client (file SRWLClientC.vcproj),
can be found in SRW_Dev/cpp/vc.
Compiling and testing SRW Library and its Python binding on Linux:
------------------------------------------------------------------
1. Download and compile fftw-2.1.5 library as required for SRW (assuming that absolute path to SRW directory is "SRW_Dev"):
Download fftw-2.1.5.tar.gz from FFTW site (probably http://www.fftw.org/download.html) and place it to SRW_Dev/ext_lib
cd SRW_Dev/ext_lib
tar -zxvf fftw-2.1.5.tar.gz
cd fftw-2.1.5
configure --enable-float --with-pic
Manually (using editor) add -fPIC option to CFLAGS in Makefile
make
make install
cp fftw/.libs/libfftw.a SRW_Dev/ext_lib/
2. Compile SRWLib library and Python binding:
cd SRW_Dev/cpp/gcc
Make sure that Python 3.2 or higher (or Python 2.7) is installed
In Makefile, specify correct PYFLAGS path to Python include file and library
rm libsrw.a
make all
cp srwlpy.so ../../env/work/srw_python/
3. Check examples:
Make sure that path to Python 3.2 (or 2.7) is added to the PATH variable and "srw_python" to PYTHONPATH variable:
export PATH="$PATH:<absolute path to Python 3.2>" # this is not necessary if you install python using the distro's package manager
export PYTHONPAH="$PYTHONPATH:SRW_Dev/env/work/srw_python/" # temporarely solution
or
echo "export PYTHONPATH=$PYTHONPATH:SRW_Dev/env/work/srw_python/" >> ~/.bashrc # permanent solution for a single user
Setting up PYTHONPATH allows to import srwlpy module from any directory.
cd SRW_Dev/env/work/srw_python
python SRWLIB_ExampleXX.py
Authors and Contributors to SRW project:
----------------------------------------
O. Chubar (ESRF - SOLEIL - BNL)
P. Elleaume (ESRF)
J. Chavanne (ESRF)
P. Dumas (SOLEIL)
L. Samoylova (E-XFEL)
A. Buzmakov (E-XFEL)
G. Geloni (E-XFEL)
I. Agapov (E-XFEL)
J. Sutter (DIAMOND)
D. Laundy (DIAMOND)
N. Canestrari (ESRF - BNL)
R. Reininger (APS)