Skip to content

Commit 19f7e86

Browse files
fscarlierJoschD
andauthored
K-modulation scripts (#463)
* added kmod scripts and tests * removed old kmod merge and run scripts * doc * version 0.19.0 --------- Co-authored-by: JoschD <[email protected]>
1 parent 2f56871 commit 19f7e86

File tree

122 files changed

+11484
-77695
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+11484
-77695
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ instance/
7373

7474
# Sphinx build directory and sphinx-gallery generated documents
7575
docs/_build/
76-
docs/_build/
76+
doc/_build/
7777
doc_build/
7878
.doc_build
7979
.doc_build/

CHANGELOG.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
# OMC3 Changelog
22

3+
#### 2024-11-13 - v0.19.0 - _fscarlier_, _jdilly_
4+
5+
- Added K-Modulation tools:
6+
- `kmod_importer`: Main function to call the following scripts in succession.
7+
- `kmod_averages`: Combine k-modulation results into a single file.
8+
- `kmod_lumi_imbalance`: Calculate the luminosity imbalance IP1 / IP5 from k-modulation results.
9+
- `kmod_import`: Import k-modulation results into an `optics_measurements` directory as `beta_kmod_().tfs` file.
10+
11+
- Removed:
12+
- Old k-modulation scripts: Functionality is either in k-mod GUI or in newly added scripts.
13+
314
#### 2024-11-11 - v0.18.1 - _jdilly_
415

516
- Fixed:
617
- Setting sparkprops wrong in `knob_extractor` fixed.
7-
818

919
#### 2024-10-29 - v0.18.0 - _jgray_
1020

@@ -17,8 +27,7 @@
1727
- Fixed:
1828
- Fixed the `response_twiss` when updating the response matrix when calculating the global correction.
1929

20-
21-
#### 2024-10-29 - v0.17.0 - _jdilly_
30+
#### 2024-10-29 - v0.17.0 - _jdilly_
2231

2332
- Added:
2433
- Optics Measurements: `analyse_dpp` parameter, to analyse only files with a specific DPP for tune, phase and (C)RDTs.

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ Codes can then be run with either `python -m omc3.SCRIPT --FLAG ARGUMENT` or cal
4040
#### Main Scripts
4141

4242
Main scripts to be executed lie in the [`/omc3`](omc3) directory. These include:
43-
- `global_correction.py` to calculate corrections from measurement files.
4443
- `hole_in_one.py` to perform frequency analysis on turn by turn BPM data and infer optics (and more) for a given accelerator.
45-
- `madx_wrapper.py` to start a `MAD-X` run with a file or string as input.
44+
- `kmod_importer.py` to average, import and calculate lumi-imbalace K-modulation results.
45+
- `knob_extractor.py` to extract from `NXCALS` the value of given knobs in the machine at a given time.
4646
- `model_creator.py` to generate optics models required for optics analysis.
47+
- `global_correction.py` to calculate corrections from measurement files.
4748
- `response_creator.py` to provide correction response files.
48-
- `run_kmod.py` to analyze data from K-modulation and return the measured optics functions.
4949
- `tbt_converter.py` to convert different turn by turn data types to `SDDS`, potentially adding noise.
5050
- `amplitude_detuning_analysis.py` to perform amp. det. analysis on optics data with tune correction.
51-
- `knob_extractor.py` to extract from `NXCALS` the value of given knobs in the machine at a given time.
51+
- `madx_wrapper.py` to start a `MAD-X` run with a file or string as input.
5252

5353
#### Plotting Scripts
5454

@@ -58,6 +58,7 @@ Plotting scripts for analysis outputs can be found in [`/omc3/plotting`](omc3/pl
5858
- `plot_amplitude_detuning.py` to generate plots from files generated by amplitude detuning analysis.
5959
- `plot_optics_measurements.py` to generate plots from files generated by optics_measurements.
6060
- `plot_tfs.py` all-purpose tfs-file plotter.
61+
- `plot_kmod_results.py` to plot the beta and waist of the K-modulation results.
6162

6263
#### Other Scripts
6364

@@ -67,7 +68,10 @@ Other general utility scripts are in [`/omc3/scripts`](omc3/scripts):
6768
- `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.
6869
- `fake_measurement_from_model.py` to create a fake measurement based on a model TWISS file.
6970
- `betabeatsrc_output_converter.py` to convert outputs from our old codes to `omc3`'s new standardized format.
70-
- `linfile_clean.py` to automatically clean given columns in lin files.
71+
- `linfile_clean.py` to automatically clean given columns in lin files.
72+
- `kmod_average.py` to calculate the average of multiple K-modulation measurements.
73+
- `kmod_import.py` to import a K-modulation measurement into an optics-measurement directory.
74+
- `kmod_lumi_imbalace.py` to calculate the luminosity imbalance between two IPs from averaged K-modulation files.
7175

7276
Example use for these scripts can be found in the [`tests`](tests) files.
7377
Documentation including relevant flags and parameters can be found at <https://pylhc.github.io/omc3/>.

doc/entrypoints/analysis.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,3 @@ Analysis
99
.. automodule:: omc3.amplitude_detuning_analysis
1010
:members:
1111
:noindex:
12-
13-
14-
.. automodule:: omc3.run_kmod
15-
:members:
16-
:noindex:
17-

doc/entrypoints/plotting.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ Plotting
2626
:noindex:
2727

2828

29+
.. automodule:: omc3.plotting.plot_kmod_results
30+
:members:
31+
:noindex:
32+
33+
2934
.. automodule:: omc3.plotting.plot_bbq
3035
:members:
3136
:noindex:

doc/entrypoints/scripts.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@ Scripts
66
:noindex:
77

88

9-
.. automodule:: omc3.scripts.merge_kmod_results
9+
.. automodule:: omc3.scripts.kmod_averages
10+
:members:
11+
:noindex:
12+
13+
14+
.. automodule:: omc3.scripts.kmod_import
15+
:members:
16+
:noindex:
17+
18+
19+
.. automodule:: omc3.scripts.kmod_lumi_imbalance
1020
:members:
1121
:noindex:
1222

doc/modules/kmod.rst

Lines changed: 0 additions & 17 deletions
This file was deleted.

omc3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
__title__ = "omc3"
1212
__description__ = "An accelerator physics tools package for the OMC team at CERN."
1313
__url__ = "https://github.com/pylhc/omc3"
14-
__version__ = "0.18.1"
14+
__version__ = "0.19.0"
1515
__author__ = "pylhc"
1616
__author_email__ = "[email protected]"
1717
__license__ = "MIT"

omc3/kmod/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)