Skip to main content

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

Project description

omc3 logo 3

Tests 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

The package is deployed on PyPI and can easily be installed via pip:

python -m 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
python -m pip install --editable "omc3[all]"

Functionality

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

Main Scripts

Main scripts to be executed lie in the /omc3 directory. 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.
  • kmod_importer.py to average, import and calculate lumi-imbalace K-modulation results.
  • knob_extractor.py to extract from NXCALS the value of given knobs in the machine at a given time.
  • model_creator.py to generate optics models required for optics analysis.
  • global_correction.py to calculate corrections from measurement files.
  • response_creator.py to provide correction response files.
  • 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.
  • madx_wrapper.py to start a MAD-X run with a file or string as input.
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.
  • plot_kmod_results.py to plot the beta and waist of the K-modulation results.
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.
  • kmod_average.py to calculate the average of multiple K-modulation measurements.
  • kmod_import.py to import a K-modulation measurement into an optics-measurement directory.
  • kmod_lumi_imbalace.py to calculate the luminosity imbalance between two IPs from averaged K-modulation files.
  • bad_bpms_summary.py to collect and summarize the bad BPMs from GUI runs.
  • resync_bpms.py to perform re-synchronisation of SuperKEKB BPMs data after a first optics analysis.

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


Release history Release notifications | RSS feed

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.28.2.tar.gz (17.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

omc3-0.28.2-py3-none-any.whl (17.9 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: omc3-0.28.2.tar.gz
  • Upload date:
  • Size: 17.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.22 {"installer":{"name":"uv","version":"0.11.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for omc3-0.28.2.tar.gz
Algorithm Hash digest
SHA256 ff5eb2251c11206e540f22181c6d4c873c5ef23d22f32e07386e2ea9ac6a3c45
MD5 ad1153a16d0b0ce6b89e0e646bf93b03
BLAKE2b-256 97968b2ab079d6d55fe189a971cb92d58af508c29dc19f5f02d6f9afca7233fe

See more details on using hashes here.

File details

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

File metadata

  • Download URL: omc3-0.28.2-py3-none-any.whl
  • Upload date:
  • Size: 17.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.22 {"installer":{"name":"uv","version":"0.11.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for omc3-0.28.2-py3-none-any.whl
Algorithm Hash digest
SHA256 11c6d4e38f1859d4788332aa4446e33e9d24e45e60ac85cd2c3bfa6204904eb0
MD5 325c512bc549043b09a2e1f45afcefcc
BLAKE2b-256 82c0af2938ad19ba348c821a67ba3dd0007a55192c0b4ba8a3d380f24726002d

See more details on using hashes here.

Supported by

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