Skip to main content

An accelerator physics tools package for the OMC team at CERN.

Project description

3

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

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

The omc3 package is Python 3.7+ compatible, but not yet deployed to PyPI. The best way to install it is through pip from the online master branch, which is stable:

pip install git+https://github.com/pylhc/omc3.git#egg=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 analyse data from K-modulation and return the measured optics functions.
  • tbt_converter.py to convert different turn by turn datatypes to SDDS, potentially adding 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 /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.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omc3-0.2.0.tar.gz (20.4 MB view details)

Uploaded Source

Built Distribution

omc3-0.2.0-py3-none-any.whl (20.8 MB view details)

Uploaded Python 3

File details

Details for the file omc3-0.2.0.tar.gz.

File metadata

  • Download URL: omc3-0.2.0.tar.gz
  • Upload date:
  • Size: 20.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for omc3-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b331b4f5408ebbb0f4e24d17c9bfc481172f82cb5ed2c74ade040e91059ee6ae
MD5 b5178cbc47d2ab2e46e78fe20c20030b
BLAKE2b-256 7097830640b111334a4970a20fe9d3c6e8f3d03221ca4e43074a10c7c0f5d1a5

See more details on using hashes here.

File details

Details for the file omc3-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: omc3-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 20.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for omc3-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 75af1ff6fc2b90b597d4d1d4c9334024856b27050c104d3f717146da37b995ae
MD5 476d82b1825a957ae45047f765fd8758
BLAKE2b-256 9283e7d4f64042dd05eb277586b829c0c00ef43498488115381a124a81a962f5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page