Giter Site home page Giter Site logo

1778393206 / ocelot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ocelot-collab/ocelot

0.0 0.0 0.0 590.78 MB

OCELOT is a multiphysics simulation toolkit designed for studying FEL and storage ring-based light sources.

License: GNU General Public License v3.0

Shell 0.01% C++ 2.43% Python 96.24% C 0.27% CSS 1.01% Makefile 0.05% Batchfile 0.01%

ocelot's Introduction

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:

  • Charged particle beam dynamics module (CPBD)
    • optics
    • tracking
    • matching
    • collective effects (description can be found here and here)
      • Space Charge (3D Laplace solver)
      • CSR (Coherent Synchrotron Radiation) (1D model with arbitrary number of dipoles).
      • Wakefields (Taylor expansion up to second order for arbitrary geometry).
    • MOGA (Multi Objective Genetics Algorithm) ref.
  • Native module for spontaneous radiation calculation (some details can be found here and here)
  • FEL calculations: interface to GENESIS and pre/post-processing
  • Modules for online beam control and online optimization of accelerator performances. ref1, ref2, ref3, ref4.
    • This module is being developed in collaboration with other accelerator groups. The module has been migrated to a separate repository (in ocelot-collab organization) for ease of collaborative development.

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 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.

Preliminaries

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.

This tutorial requires the following packages:

Optional, but highly recommended for speeding up calculations

  • numexpr (version 2.6.1)
  • pyfftw (version 0.10)
  • numba

Orbit Correction module

  • pandas

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

Ocelot installation

Anaconda Cloud recommended

The easiest way to install OCELOT is to use Anaconda cloud. In that case use command:

$ conda install -c ocelot-collab ocelot
GitHub

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
PythonPath

Another way is download ocelot from GitHub

  1. you have to download from GitHub zip file.

  2. Unzip ocelot-master.zip to your working folder /your_working_dir/.

  3. Add ../your_working_dir/ocelot-master 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/ocelot-master/ to PYTHONPATH. If variable PYTHONPATH does not exist, create it

    Variable name: PYTHONPATH

    Variable value: ../your_working_dir/ocelot-master/

    • Linux:
    $ export PYTHONPATH=/your_working_dir/ocelot-master:$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"

OCELOT jupyter tutorials

You can download OCELOT jupyter tutorials (release v18.02) using GitHub link zip file.

Tutorials

  • Preliminaries: Setup & introduction

Beam dynamics

Photon field simulation

Appendixes

Documentation

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.

ocelot's People

Contributors

sergey-tomin avatar sserkez avatar st-walker avatar zagorodnov avatar angelfp avatar mykola-vrmchk avatar iagapov avatar andre-trebushi avatar ggeloni avatar yefomin avatar novokshonov avatar zeugaushh avatar michael-boese avatar ttanikawa avatar cfgrote avatar smartsammler avatar paugc avatar lehnertu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.