Skip to content

samoylv/SRW

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

"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)

About

Synchrotron Radiation Workshop

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published