iagapov / ocelot

Main repository moved to https://github.com/ocelot-collab/ocelot
GNU General Public License v3.0
8 stars 11 forks source link

Accelerator, radiation and x-ray optics simulation framework

An Introduction to Ocelot

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 ocelot/demos/

Ocelot user profile

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.

For example, you can see GUI for SASE optimization (uncomment and run next block)

Tutorials

The tutorial includes 7 simple examples dediacted to beam dynamics and optics. However, you should have a basic understanding of Computer Programming terminologies. A basic understanding of Python language is a plus.

This tutorial requires the following packages:

Optional to speed up python

The easiest way to get these is to download and install the (very large) Anaconda software distribution.

Alternatively, you can download and install miniconda. The following command will install all required packages:

$ conda install numpy scipy matplotlib ipython-notebook
Ocelot installation
  1. you have to download from GitHub zip file.
  2. Unzip ocelot-master.zip to your working folder /your_working_dir/.
  3. Rename folder ../your_working_dir/ocelot-master to /your_working_dir/ocelot.
  4. Add ../your_working_dir/ to PYTHONPATH

    • Windows 7: go to Control Panel -> System and Security -> System -> Advance System Settings -> Environment Variables. and in User variables add /your_working_dir/ to PYTHONPATH. If variable PYTHONPATH does not exist, create it

    Variable name: PYTHONPATH

    Variable value: ../your_working_dir/

    • Linux:
      $ export PYTHONPATH=/your_working_dir/:$PYTHONPATH

To launch "ipython notebook" or "jupyter notebook"

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"