-
Notifications
You must be signed in to change notification settings - Fork 7
Bad BPM presentation #163
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
Merged
Merged
Bad BPM presentation #163
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /* docs/css/custom_colors.css */ | ||
|
|
||
| /* Define the specific colors using CSS variables (optional but good practice) */ | ||
| :root { | ||
| --color-cernniceblue: #0669b2; | ||
| --color-atlasgreen: #27a572; | ||
| --color-cernred: #e15e32; | ||
| --color-atlasorange: #f09010; | ||
| --color-cernlightblue: #15b3da; | ||
| --color-cernpurple: #6e2466; | ||
| } | ||
|
|
||
| /* General emphasis class */ | ||
| .omc-emph { | ||
| color: var(--md-primary-fg-color); | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| /* Custom emphasis classes (for bpm_filtering.md) */ | ||
| .tbt-related { color: var(--color-atlasgreen); font-weight: bold; } | ||
| .svd-related { color: var(--color-cernred); font-weight: bold; } | ||
| .spec-related { color: var(--color-atlasorange); font-weight: bold; } | ||
| .manual-related { color: var(--color-cernlightblue); font-weight: bold; } | ||
| .iforest-related { color: var(--color-cernpurple); font-weight: bold; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
|
|
||
|
|
||
| The content of this page has been converted from the presenation given as ["OMC3 bad BPM detection" on the 31.03.2025](https://indico.cern.ch/event/1531923/) . | ||
|
|
||
|
|
||
| ## OMC-Analysis | ||
|
|
||
|  | ||
|
|
||
| * To get <span class="omc-emph">reliable</span> and <span class="omc-emph">reproducible</span> optics measurements, we cannot trust all BPM data that we are getting. | ||
| * At <span class="omc-emph">different stages</span> of the code, we try to determine the ``trustworthyness''. | ||
JoschD marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * Some BPMs are fully <span class="omc-emph">excluded</span>, others are getting <span class="omc-emph">errorbars</span> based on their <span class="omc-emph">noise-level</span> (which are often used as *weights*, e.g. for correction calculations). | ||
|
|
||
|
|
||
| ## Automatic | ||
|
|
||
| * First the <span class="tbt-related">Turn-by-Turn Data</span> is checked for ``obvious'' signs. | ||
JoschD marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * <span class="tbt-related">EXACT_ZERO</span>: Any value has an <span class="tbt-related">exact zero</span> (might lead to false positives, but unlikely if happens in multiple datasets). | ||
| * <span class="tbt-related">NANS</span>: Data contains <span class="tbt-related">NaN-values</span> (happens in SPS BPMs). | ||
| * <span class="tbt-related">FLAT</span>: <span class="tbt-related">Peak-to-Peak</span> value was <span class="tbt-related">below</span> a given threshold (10nm). | ||
| * <span class="tbt-related">SPIKY</span>: A <span class="tbt-related">spike</span> in the data, <span class="tbt-related">above</span> a given threshold (2cm). | ||
| * To reduce <span class="svd-related">noise</span> we perform an SVD-decomposition and keep only the <span class="svd-related">strongest modes</span>. | ||
| * <span class="svd-related">SVD_PEAK</span>: The BPM had a <span class="svd-related">mode</span> in the U-Matrix above a given threshold (0.925). | ||
| * Most information about the optics come from a <span class="spec-related">spectral analysis</span>. | ||
| * <span class="spec-related">NO_TUNE</span>: Tune line could <span class="spec-related">not be found</span> in the spectrum. | ||
| * <span class="spec-related">TUNE_CLEAN</span>: Tune line found was <span class="spec-related">too far from the average</span> of the other BPMs. | ||
|
|
||
| ## Manual | ||
|
|
||
|
|
||
| * <span class="manual-related">KNOWN</span>: Identified <span class="manual-related">manually</span>; sticking out spectrum/optics <span class="manual-related">regularly</span>. | ||
| * <span class="manual-related">Large error bars</span>. | ||
| * <span class="manual-related">Non-sensical</span> data points. | ||
| * Cause <span class="manual-related">analysis issues</span> (e.g. phase-offsets, negative $\beta$, NaNs). | ||
| * <span class="manual-related">Calibration</span> issues: | ||
| * $\beta$-form-phase looks normal, peak in $\beta$-from-amplitude | ||
JoschD marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| * $\beta$-ratios large. | ||
| * Measure in <span class="manual-related">different optics</span> to <span class="manual-related">confirm BPM issue</span>. | ||
| * **Good hint:** <span class="manual-related">Filtering them solves observed issues</span>. | ||
|
|
||
|  | ||
JoschD marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Isolation Forest | ||
|
|
||
| * Using <span class="iforest-related">machine learning techniques</span> to identify Bad-BPMs. | ||
| * <span class="iforest-related">IFOREST</span>: Identified BPM, due to being an <span class="iforest-related">outlier in Tune, Noise and/or Amplitude</span> | ||
|
|
||
| !!! warning "Under Re-evaluation" | ||
| This functionality is currently under re-evaluation and has only been used on a small amount of data in 2021-2024! | ||
JoschD marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|  | ||
|
|
||
|
|
||
| [E. Fol - Machine Learning for BPM failure detection](https://indico.cern.ch/event/762124/contributions/3174751/attachments/1740028/2815322/hss_meeting_2410.pdf)<br> | ||
| [E. Fol - Isolation Forest for bad BPMs: performance evaluation](https://indico.cern.ch/event/776442/contributions/3228674/attachments/1759222/2853627/omc_meeting_26nov.pdf) | ||
|
|
||
| ## Bad BPMs Summary Script | ||
|
|
||
| * Bad-BPMs are written out in files <span class="omc-emph">per analysed TbT-Data</span>. | ||
| * Script available to <span class="omc-emph">gather, summarize and make statistics</span>. | ||
|
|
||
| ```bash | ||
| usage: bad_bpms_summary.py [-h] --dates DATES [DATES ...] [--root ROOT] [--outfile OUTFILE] | ||
| [--print_percentage PRINT_PERCENTAGE] [--accel_glob ACCEL_GLOB] | ||
|
|
||
| options: | ||
| --dates DATES [DATES ...] | ||
| Dates to include in analysis. This should be either subfolders in | ||
| `root` or glob-patterns for those. | ||
| --root ROOT Path to the root directory, containing the dates. | ||
| Default: `/user/slops/data/LHC_DATA/OP_DATA/BetaBeat/` | ||
| --outfile OUTFILE Path to the file to write out. | ||
| --print_percentage PRINT_PERCENTAGE | ||
| Print out BPMs that appear in more than this percentage of measurements. | ||
| --accel_glob ACCEL_GLOB | ||
| Accelerator name (glob for the sub-directories). | ||
| ``` | ||
|
|
||
| Example: All bad BPMs from 2025, written into file and all > 50% in terminal | ||
|
|
||
| ``` | ||
| python -m omc3.scripts.bad_bpms_summary --dates 2025-* \ | ||
| --accel_glob LHCB* \ | ||
| --outfile bad_bpms_2025.txt \ | ||
| --print_percentage 50 | ||
| ``` | ||
|
|
||
|  | ||
|
|
||
|
|
||
|
|
||
| *[BPM]: Beam Position Monitor | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.