Accelerator, radiation and x-ray optics simulation framework
Ocelot is a multiphysics simulation toolkit designed for studying FEL and storage ring-based light sources. Ocelot is written in Python. Its central concept is the writing of python's scripts for simulations with the usage of Ocelot's modules and functions and the standard Python libraries.
Ocelot includes following main modules:
Ocelot extensively uses Python's NumPy (Numerical Python) and SciPy (Scientific Python) libraries, which enable efficient in-core numerical and scientific computation within Python and give you access to various mathematical and optimization techniques and algorithms. To produce high quality figures Python's matplotlib library is used.
It is an open source project and it is being developed by physicists from The European XFEL, DESY (Germany), NRC Kurchatov Institute (Russia).
We still have no documentation but you can find a lot of examples in /demos/ folder including this tutorial
Ocelot is designed for researchers who want to have the flexibility that is given by high-level languages such as Matlab, Python (with Numpy and SciPy) or Mathematica. However if someone needs a GUI it can be developed using Python's libraries like a PyQtGraph or PyQt.
The tutorial includes 9 examples dedicated to the beam dynamics and optics and 5 to Photon Field Simulation. However, you should have a basic understanding of Computer Programming terminologies. A basic understanding of Python language is a plus.
numpy
version 1.8 or later: http://www.numpy.org/scipy
version 0.15 or later: http://www.scipy.org/matplotlib
version 1.5 or later: http://matplotlib.org/ipython
version 2.4 or later, with notebook support: http://ipython.orgOptional, but highly recommended for speeding up calculations
Orbit Correction module
The easiest way to get these is to download and install the (large) Anaconda software distribution.
Alternatively, you can download and install miniconda. The following command will install all required packages:
$ conda install numpy scipy matplotlib jupyter
The easiest way to install OCELOT is to use Anaconda cloud. In that case use command:
$ conda install -c ocelot-collab ocelot
Clone OCELOT from GitHub:
$ git clone https://github.com/ocelot-collab/ocelot.git
or download last release zip file. Now you can install OCELOT from the source:
$ python setup.py install
Another way is download ocelot from GitHub
Add ../your_working_dir/ocelot-master to PYTHONPATH
Variable name: PYTHONPATH
Variable value: ../your_working_dir/ocelot-master/
$ export PYTHONPATH=/your_working_dir/ocelot-master:$PYTHONPATH
in command line run following commands:
$ ipython notebook
or
$ ipython notebook --notebook-dir="path_to_your_directory"
or
$ jupyter notebook --notebook-dir="path_to_your_directory"
You can download OCELOT jupyter tutorials (release v18.02) using GitHub link zip file.
Preliminaries: Setup & introduction
Introduction. Tutorial N1. Linear optics
Tutorial N8. Physics process addition. Laser heater
Tutorial N9. Simple accelerator based THz source
The API documentation can be build using sphinx. To do so, you have to clone the repository or download the zip file, as explained in the ocelot installation section. Then you can install all dependencies by running
python -m pip install -r docs/requirements.txt
python setup.py install
Now you can build the documentation by running
python setup.py build_sphinx
If these steps succeeded (yes, there are still very many errors and warnings during building the documentation),
you can browse the HTML documentation by opening build/sphinx/html/index.html
in your browser.
Disclaimer: The OCELOT code comes with absolutely NO warranty. The authors of the OCELOT do not take any responsibility for any damage to equipments or personnel injury that may result from the use of the code.