Quickstart
Installation
This package requires Python 3.8+
.
You can install it simply from PyPI
in a virtual environment with:
pip install pyrws
Tip
Don’t know what a virtual environment is or how to set it up?
Here is a good primer on virtual environments by RealPython
.
Using the CommandLine Tool
One can use the tool by simply calling it with the -m
flag at the commandline. For instance, to display the help message and usage options:
python -m pyrws --help
To see these options, refer to the following page.
Example
Below is an example call to the tool. It calls the program for given sequence and opticsfile inputs, and asks for the creation of an improved rigid waist shift knob at IP1, with a unit setting of 1.
The outputs will be written to a newly created waist_shift folder, will use a figsize of (20, 9) for
the created plots, and will display them in interactive matplotlib
windows before exiting.
The logging level is set to show all log messages with a level of debug
or above.
python -m pyrws \
--sequence /path/to/lhc_as-built.seq \
--opticsfile /path/to/proton/opticsfiles/opticsfile.22 \
--ip 1 \
--waist_shift_setting 1 \
--outputdir waist_shift \
--show_plots true \
--figsize 20 9 \
--loglevel debug
Program Worfklow
The program’s workflow is reflected in the logs, and goes as follows:
Run the nominal scenario for beam 1, corresponding to the provided opticsfile and working point.
Apply a rigid waist shift for beam 1, for the given ip and with the provided waist_shift_setting.
Perform matchings on beam 1 to reduce the impact of the waist shift on the optics, and retrieve all the relevant knobs.
Export beam 1 data to disk.
Run the nominal scenario for beam 2, corresponding to the provided opticsfile and working point.
Apply the rigid waist shift for beam 2, using the triplet powering knob determined when creating the waist shift for beam 1.
Perform matchings on beam 2 to reduce the impact of the waist shift on the optics, and retrieve all the relevant knobs.
Export beam 2 data to disk.
Write all knobs to disk, for their absolute values as well as change to nominal scenario.
Create various plots from the beam 1 and beam 2 data, and write them to disk.
Eventually display the plots in interactive
matplotlib
windows.Exit.