Coder Social home page Coder Social logo

kparasch / omc3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pylhc/omc3

0.0 0.0 0.0 93.15 MB

Python 3 codes for beam optics measurements and corrections in circular particle accelerators

Home Page: https://pylhc.github.io/omc3/

License: MIT License

Python 84.97% Makefile 0.20% Mask 0.89% Roff 13.93%

omc3's Introduction

3

Tests Code Climate coverage Code Climate maintainability (percentage) GitHub last commit GitHub release DOI

This is the python-tool package of the Optics Measurements and Corrections team (OMC) at CERN.

Most of the codes are generic and not limited to CERN accelerators, and the package can easily be used for your favorite circular accelerator. To see how to adapt this for your machine, see our documentation, Model section. To contribute, see our guidelines on the OMC website.

Documentation

Installing

Installation is easily done via pip:

pip install omc3

For development purposes, we recommend creating a new virtual environment and installing from VCS in editable mode with all extra dependencies (cern for packages only available in the CERN GPN, test for pytest and relevant plugins, and doc for packages needed to build documentation)

git clone https://github.com/pylhc/omc3
pip install --editable "omc3[all]"

Codes can then be run with either python -m omc3.SCRIPT --FLAG ARGUMENT or calling the .py file directly.

Functionality

Main Scripts

Main scripts to be executed lie in the /omc3 directory. These include:

  • global_correction.py to calculate corrections from measurement files.
  • hole_in_one.py to perform frequency analysis on turn by turn BPM data and infer optics (and more) for a given accelerator.
  • madx_wrapper.py to start a MAD-X run with a file or string as input.
  • model_creator.py to generate optics models required for optics analysis.
  • response_creator.py to provide correction response files.
  • run_kmod.py to analyze data from K-modulation and return the measured optics functions.
  • tbt_converter.py to convert different turn by turn data types to SDDS, potentially adding noise.
  • amplitude_detuning_analysis.py to perform amp. det. analysis on optics data with tune correction.
  • knob_extractor.py to extract from NXCALS the value of given knobs in the machine at a given time.

Plotting Scripts

Plotting scripts for analysis outputs can be found in /omc3/plotting:

  • plot_spectrum.py to generate plots from files generated by frequency analysis.
  • plot_bbq.py to generate plots from files generated by BBQ analysis.
  • plot_amplitude_detuning.py to generate plots from files generated by amplitude detuning analysis.
  • plot_optics_measurements.py to generate plots from files generated by optics_measurements.
  • plot_tfs.py all-purpose tfs-file plotter.

Other Scripts

Other general utility scripts are in /omc3/scripts:

  • update_nattune_in_linfile.py to update the natural tune columns in the lin files by finding the highest peak in the spectrum in a given interval.
  • write_madx_macros.py to generate MAD-X tracking macros with observation points from a TWISS file.
  • merge_kmod_results.py to merge LSA results files created by kmod, and add the luminosity imbalance if the 4 needed IP/Beam files combination are present.
  • fake_measurement_from_model.py to create a fake measurement based on a model TWISS file.
  • betabeatsrc_output_converter.py to convert outputs from our old codes to omc3's new standardized format.
  • linfile_clean.py to automatically clean given columns in lin files.

Example use for these scripts can be found in the tests files. Documentation including relevant flags and parameters can be found at https://pylhc.github.io/omc3/.

License

This project is licensed under the MIT License - see the LICENSE file for details.

omc3's People

Contributors

joschd avatar lmalina avatar fsoubelet avatar mihofer avatar awegsche avatar mael-le-garrec avatar jaimecp89 avatar tpersson avatar hgarciam avatar jacquelinekeintzel avatar fscarlier 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.