Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kmod scripts new branch #463

Merged
merged 35 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ca5752c
added kmod scripts and tests to clean branch
fscarlier Sep 25, 2024
a8f18e7
Removed deleted files
fscarlier Sep 25, 2024
dbc98cb
Re-added zenodo file
fscarlier Sep 25, 2024
3f66b2a
kmod-import
JoschD Sep 25, 2024
0fd3a51
averaging
JoschD Sep 25, 2024
faf67d0
kmod averaging
JoschD Sep 26, 2024
7c8c50f
doc
JoschD Sep 26, 2024
4130c8f
lumi imbalance
JoschD Sep 26, 2024
0111f2d
dual-plane bstar and no averaging 1 file
JoschD Oct 24, 2024
3abab3c
removed files, fixed error propagation
JoschD Oct 24, 2024
a5b92b3
doc imbalance
JoschD Oct 24, 2024
4fcfd64
remove old kmod from doc
JoschD Oct 24, 2024
e880eec
version bump, changelog
JoschD Oct 24, 2024
f647678
average results with errors
JoschD Oct 24, 2024
9708876
averaging done
JoschD Oct 24, 2024
cc45145
kmod import done
JoschD Oct 24, 2024
b2a3f33
all tests
JoschD Oct 24, 2024
5716b54
deleted old test
JoschD Oct 24, 2024
c0e7fda
accidentally deleted knob extractor inputs
JoschD Oct 24, 2024
aadb2c3
no label
JoschD Oct 25, 2024
fd41ab2
allow more ips
JoschD Oct 31, 2024
71ec204
multi IP lumi imbalance tested
JoschD Oct 31, 2024
b1530c5
Merge branch 'master' into kmod_scripts_new_branch
JoschD Nov 6, 2024
cb336ba
moved to scripts and import of betastar as well
JoschD Nov 6, 2024
10a7d24
fixed importer
JoschD Nov 8, 2024
3d352a9
first draft importer
JoschD Nov 11, 2024
ca22d3a
kmod importer tested
JoschD Nov 11, 2024
f15e206
Merge branch 'master' into kmod_scripts_new_branch
JoschD Nov 12, 2024
0f15388
felix comments, better betastar-model handling
JoschD Nov 12, 2024
aee9255
more comments
JoschD Nov 12, 2024
37162ca
typo and effective beta doc
JoschD Nov 12, 2024
85ba6a0
full frame testing
JoschD Nov 12, 2024
a34fa8f
testing tests
JoschD Nov 12, 2024
dfad06c
doc
JoschD Nov 13, 2024
a1878a0
comment
JoschD Nov 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ instance/

# Sphinx build directory and sphinx-gallery generated documents
docs/_build/
docs/_build/
doc/_build/
doc_build/
.doc_build
.doc_build/
Expand Down
15 changes: 12 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# OMC3 Changelog

#### 2024-11-13 - v0.19.0 - _fscarlier_, _jdilly_

- Added K-Modulation tools:
- `kmod_importer`: Main function to call the following scripts in succession.
- `kmod_averages`: Combine k-modulation results into a single file.
- `kmod_lumi_imbalance`: Calculate the luminosity imbalance IP1 / IP5 from k-modulation results.
- `kmod_import`: Import k-modulation results into an `optics_measurements` directory as `beta_kmod_().tfs` file.

- Removed:
- Old k-modulation scripts: Functionality is either in k-mod GUI or in newly added scripts.

#### 2024-11-11 - v0.18.1 - _jdilly_

- Fixed:
- Setting sparkprops wrong in `knob_extractor` fixed.


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

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


#### 2024-10-29 - v0.17.0 - _jdilly_
#### 2024-10-29 - v0.17.0 - _jdilly_

- Added:
- Optics Measurements: `analyse_dpp` parameter, to analyse only files with a specific DPP for tune, phase and (C)RDTs.
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ Codes can then be run with either `python -m omc3.SCRIPT --FLAG ARGUMENT` or cal
#### Main Scripts

Main scripts to be executed lie in the [`/omc3`](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.
- `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.
- `run_kmod.py` to analyze data from K-modulation and return the measured optics functions.
- `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.
- `knob_extractor.py` to extract from `NXCALS` the value of given knobs in the machine at a given time.
- `madx_wrapper.py` to start a `MAD-X` run with a file or string as input.

#### Plotting Scripts

Expand All @@ -58,6 +58,7 @@ Plotting scripts for analysis outputs can be found in [`/omc3/plotting`](omc3/pl
- `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

Expand All @@ -67,7 +68,10 @@ Other general utility scripts are in [`/omc3/scripts`](omc3/scripts):
- `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.
- `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.

Example use for these scripts can be found in the [`tests`](tests) files.
Documentation including relevant flags and parameters can be found at <https://pylhc.github.io/omc3/>.
Expand Down
6 changes: 0 additions & 6 deletions doc/entrypoints/analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,3 @@ Analysis
.. automodule:: omc3.amplitude_detuning_analysis
:members:
:noindex:


.. automodule:: omc3.run_kmod
:members:
:noindex:

5 changes: 5 additions & 0 deletions doc/entrypoints/plotting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ Plotting
:noindex:


.. automodule:: omc3.plotting.plot_kmod_results
:members:
:noindex:


.. automodule:: omc3.plotting.plot_bbq
:members:
:noindex:
Expand Down
12 changes: 11 additions & 1 deletion doc/entrypoints/scripts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ Scripts
:noindex:


.. automodule:: omc3.scripts.merge_kmod_results
.. automodule:: omc3.scripts.kmod_averages
:members:
:noindex:


.. automodule:: omc3.scripts.kmod_import
:members:
:noindex:


.. automodule:: omc3.scripts.kmod_lumi_imbalance
:members:
:noindex:

Expand Down
17 changes: 0 additions & 17 deletions doc/modules/kmod.rst

This file was deleted.

2 changes: 1 addition & 1 deletion omc3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
__title__ = "omc3"
__description__ = "An accelerator physics tools package for the OMC team at CERN."
__url__ = "https://github.com/pylhc/omc3"
__version__ = "0.18.1"
__version__ = "0.19.0"
__author__ = "pylhc"
__author_email__ = "[email protected]"
__license__ = "MIT"
Expand Down
Empty file removed omc3/kmod/__init__.py
Empty file.
Loading