Skip to content

Commit 4bb17b1

Browse files
authored
new parameter: analyse_dpp (#461)
* new parameter: analyse_dpp * tests * lots of maintenance * model renaming and rdt/crdt constant * changelog and bumpversion to 0.17.0
1 parent feea136 commit 4bb17b1

Some content is hidden

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

67 files changed

+1111
-591
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# OMC3 Changelog
22

3-
#### 2024-09-30 - v0.16.2 - _jdilly_
3+
#### 2024-10-29 - v0.17.0 - _jdilly_
4+
5+
- Added:
6+
- Optics Measurements: `analyse_dpp` parameter, to analyse only files with a specific DPP for tune, phase and (C)RDTs.
7+
8+
- Fixed:
9+
- Uncompensated Phase calculations with `Equation` compensation are now actually uncompensated when passed on to the `coupling` module.
10+
11+
#### 2024-10-28 - v0.16.2 - _jdilly_
412

513
- Fixed:
614
- Temporary hack to fix `knob_extractor` in CCC.

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.16.2"
14+
__version__ = "0.17.0"
1515
__author__ = "pylhc"
1616
__author_email__ = "[email protected]"
1717
__license__ = "MIT"

omc3/harpy/clean.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def _get_bad_bpms_summary(harpy_input, known_bad_bpms, bpm_flatness, bpm_spikes,
136136

137137
def _report_clean_stats(n_total_bpms, n_good_bpms):
138138
LOGGER.debug("Filtering done:")
139-
if n_total_bpms == 0:
139+
if n_good_bpms == 0:
140140
raise ValueError("Total Number of BPMs after filtering is zero.")
141141
n_bad_bpms = n_total_bpms - n_good_bpms
142142
LOGGER.debug(f"(Statistics for file reading) Total BPMs: {n_total_bpms}, "

omc3/hole_in_one.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
from omc3.harpy import handler
5151
from omc3.harpy.constants import LINFILES_SUBFOLDER
5252
from omc3.model import manager
53-
from omc3.optics_measurements import measure_optics
53+
from omc3.optics_measurements import measure_optics, phase
5454
from omc3.optics_measurements.data_models import InputFiles
5555
from omc3.utils import iotools, logging_tools
5656
from omc3.utils.contexts import timeit
@@ -302,6 +302,12 @@ def hole_in_one_entrypoint(opt, rest):
302302
Flags: **--union**
303303
Action: ``store_true``
304304
305+
- **analyse_dpp** *(float)*: Filter files to analyse by this value
306+
(in analysis for tune, phase, rdt and crdt)..
307+
308+
Flags: **--analyse_dpp**
309+
Default: ``0``
310+
305311
306312
Accelerator Kwargs:
307313
- **accel**: Choose the accelerator to use. More details can be found in omc3/model/manager.py
@@ -483,7 +489,7 @@ def harpy_params():
483489
params.add_parameter(name="bunch_ids", type=int, nargs="+",
484490
help="Bunches to process in multi-bunch file. "
485491
"If not specified, all bunches are processed.")
486-
params.add_parameter(name="to_write", nargs='+', default=HARPY_DEFAULTS["to_write"],
492+
params.add_parameter(name="to_write", nargs='*', default=HARPY_DEFAULTS["to_write"],
487493
choices=('lin', 'spectra', 'full_spectra', 'bpm_summary'),
488494
help="Choose the type of output.")
489495
params.add_parameter(name="tbt_datatype", default=HARPY_DEFAULTS["tbt_datatype"],
@@ -600,7 +606,7 @@ def optics_params():
600606
help="Use 3 BPM method in beta from phase")
601607
params.add_parameter(name="only_coupling", action="store_true", help="Calculate only coupling. ")
602608
params.add_parameter(name="compensation", type=str, default=OPTICS_DEFAULTS["compensation"],
603-
choices=("model", "equation", "none"),
609+
choices=phase.CompensationMode.all(),
604610
help="Mode of compensation for the analysis after driven beam excitation")
605611
params.add_parameter(name="three_d_excitation", action="store_true",
606612
help="Use 3D kicks to calculate dispersion")
@@ -610,6 +616,8 @@ def optics_params():
610616
help="Calculate second order dispersion")
611617
params.add_parameter(name="chromatic_beating", action="store_true",
612618
help="Calculate chromatic beatings: W, PHI and coupling")
619+
params.add_parameter(name="analyse_dpp", type=iotools.OptionalFloat, default=OPTICS_DEFAULTS["analyse_dpp"],
620+
help="Filter files to analyse by this value (in analysis for tune, phase, rdt and crdt).")
613621
return params
614622

615623

@@ -637,6 +645,7 @@ def optics_params():
637645
"range_of_bpms": 11,
638646
"compensation": "model",
639647
"rdt_magnet_order": 4,
648+
"analyse_dpp": 0,
640649
}
641650

642651

0 commit comments

Comments
 (0)