Skip to content

Getting Started with OMC3

Quick start

The omc3 package is Python 3.7+ compatible, but not yet deployed to PyPI. The best way to install is though pip and VCS:

git clone https://github.com/pylhc/omc3
pip install /path/to/omc3

Or simply from the online master branch, which is stable:

pip install git+https://github.com/pylhc/omc3.git

After installing, codes can be run with either python -m omc3.SCRIPT --FLAG ARGUMENT or calling path to the .py file directly.

Functionality

Main Scripts

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

  • 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 provide optics models required for optics analysis.
  • run_kmod.py to analyse data from K-modulation and return the measured optics functions.
  • tbt_converter.py to convert different turn by turn datatypes to sdds, and add noise.
  • amplitude_detuning_analysis.py to perform amp. det. analysis on optics data with tune correction.

Plotting Scripts

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

  • 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 module:

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

A typical analysis workflow with omc3 is described in the next page.