Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.
/ orm_analysis Public archive

Scripts for orbit response matrix analysis performed with madgui

Notifications You must be signed in to change notification settings

hibtc/orm_analysis

Repository files navigation

orm_analysis

Scripts for analyzing the ORM measurements performed with madgui.

Scripts

fit_model.py

Fit a MAD-X model to madgui ORM measurements.

model_params.py

Spit out a list of error parameters that can be fitted for the given model.

model_orbits.py

Compute model orbits and export to .txt files for all given optics using the specified errors.

measured_orbits.py

Convert madgui ORM measurement files to .txt files

bpm_export.py

Read CSV exports of beam profiles, compute weighted mean and export as .txt files.

backtrack_and_fit_tm.py

Visualize and investigate the discrepancies between model and measurements of G3MU3 (the final 90° gantry dipole).

quadscan.py

Investigate kL dependency in the quadscan measurements.

orm_generate.py

Generate a fake ORM measurement using a disturbed MAD-X model. This is used for testing.

orm_info.py

Quickly plot ORM measurements along with model expectations assuming a given error and print the chisq.

plot_folders.py

Plot the .txt files previously generated with model_orbits.py or measured_orbits.py

transpose_folder.py

Invert folder structure for output generated by model_orbits.py or measured_orbits.py this can be useful to faster compare certain parameters/elements with each other.

Examples

fit_model.py:

./fit_model.py -m hht3 --backtrack -e fit0/errors.yml -o fit0/ \
    data/2018-10-20-orm_measurements/M8-E108-F1-I9-G1/*.yml

./fit_model.py --help

The errors.yml file might look as follows:

Δay_h1ms1: 0.1      # absolute error
δax_h1ms2: 0.1      # relative error

model_params.py:

./model_params.py -m hht3 --ealign --twiss --knobs --attrs sbend->e1/e2

./model_params.py --help

model_orbits.py:

./model_orbits.py -m hht3 -o orbits0/ -i errors.yml \
    data/2018-10-20-orm_measurements/M8-E108-F1-I9-G1/*.yml

./model_orbits.py --help

measured_orbits.py:

./measured_orbits.py -m hht3 -o measured/ \
    data/2018-10-20-orm_measurements/M8-E108-F1-I9-G1

./measured_orbits.py --help

bpm_export.py:

./bpm_export.py Gitter-Exporte/*.CSV

backtrack_and_fit_tm.py:

./backtrack_and_fit_tm.py 2018-10-20-orm_measurements/M8-E108-F1-I9-G1/*.yml

Modules

orm_util

OrbitResponse class for reading in ORM measurements, and Analysis class for fitting etc

orm_plot

Functions for plotting orbits and ORM.

util Text utilities to output tables as .txt files.

About

Scripts for orbit response matrix analysis performed with madgui

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published