diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index f91bafc6..dc7a5e72 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -5,6 +5,9 @@ defaults: run: shell: bash +env: + UV_COMPILE_BYTECODE: 1 + on: # Runs on any push event to master push: branches: @@ -12,35 +15,29 @@ on: # Runs on any push event to master jobs: documentation: - name: ${{ matrix.os }} / ${{ matrix.python-version }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - python-version: [3.12] + name: Build and Publish Static Documentation + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + - name: Install uv and Python + uses: astral-sh/setup-uv@v6 with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - cache-dependency-path: '**/requirements.txt' - - - name: Upgrade pip, setuptools and wheel - run: python -m pip install --upgrade pip setuptools wheel + python-version: 3.13 + enable-cache: true + activate-environment: true + cache-dependency-glob: "requirements.txt" - name: Install dependencies - run: python -m pip install -r requirements.txt + run: uv pip install -r requirements.txt - name: Build documentation run: python -m mkdocs build -d ./doc_build - name: Upload documentation to gh-pages - if: success() uses: JamesIves/github-pages-deploy-action@v4 + if: success() with: token: ${{ secrets.GITHUB_TOKEN }} branch: gh-pages diff --git a/.github/workflows/test_build.yml b/.github/workflows/test_build.yml index a8ead9d8..419ac73e 100644 --- a/.github/workflows/test_build.yml +++ b/.github/workflows/test_build.yml @@ -5,32 +5,29 @@ defaults: run: shell: bash +env: + UV_COMPILE_BYTECODE: 1 + on: [push, pull_request] # Runs on all push events to any branch jobs: documentation: - name: ${{ matrix.os }} / ${{ matrix.python-version }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - python-version: [3.12] + name: Build Static Documentation + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 + - name: Install uv and Python + uses: astral-sh/setup-uv@v6 with: - python-version: ${{ matrix.python-version }} - cache: 'pip' - cache-dependency-path: '**/requirements.txt' - - - name: Upgrade pip, setuptools and wheel - run: python -m pip install --upgrade pip setuptools wheel + python-version: 3.13 + enable-cache: true + activate-environment: true + cache-dependency-glob: "requirements.txt" - name: Install dependencies - run: python -m pip install -r requirements.txt + run: uv pip install -r requirements.txt - name: Build documentation run: python -m mkdocs build -d ./doc_build diff --git a/README.md b/README.md index 0bd0c753..8eac2304 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Get a local copy of this repository, set up a `Python3.6+` environment and insta ```bash git clone https://github.com/pylhc/pylhc.github.io -pip install mkdocs mkdocs-material mkdocs-minify-plugin +python -m pip install mkdocs mkdocs-material mkdocs-minify-plugin ``` Create a branch (from master) and make your changes. diff --git a/docs/assets/images/betabeat_gui/analysis_panel_table.png b/docs/assets/images/betabeat_gui/analysis_panel_table.png new file mode 100644 index 00000000..ca84f046 Binary files /dev/null and b/docs/assets/images/betabeat_gui/analysis_panel_table.png differ diff --git a/docs/assets/images/betabeat_gui/analysis_spectrum.png b/docs/assets/images/betabeat_gui/analysis_spectrum.png new file mode 100644 index 00000000..1ff8b346 Binary files /dev/null and b/docs/assets/images/betabeat_gui/analysis_spectrum.png differ diff --git a/docs/assets/images/betabeat_gui/analysis_timespace.png b/docs/assets/images/betabeat_gui/analysis_timespace.png new file mode 100644 index 00000000..c31b046d Binary files /dev/null and b/docs/assets/images/betabeat_gui/analysis_timespace.png differ diff --git a/docs/assets/images/betabeat_gui/beam_selection.png b/docs/assets/images/betabeat_gui/beam_selection.png new file mode 100644 index 00000000..c584be43 Binary files /dev/null and b/docs/assets/images/betabeat_gui/beam_selection.png differ diff --git a/docs/assets/images/betabeat_gui/bpm_data_phase_space.png b/docs/assets/images/betabeat_gui/bpm_data_phase_space.png new file mode 100644 index 00000000..9eefd5da Binary files /dev/null and b/docs/assets/images/betabeat_gui/bpm_data_phase_space.png differ diff --git a/docs/assets/images/betabeat_gui/bpm_panel.png b/docs/assets/images/betabeat_gui/bpm_panel.png new file mode 100644 index 00000000..ad55299b Binary files /dev/null and b/docs/assets/images/betabeat_gui/bpm_panel.png differ diff --git a/docs/assets/images/betabeat_gui/bpm_panel_table.png b/docs/assets/images/betabeat_gui/bpm_panel_table.png new file mode 100644 index 00000000..cf39810c Binary files /dev/null and b/docs/assets/images/betabeat_gui/bpm_panel_table.png differ diff --git a/docs/assets/images/betabeat_gui/bpm_turn_by_turn_data.png b/docs/assets/images/betabeat_gui/bpm_turn_by_turn_data.png new file mode 100644 index 00000000..d8f315ce Binary files /dev/null and b/docs/assets/images/betabeat_gui/bpm_turn_by_turn_data.png differ diff --git a/docs/assets/images/betabeat_gui/console.png b/docs/assets/images/betabeat_gui/console.png new file mode 100644 index 00000000..0cea0097 Binary files /dev/null and b/docs/assets/images/betabeat_gui/console.png differ diff --git a/docs/assets/images/betabeat_gui/corrections_correction_test.png b/docs/assets/images/betabeat_gui/corrections_correction_test.png new file mode 100644 index 00000000..8ac4da82 Binary files /dev/null and b/docs/assets/images/betabeat_gui/corrections_correction_test.png differ diff --git a/docs/assets/images/betabeat_gui/corrections_global_window.png b/docs/assets/images/betabeat_gui/corrections_global_window.png new file mode 100644 index 00000000..3bd0a9d5 Binary files /dev/null and b/docs/assets/images/betabeat_gui/corrections_global_window.png differ diff --git a/docs/assets/images/betabeat_gui/corrections_knob_panel.png b/docs/assets/images/betabeat_gui/corrections_knob_panel.png new file mode 100644 index 00000000..664bedb9 Binary files /dev/null and b/docs/assets/images/betabeat_gui/corrections_knob_panel.png differ diff --git a/docs/assets/images/betabeat_gui/corrections_strengths.png b/docs/assets/images/betabeat_gui/corrections_strengths.png new file mode 100644 index 00000000..33fdf76c Binary files /dev/null and b/docs/assets/images/betabeat_gui/corrections_strengths.png differ diff --git a/docs/assets/images/betabeat_gui/do_analysis_dialog.png b/docs/assets/images/betabeat_gui/do_analysis_dialog.png new file mode 100644 index 00000000..ef12bf69 Binary files /dev/null and b/docs/assets/images/betabeat_gui/do_analysis_dialog.png differ diff --git a/docs/assets/images/betabeat_gui/do_analysis_dialog_open_settings.png b/docs/assets/images/betabeat_gui/do_analysis_dialog_open_settings.png new file mode 100644 index 00000000..f6ef94a6 Binary files /dev/null and b/docs/assets/images/betabeat_gui/do_analysis_dialog_open_settings.png differ diff --git a/docs/assets/images/betabeat_gui/gui_top.png b/docs/assets/images/betabeat_gui/gui_top.png new file mode 100644 index 00000000..7b256a49 Binary files /dev/null and b/docs/assets/images/betabeat_gui/gui_top.png differ diff --git a/docs/assets/images/betabeat_gui/log_viewer.png b/docs/assets/images/betabeat_gui/log_viewer.png new file mode 100644 index 00000000..10e4b0d5 Binary files /dev/null and b/docs/assets/images/betabeat_gui/log_viewer.png differ diff --git a/docs/assets/images/betabeat_gui/model_creation_lhc.png b/docs/assets/images/betabeat_gui/model_creation_lhc.png new file mode 100644 index 00000000..c98b7b8a Binary files /dev/null and b/docs/assets/images/betabeat_gui/model_creation_lhc.png differ diff --git a/docs/assets/images/betabeat_gui/model_creation_ps.png b/docs/assets/images/betabeat_gui/model_creation_ps.png new file mode 100644 index 00000000..6b31e065 Binary files /dev/null and b/docs/assets/images/betabeat_gui/model_creation_ps.png differ diff --git a/docs/assets/images/betabeat_gui/model_creation_psb.png b/docs/assets/images/betabeat_gui/model_creation_psb.png new file mode 100644 index 00000000..3c2e59c5 Binary files /dev/null and b/docs/assets/images/betabeat_gui/model_creation_psb.png differ diff --git a/docs/assets/images/betabeat_gui/model_creation_sps.png b/docs/assets/images/betabeat_gui/model_creation_sps.png new file mode 100644 index 00000000..64ad41d0 Binary files /dev/null and b/docs/assets/images/betabeat_gui/model_creation_sps.png differ diff --git a/docs/assets/images/betabeat_gui/model_creation_window.png b/docs/assets/images/betabeat_gui/model_creation_window.png new file mode 100644 index 00000000..f9c5ee1c Binary files /dev/null and b/docs/assets/images/betabeat_gui/model_creation_window.png differ diff --git a/docs/assets/images/betabeat_gui/model_creation_with_model.png b/docs/assets/images/betabeat_gui/model_creation_with_model.png new file mode 100644 index 00000000..6db3d504 Binary files /dev/null and b/docs/assets/images/betabeat_gui/model_creation_with_model.png differ diff --git a/docs/assets/images/betabeat_gui/open_files.png b/docs/assets/images/betabeat_gui/open_files.png new file mode 100644 index 00000000..f4e869bd Binary files /dev/null and b/docs/assets/images/betabeat_gui/open_files.png differ diff --git a/docs/assets/images/betabeat_gui/open_files_folders.png b/docs/assets/images/betabeat_gui/open_files_folders.png new file mode 100644 index 00000000..a844d492 Binary files /dev/null and b/docs/assets/images/betabeat_gui/open_files_folders.png differ diff --git a/docs/assets/images/betabeat_gui/optics_action_tune.png b/docs/assets/images/betabeat_gui/optics_action_tune.png new file mode 100644 index 00000000..07bc95c4 Binary files /dev/null and b/docs/assets/images/betabeat_gui/optics_action_tune.png differ diff --git a/docs/assets/images/betabeat_gui/optics_logbook_entry_window.png b/docs/assets/images/betabeat_gui/optics_logbook_entry_window.png new file mode 100644 index 00000000..486d7c49 Binary files /dev/null and b/docs/assets/images/betabeat_gui/optics_logbook_entry_window.png differ diff --git a/docs/assets/images/betabeat_gui/optics_panel.png b/docs/assets/images/betabeat_gui/optics_panel.png new file mode 100644 index 00000000..f7d8beac Binary files /dev/null and b/docs/assets/images/betabeat_gui/optics_panel.png differ diff --git a/docs/assets/images/betabeat_gui/optics_plot_export.png b/docs/assets/images/betabeat_gui/optics_plot_export.png new file mode 100644 index 00000000..0d0e61f1 Binary files /dev/null and b/docs/assets/images/betabeat_gui/optics_plot_export.png differ diff --git a/docs/assets/images/betabeat_gui/plot_with_hover.png b/docs/assets/images/betabeat_gui/plot_with_hover.png new file mode 100644 index 00000000..713fd9ee Binary files /dev/null and b/docs/assets/images/betabeat_gui/plot_with_hover.png differ diff --git a/docs/assets/images/betabeat_gui/rbac.png b/docs/assets/images/betabeat_gui/rbac.png new file mode 100644 index 00000000..73d3a449 Binary files /dev/null and b/docs/assets/images/betabeat_gui/rbac.png differ diff --git a/docs/assets/images/betabeat_gui/running_tasks.png b/docs/assets/images/betabeat_gui/running_tasks.png new file mode 100644 index 00000000..c6b31952 Binary files /dev/null and b/docs/assets/images/betabeat_gui/running_tasks.png differ diff --git a/docs/assets/images/betabeat_gui/settings_accelerator.png b/docs/assets/images/betabeat_gui/settings_accelerator.png new file mode 100644 index 00000000..b3e2df7d Binary files /dev/null and b/docs/assets/images/betabeat_gui/settings_accelerator.png differ diff --git a/docs/assets/images/betabeat_gui/settings_cleaning.png b/docs/assets/images/betabeat_gui/settings_cleaning.png new file mode 100644 index 00000000..01266f28 Binary files /dev/null and b/docs/assets/images/betabeat_gui/settings_cleaning.png differ diff --git a/docs/assets/images/betabeat_gui/settings_gui.png b/docs/assets/images/betabeat_gui/settings_gui.png new file mode 100644 index 00000000..09817120 Binary files /dev/null and b/docs/assets/images/betabeat_gui/settings_gui.png differ diff --git a/docs/assets/images/betabeat_gui/settings_harpy.png b/docs/assets/images/betabeat_gui/settings_harpy.png new file mode 100644 index 00000000..ebae22da Binary files /dev/null and b/docs/assets/images/betabeat_gui/settings_harpy.png differ diff --git a/docs/assets/images/betabeat_gui/settings_optics.png b/docs/assets/images/betabeat_gui/settings_optics.png new file mode 100644 index 00000000..777967d5 Binary files /dev/null and b/docs/assets/images/betabeat_gui/settings_optics.png differ diff --git a/docs/assets/images/betabeat_gui/settings_tunes.png b/docs/assets/images/betabeat_gui/settings_tunes.png new file mode 100644 index 00000000..7e4d2c37 Binary files /dev/null and b/docs/assets/images/betabeat_gui/settings_tunes.png differ diff --git a/docs/assets/images/betabeat_gui/top_buttons.png b/docs/assets/images/betabeat_gui/top_buttons.png new file mode 100644 index 00000000..9888e234 Binary files /dev/null and b/docs/assets/images/betabeat_gui/top_buttons.png differ diff --git a/docs/assets/images/bpm_filtering/badbpm.png b/docs/assets/images/bpm_filtering/badbpm.png deleted file mode 100644 index ff8c5785..00000000 Binary files a/docs/assets/images/bpm_filtering/badbpm.png and /dev/null differ diff --git a/docs/assets/images/bpm_filtering/bpmvsowl.png b/docs/assets/images/bpm_filtering/bpmvsowl.png deleted file mode 100644 index ff0be4e8..00000000 Binary files a/docs/assets/images/bpm_filtering/bpmvsowl.png and /dev/null differ diff --git a/docs/assets/images/chroma_gui/chromaticity_tab.png b/docs/assets/images/chroma_gui/chromaticity_tab.png new file mode 100644 index 00000000..72a70514 Binary files /dev/null and b/docs/assets/images/chroma_gui/chromaticity_tab.png differ diff --git a/docs/assets/images/chroma_gui/cleaning_tab_cleaned_data.png b/docs/assets/images/chroma_gui/cleaning_tab_cleaned_data.png new file mode 100644 index 00000000..bc28c5c1 Binary files /dev/null and b/docs/assets/images/chroma_gui/cleaning_tab_cleaned_data.png differ diff --git a/docs/assets/images/chroma_gui/cleaning_tab_raw_data.png b/docs/assets/images/chroma_gui/cleaning_tab_raw_data.png new file mode 100644 index 00000000..78595762 Binary files /dev/null and b/docs/assets/images/chroma_gui/cleaning_tab_raw_data.png differ diff --git a/docs/assets/images/chroma_gui/corrections_tab.png b/docs/assets/images/chroma_gui/corrections_tab.png new file mode 100644 index 00000000..88c3f86a Binary files /dev/null and b/docs/assets/images/chroma_gui/corrections_tab.png differ diff --git a/docs/assets/images/chroma_gui/default_view.png b/docs/assets/images/chroma_gui/default_view.png new file mode 100644 index 00000000..70920746 Binary files /dev/null and b/docs/assets/images/chroma_gui/default_view.png differ diff --git a/docs/assets/images/chroma_gui/new_analysis_menu.png b/docs/assets/images/chroma_gui/new_analysis_menu.png new file mode 100644 index 00000000..2c39f1a9 Binary files /dev/null and b/docs/assets/images/chroma_gui/new_analysis_menu.png differ diff --git a/docs/assets/images/chroma_gui/plot_extracted_data.png b/docs/assets/images/chroma_gui/plot_extracted_data.png new file mode 100644 index 00000000..ea5f5a0b Binary files /dev/null and b/docs/assets/images/chroma_gui/plot_extracted_data.png differ diff --git a/docs/assets/images/gui_ide_setup/vscode_cbng.png b/docs/assets/images/gui_ide_setup/vscode_cbng.png new file mode 100644 index 00000000..646be0ce Binary files /dev/null and b/docs/assets/images/gui_ide_setup/vscode_cbng.png differ diff --git a/docs/assets/images/gui_ide_setup/vscode_gradle_tasks.png b/docs/assets/images/gui_ide_setup/vscode_gradle_tasks.png new file mode 100644 index 00000000..d0b5d446 Binary files /dev/null and b/docs/assets/images/gui_ide_setup/vscode_gradle_tasks.png differ diff --git a/docs/assets/images/kmod_gui/analysis_result.png b/docs/assets/images/kmod_gui/analysis_result.png new file mode 100644 index 00000000..9449f43c Binary files /dev/null and b/docs/assets/images/kmod_gui/analysis_result.png differ diff --git a/docs/assets/images/kmod_gui/analysis_settings.png b/docs/assets/images/kmod_gui/analysis_settings.png new file mode 100644 index 00000000..19f8f99b Binary files /dev/null and b/docs/assets/images/kmod_gui/analysis_settings.png differ diff --git a/docs/assets/images/kmod_gui/analyzing_config.png b/docs/assets/images/kmod_gui/analyzing_config.png deleted file mode 100644 index 2dff3904..00000000 Binary files a/docs/assets/images/kmod_gui/analyzing_config.png and /dev/null differ diff --git a/docs/assets/images/kmod_gui/analyzing_trim_result.png b/docs/assets/images/kmod_gui/analyzing_trim_result.png deleted file mode 100644 index a9c31027..00000000 Binary files a/docs/assets/images/kmod_gui/analyzing_trim_result.png and /dev/null differ diff --git a/docs/assets/images/kmod_gui/autotrim_date_picker.png b/docs/assets/images/kmod_gui/autotrim_date_picker.png deleted file mode 100644 index 95910121..00000000 Binary files a/docs/assets/images/kmod_gui/autotrim_date_picker.png and /dev/null differ diff --git a/docs/assets/images/kmod_gui/autotrim_input.png b/docs/assets/images/kmod_gui/autotrim_input.png deleted file mode 100644 index ce581e85..00000000 Binary files a/docs/assets/images/kmod_gui/autotrim_input.png and /dev/null differ diff --git a/docs/assets/images/kmod_gui/autotrim_load_existing.png b/docs/assets/images/kmod_gui/autotrim_load_existing.png deleted file mode 100644 index 40f1a06f..00000000 Binary files a/docs/assets/images/kmod_gui/autotrim_load_existing.png and /dev/null differ diff --git a/docs/assets/images/kmod_gui/autotrim_simulation_mode.gif b/docs/assets/images/kmod_gui/autotrim_simulation_mode.gif deleted file mode 100644 index a28bc1bb..00000000 Binary files a/docs/assets/images/kmod_gui/autotrim_simulation_mode.gif and /dev/null differ diff --git a/docs/assets/images/kmod_gui/autotrim_status_panel.png b/docs/assets/images/kmod_gui/autotrim_status_panel.png deleted file mode 100644 index 302e13b2..00000000 Binary files a/docs/assets/images/kmod_gui/autotrim_status_panel.png and /dev/null differ diff --git a/docs/assets/images/kmod_gui/autotrim_thread_queue.png b/docs/assets/images/kmod_gui/autotrim_thread_queue.png deleted file mode 100644 index dc6ef047..00000000 Binary files a/docs/assets/images/kmod_gui/autotrim_thread_queue.png and /dev/null differ diff --git a/docs/assets/images/kmod_gui/autotrim_trim_selection_wizard.png b/docs/assets/images/kmod_gui/autotrim_trim_selection_wizard.png deleted file mode 100644 index 52798de9..00000000 Binary files a/docs/assets/images/kmod_gui/autotrim_trim_selection_wizard.png and /dev/null differ diff --git a/docs/assets/images/kmod_gui/betastar_input.png b/docs/assets/images/kmod_gui/betastar_input.png deleted file mode 100644 index 81924add..00000000 Binary files a/docs/assets/images/kmod_gui/betastar_input.png and /dev/null differ diff --git a/docs/assets/images/kmod_gui/circuit_selection.png b/docs/assets/images/kmod_gui/circuit_selection.png new file mode 100644 index 00000000..0cd51a45 Binary files /dev/null and b/docs/assets/images/kmod_gui/circuit_selection.png differ diff --git a/docs/assets/images/kmod_gui/default_view.png b/docs/assets/images/kmod_gui/default_view.png new file mode 100644 index 00000000..696d3d00 Binary files /dev/null and b/docs/assets/images/kmod_gui/default_view.png differ diff --git a/docs/assets/images/kmod_gui/directory_selection.png b/docs/assets/images/kmod_gui/directory_selection.png new file mode 100644 index 00000000..0606db11 Binary files /dev/null and b/docs/assets/images/kmod_gui/directory_selection.png differ diff --git a/docs/assets/images/kmod_gui/fetch_kmod.png b/docs/assets/images/kmod_gui/fetch_kmod.png new file mode 100644 index 00000000..d95e0c8f Binary files /dev/null and b/docs/assets/images/kmod_gui/fetch_kmod.png differ diff --git a/docs/assets/images/kmod_gui/ip_panel_trim.png b/docs/assets/images/kmod_gui/ip_panel_trim.png deleted file mode 100644 index f684794a..00000000 Binary files a/docs/assets/images/kmod_gui/ip_panel_trim.png and /dev/null differ diff --git a/docs/assets/images/kmod_gui/load_model.png b/docs/assets/images/kmod_gui/load_model.png deleted file mode 100644 index 4898de8d..00000000 Binary files a/docs/assets/images/kmod_gui/load_model.png and /dev/null differ diff --git a/docs/assets/images/kmod_gui/loading_modulation.png b/docs/assets/images/kmod_gui/loading_modulation.png new file mode 100644 index 00000000..40959896 Binary files /dev/null and b/docs/assets/images/kmod_gui/loading_modulation.png differ diff --git a/docs/assets/images/kmod_gui/measurement_view.png b/docs/assets/images/kmod_gui/measurement_view.png deleted file mode 100644 index d325db46..00000000 Binary files a/docs/assets/images/kmod_gui/measurement_view.png and /dev/null differ diff --git a/docs/assets/images/kmod_gui/modulation_view.png b/docs/assets/images/kmod_gui/modulation_view.png new file mode 100644 index 00000000..d6ab467b Binary files /dev/null and b/docs/assets/images/kmod_gui/modulation_view.png differ diff --git a/docs/assets/images/kmod_gui/select_quadrupole.png b/docs/assets/images/kmod_gui/select_quadrupole.png deleted file mode 100644 index 305e8a7c..00000000 Binary files a/docs/assets/images/kmod_gui/select_quadrupole.png and /dev/null differ diff --git a/docs/assets/images/kmod_gui/select_trim_by_date.png b/docs/assets/images/kmod_gui/select_trim_by_date.png deleted file mode 100644 index f672cb54..00000000 Binary files a/docs/assets/images/kmod_gui/select_trim_by_date.png and /dev/null differ diff --git a/docs/assets/images/kmod_gui/select_trim_panel.png b/docs/assets/images/kmod_gui/select_trim_panel.png deleted file mode 100644 index d93ce93d..00000000 Binary files a/docs/assets/images/kmod_gui/select_trim_panel.png and /dev/null differ diff --git a/docs/assets/images/kmod_gui/trim_config.png b/docs/assets/images/kmod_gui/trim_config.png deleted file mode 100644 index d8fc32a6..00000000 Binary files a/docs/assets/images/kmod_gui/trim_config.png and /dev/null differ diff --git a/docs/assets/images/kmod_gui/trim_result_panel.png b/docs/assets/images/kmod_gui/trim_result_panel.png deleted file mode 100644 index 2a4aefb9..00000000 Binary files a/docs/assets/images/kmod_gui/trim_result_panel.png and /dev/null differ diff --git a/docs/assets/images/multiturn_gui/ACDipoleScheduler.png b/docs/assets/images/multiturn_gui/ACDipoleScheduler.png new file mode 100644 index 00000000..f84b37fe Binary files /dev/null and b/docs/assets/images/multiturn_gui/ACDipoleScheduler.png differ diff --git a/docs/assets/images/multiturn_gui/ADTACDipole.png b/docs/assets/images/multiturn_gui/ADTACDipole.png new file mode 100644 index 00000000..141fe464 Binary files /dev/null and b/docs/assets/images/multiturn_gui/ADTACDipole.png differ diff --git a/docs/assets/images/multiturn_gui/bunch_selection.png b/docs/assets/images/multiturn_gui/bunch_selection.png new file mode 100644 index 00000000..50293363 Binary files /dev/null and b/docs/assets/images/multiturn_gui/bunch_selection.png differ diff --git a/docs/assets/images/multiturn_gui/concentrator_settings.png b/docs/assets/images/multiturn_gui/concentrator_settings.png new file mode 100644 index 00000000..9d43fd0f Binary files /dev/null and b/docs/assets/images/multiturn_gui/concentrator_settings.png differ diff --git a/docs/assets/images/multiturn_gui/create_kick_group.png b/docs/assets/images/multiturn_gui/create_kick_group.png new file mode 100644 index 00000000..7d4d4289 Binary files /dev/null and b/docs/assets/images/multiturn_gui/create_kick_group.png differ diff --git a/docs/assets/images/multiturn_gui/create_schedule_table.png b/docs/assets/images/multiturn_gui/create_schedule_table.png new file mode 100644 index 00000000..c22305b9 Binary files /dev/null and b/docs/assets/images/multiturn_gui/create_schedule_table.png differ diff --git a/docs/assets/images/multiturn_gui/default_view.png b/docs/assets/images/multiturn_gui/default_view.png new file mode 100644 index 00000000..ffd05d14 Binary files /dev/null and b/docs/assets/images/multiturn_gui/default_view.png differ diff --git a/docs/assets/images/multiturn_gui/flag_status.png b/docs/assets/images/multiturn_gui/flag_status.png new file mode 100644 index 00000000..d273237e Binary files /dev/null and b/docs/assets/images/multiturn_gui/flag_status.png differ diff --git a/docs/assets/images/multiturn_gui/lsa_generation_bp_optics_table.png b/docs/assets/images/multiturn_gui/lsa_generation_bp_optics_table.png new file mode 100644 index 00000000..0001cf51 Binary files /dev/null and b/docs/assets/images/multiturn_gui/lsa_generation_bp_optics_table.png differ diff --git a/docs/assets/images/multiturn_gui/measurement_environment.png b/docs/assets/images/multiturn_gui/measurement_environment.png new file mode 100644 index 00000000..0a4f0ec7 Binary files /dev/null and b/docs/assets/images/multiturn_gui/measurement_environment.png differ diff --git a/docs/assets/images/multiturn_gui/prewritten_schedules.png b/docs/assets/images/multiturn_gui/prewritten_schedules.png new file mode 100644 index 00000000..0bde8489 Binary files /dev/null and b/docs/assets/images/multiturn_gui/prewritten_schedules.png differ diff --git a/docs/assets/images/multiturn_gui/select_kick_group.png b/docs/assets/images/multiturn_gui/select_kick_group.png new file mode 100644 index 00000000..81dd88f4 Binary files /dev/null and b/docs/assets/images/multiturn_gui/select_kick_group.png differ diff --git a/docs/assets/images/multiturn_gui/tunes_setup.png b/docs/assets/images/multiturn_gui/tunes_setup.png new file mode 100644 index 00000000..afd918bf Binary files /dev/null and b/docs/assets/images/multiturn_gui/tunes_setup.png differ diff --git a/docs/assets/images/rdtfeeddown_gui/CorrectionResponseScreenshot.png b/docs/assets/images/rdtfeeddown_gui/CorrectionResponseScreenshot.png new file mode 100644 index 00000000..2ee15604 Binary files /dev/null and b/docs/assets/images/rdtfeeddown_gui/CorrectionResponseScreenshot.png differ diff --git a/docs/assets/images/rdtfeeddown_gui/CorrectionScreenshot.png b/docs/assets/images/rdtfeeddown_gui/CorrectionScreenshot.png new file mode 100644 index 00000000..f6e2cfe2 Binary files /dev/null and b/docs/assets/images/rdtfeeddown_gui/CorrectionScreenshot.png differ diff --git a/docs/assets/images/rdtfeeddown_gui/InputScreenshot.png b/docs/assets/images/rdtfeeddown_gui/InputScreenshot.png new file mode 100644 index 00000000..a2eb218d Binary files /dev/null and b/docs/assets/images/rdtfeeddown_gui/InputScreenshot.png differ diff --git a/docs/assets/images/rdtfeeddown_gui/ValidationBPMScreenshot.png b/docs/assets/images/rdtfeeddown_gui/ValidationBPMScreenshot.png new file mode 100644 index 00000000..c62845e1 Binary files /dev/null and b/docs/assets/images/rdtfeeddown_gui/ValidationBPMScreenshot.png differ diff --git a/docs/assets/images/rdtfeeddown_gui/ValidationRDTScreenshot.png b/docs/assets/images/rdtfeeddown_gui/ValidationRDTScreenshot.png new file mode 100644 index 00000000..8859d2b1 Binary files /dev/null and b/docs/assets/images/rdtfeeddown_gui/ValidationRDTScreenshot.png differ diff --git a/docs/assets/images/rdtfeeddown_gui/ValidationRDTshiftScreenshot.png b/docs/assets/images/rdtfeeddown_gui/ValidationRDTshiftScreenshot.png new file mode 100644 index 00000000..ecbac970 Binary files /dev/null and b/docs/assets/images/rdtfeeddown_gui/ValidationRDTshiftScreenshot.png differ diff --git a/docs/assets/images/rdtfeeddown_gui/ValidationScreenshot.png b/docs/assets/images/rdtfeeddown_gui/ValidationScreenshot.png new file mode 100644 index 00000000..abe2b7cd Binary files /dev/null and b/docs/assets/images/rdtfeeddown_gui/ValidationScreenshot.png differ diff --git a/docs/assets/images/rdtfeeddown_gui/errorlog.png b/docs/assets/images/rdtfeeddown_gui/errorlog.png new file mode 100644 index 00000000..aa71a628 Binary files /dev/null and b/docs/assets/images/rdtfeeddown_gui/errorlog.png differ diff --git a/docs/assets/images/rdtfeeddown_gui/help.png b/docs/assets/images/rdtfeeddown_gui/help.png new file mode 100644 index 00000000..171fd3e9 Binary files /dev/null and b/docs/assets/images/rdtfeeddown_gui/help.png differ diff --git a/docs/css/custom_colors.css b/docs/css/custom_colors.css index 49b2fed4..662769b3 100644 --- a/docs/css/custom_colors.css +++ b/docs/css/custom_colors.css @@ -3,11 +3,19 @@ /* 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-atlasgreen: #27a572; + --color-cernred: #e15e32; + --color-atlasorange: #f09010; --color-cernlightblue: #15b3da; - --color-cernpurple: #6e2466; + --color-cernpurple: #6e2466; +} + + +/* Useful to set a `cern` blue as primary in mkdocs.yml (dark mode) */ +[data-md-color-primary="cern"] { + --md-primary-fg-color: #0033a0; + --md-primary-fg-color--light: #9BAEDB; + --md-primary-fg-color--dark: #0033A0; } /* General emphasis class */ @@ -16,4 +24,48 @@ font-weight: bold; } +.warning-colored { + color: var(--color-atlasorange); + font-weight: bold; +} + +.cernred { + color: var(--color-cernred); + font-weight: bold; +} + +.settings-icon { + display: inline-flex; + justify-content: center; + align-items: center; + width: 1.1em; + height: 1.1em; + background-color: rgb(71, 148, 192); + color: white; + font-size: 1em; + border-radius: 4px; /* optional: adds slight rounding */ +} + +.green-gui-button kbd { + background-color: rgb(88, 226, 46) !important; + color: black !important; + box-shadow: 0 .1rem 0 .05rem var(--md-typeset-kbd-border-color),0 .1rem 0 var(--md-typeset-kbd-border-color),0 -.1rem .2rem rgb(159, 202, 146) inset;; +} + +.red-gui-button kbd { + background-color: rgb(226, 46, 46) !important; + color: black !important; + box-shadow: 0 .1rem 0 .05rem var(--md-typeset-kbd-border-color),0 .1rem 0 var(--md-typeset-kbd-border-color),0 -.1rem .2rem rgb(202, 142, 124) inset;; +} + +.yellow-gui-button kbd { + background-color: rgb(255, 201, 0) !important; + color: black !important; + box-shadow: 0 .1rem 0 .05rem var(--md-typeset-kbd-border-color),0 .1rem 0 var(--md-typeset-kbd-border-color),0 -.1rem .2rem rgb(202, 177, 124) inset;; +} +.blue-gui-button kbd { + background-color: rgb(0, 0, 255) !important; + color: rgb(250, 247, 247) !important; + box-shadow: 0 .1rem 0 .05rem var(--md-typeset-kbd-border-color),0 .1rem 0 var(--md-typeset-kbd-border-color),0 -.1rem .2rem rgb(124, 125, 202) inset;; +} \ No newline at end of file diff --git a/docs/css/extra.css b/docs/css/extra.css index 192df0fc..d42ec61d 100644 --- a/docs/css/extra.css +++ b/docs/css/extra.css @@ -72,7 +72,7 @@ a.cern_internal { .md-typeset .nodeco .leftFigure, .md-typeset .nodeco .rightFigure { - width:45%; + width:45%; margin: 0 0 0 0; display: inline-block; } @@ -91,12 +91,6 @@ a.cern_internal { } -/* Not used but I'll leave it here in case someone wants to test it. Just put `cern` as primary in mkdocs.yml (jdilly) */ -[data-md-color-primary="cern"] { - --md-primary-fg-color: #0033a0; - --md-primary-fg-color--light: #9BAEDB; - --md-primary-fg-color--dark: #0033A0; -} /* Fix the Mathjax scrolling boxes issue */ .md-typeset div.arithmatex { @@ -106,3 +100,36 @@ a.cern_internal { .clickImg { cursor: pointer; } + +.rdtfeeddown_guilabel { + white-space: nowrap; + padding: 0.5px 12px; + width: fit-content; + border-radius: 0px; + font-weight: bold; + display: inline-block; + background: var(--rdtfeeddown_guilabel-bg, #3c3c3c); + color: var(--rdtfeeddown_guilabel-fg, #ffffff); + box-shadow: 0 1px 2px rgba(0,0,0,0.12); + font-size: 1em; +} + +a.rdtfeeddown_tab-link { + display: inline-block; + padding: 0.15em 0.7em; + border-radius: 0px; + background: #3c3c3c; + color: #e0e0e0; + font-family: inherit; + font-size: 1em; + font-weight: 600; + text-transform: uppercase; + text-decoration: none; + border: 1.5px solid #232323; + box-shadow: 0 2px 6px rgba(21,101,192,0.08); + transition: background 0.2s, color 0.2s, border-bottom 0.2s; +} +a.rdtfeeddown_tab-link:hover, a.rdtfeeddown_tab-link:focus { + background: #484848; + color: #ffffff; +} \ No newline at end of file diff --git a/docs/guis/about.md b/docs/guis/about.md index 17c3a093..f6d59750 100644 --- a/docs/guis/about.md +++ b/docs/guis/about.md @@ -5,47 +5,56 @@ The OMC team uses several GUIs to help running data acquisition and analysis cod - [The Beta-Beat GUI](betabeat/gui.md) to perform analysis of measurement files and compute corrections. - [The Kmod GUI](kmod/gui.md) to perform K-modulation, analyse data and export results. - [The Multiturn GUI](multiturn/gui.md) to perform beam excitation and data acquisition. +- [The Chroma GUI](chroma/gui.md) to determine chromaticity from RF scan analysis and compute corrections. Of these, only the Beta-Beat GUI is currently developed by the team. ## Running the GUIs The GUIs can be started from your development environment or via deployed `.jnlp` from the archives: + -=== "Beta-Beat" - - - Latest [Beta-Beating production version][prod_bbgui]{target=_blank}. - - Latest [Beta-Beating development version][dev_bbgui]{target=_blank}. - - Complete [list of releases][releases_bbgui]{target=_blank}. - === "Beta-Beat-OMC3" - Latest [Beta-Beating production version][prod_bbgui_omc3]{target=_blank}. - Latest [Beta-Beating development version][dev_bbgui_omc3]{target=_blank}. - Complete [list of releases][releases_bbgui_omc3]{target=_blank}. - + +=== "Beta-Beat (Legacy)" + + - Latest [Beta-Beating production version][prod_bbgui]{target=_blank}. + - Latest [Beta-Beating development version][dev_bbgui]{target=_blank}. + - Complete [list of releases][releases_bbgui]{target=_blank}. + === "Kmod" - The K-mod GUI is now a Python app published with `acc-py`, and can be run with: - + The K-modulations GUI is now a Python app published with `acc-py`, and can be run with: + ```bash /acc/local/share/python/acc-py/apps/acc-py-cli/pro/bin/acc-py app run pykmodlhc ``` - + === "Multiturn" - Latest [Multiturn production version][prod_mtgui]{target=_blank}. - Latest [Multiturn development version][dev_mtgui]{target=_blank}. - Complete [list of releases][releases_mtgui]{target=_blank}. +=== "Chroma" + + The Chroma GUI is a Python app published with `acc-py`, and can be run with: + + ```bash + /acc/local/share/python/acc-py/apps/acc-py-cli/pro/bin/acc-py app run chroma-gui + ``` !!! warning - Please note that these site are currently available only to devices connected to the CERN network ([workaround][connect_gpn]). + Please note these sites are currently available only to devices connected to the CERN network ([see: workaround][connect_gpn]). Open the `.jnlp` executable inside a browser, or [call it with `jws` from the command line][jws_calls]: !!! info "Compatibility Issues" - Since `javaws` (java web start) makes trouble due to intenal security mechanisms, a replacement named `jws` was developed and has to be used to run the `jlnp` file. + Since `javaws` (java web start) causes trouble due to internal security mechanisms, a replacement named `jws` was developed and has to be used to run the `jlnp` file. For further information see the [jws Confluence][jws_confluence]{target=_blank .cern_internal} page. ## Requirements @@ -66,7 +75,25 @@ The following are required to run the GUIs: You may encounter the following errors: -#### Problems with execution due to disabled Java +### Running in the CCC in 2025 + +On the CCC terminals, there are some issues related to finding the correct java path, +which affects `NXCals` extraction. +To avoid this, close all windows and CCMs and then run: + +```bash +/user/slops/data/LHC_DATA/OP_DATA/Betabeat/launch_ccm.sh +``` + +This script performs the following commands, which could also be done manually in a terminal: + +- Create a kerberos ticket: `kinit lhcop` +- Adapt the path/set `JAVA_HOME` to use the correct java: `export PATH=/bin:$PATH` and/or `export JAVA_HOME=/usr/java/jdk` (either should be fine) +- run `ccm` or `/mcr/bin/ccm` + +Then select `LHCOP` and launch the Beta-Beat GUI from the new CCM window. + +### Problems with execution due to disabled Java If you encounter a complaint about `Java` being too old, try using `/mcr/bin/jws`. @@ -81,16 +108,15 @@ If you encounter a complaint about `Java` being too old, try using `/mcr/bin/jws /mcr/bin/jws https://bewww.cern.ch/ap/deployments/applications/cern/lhc/lhc-app-beta-beating-omc3/PRO/BetaBeatingOMC3-Control-3t.jnlp ``` -#### Unspecific Error +### Unspecific Error !!! failure Any random error -If so, check that you can import `numpy` from the `omc-anaconda-python`. +If so, check that you can import `numpy` from the `OMC` production Python environment. If this leads to the previously raised error, then the permissions are broken. Either fix the permissions on `afs` or ask someone to do so for you. - *[TN]: Technical Network *[LSA]: LHC Software Architecture *[GPN]: General Purpose Network @@ -107,14 +133,14 @@ Either fix the permissions on `afs` or ask someone to do so for you. [dev_mtgui]: https://bewww.cern.ch/ap/deployments-dev/applications/cern/lhc/lhc-multiturn/PRO/lhc-multiturn-lhc-multiturn.jnlp [releases_mtgui]: https://bewww.cern.ch/ap/deployments/applications/cern/lhc/lhc-multiturn/ -[prod_kmodgui]: https://bewww.cern.ch/ap/deployments/applications/cern/lhc/lhc-app-kmod/PRO/lhc-app-kmod-lhc-app-kmod.jnlp -[dev_kmodgui]: https://bewww.cern.ch/ap/deployments-dev/applications/cern/lhc/lhc-app-kmod/PRO/lhc-app-kmod-lhc-app-kmod.jnlp +[prod_kmodgui]: https://bewww.cern.ch/ap/deployments/applications/cern/lhc/lhc-app-kmod/PRO/lhc-app-kmod-lhc-app-kmod.jnlp +[dev_kmodgui]: https://bewww.cern.ch/ap/deployments-dev/applications/cern/lhc/lhc-app-kmod/PRO/lhc-app-kmod-lhc-app-kmod.jnlp [releases_kmodgui]: https://bewww.cern.ch/ap/deployments/applications/cern/lhc/lhc-app-kmod/ [jws_confluence]: https://wikis.cern.ch/display/DVTLS/jws+-+a+replacement+for+javaws [jws]: https://wikis.cern.ch/display/DVTLS/jws+-+a+replacement+for+javaws -[mounting_resources]: ../howto/setup/shared_filesystems.md#mounting-tn-resources-on-gn-machines -[connect_gpn]: ../howto/teleworking/access.md#accessing-cern-internal-websites -[sshuttle_method]: ../howto/setup/guis.md#running-guis-locally +[mounting_resources]: ../resources/shared_filesystems.md#mounting-tn-resources-on-gpn-and-other-machines +[connect_gpn]: ../resources/remote_access.md#accessing-cern-internal-websites +[sshuttle_method]: usage/remote.md#running-guis-locally [jws_calls]: ../resources/links.md#jws-programs diff --git a/docs/guis/betabeat/ampdet.md b/docs/guis/betabeat/ampdet.md new file mode 100644 index 00000000..7f6d2ecd --- /dev/null +++ b/docs/guis/betabeat/ampdet.md @@ -0,0 +1 @@ +# Amplitude Detuning Analysis diff --git a/docs/guis/betabeat/analysis_panel.md b/docs/guis/betabeat/analysis_panel.md index 04921533..0d073564 100644 --- a/docs/guis/betabeat/analysis_panel.md +++ b/docs/guis/betabeat/analysis_panel.md @@ -1,20 +1,20 @@ # The Beta-Beat GUI Analysis Panel The analysis panel provides graphical interface to visualize results from harmonic analysis performed on measured data. -The results are given in the [`tfs`](https://mad.web.cern.ch/mad/madx.old/Introduction/tfs.html){target=_blank} format. +The results are given in the [`tfs`](https://pylhc.github.io/tfs/tfsformat.html){target=_blank} format. -In the analysis panel one can edit the `dp/p` value in the corresponding column, and see the changes applied. +In the analysis panel one can edit the `dp/p` value in the corresponding column, and see the changes applied. ## The Time / Space Tab In the `Time / Space` tab one can examine the phases and amplitudes, and can clean the values if needed (only `TUNEX` and `TUNEY` or `NATTUNEX` and `NATTUNEY`). If some values are obviously not inside a given bound, the 2 marker lines (see screenshot below) can be used to set the boundaries and to remove all data outside those boundaries. -The GUI will check if the removal is inside some predefined bounds to prevent accidental removal of too much data. +The GUI will check if the removal is inside some predefined bounds to prevent accidental removal of too much data. !!! todo Include a screenshot of the time / space panel with relevant info highlighted (see twiki) - + ### Cleaning of harmonic analysis output data The harmonic analysis data used to obtain the optics functions can be cleaned using [Isolation Forest algorithm][sklearn_IF]. @@ -23,22 +23,23 @@ It should prevent the appearance of unphysical spikes in the optics functions wh Isolation Forest perfroms anomaly detection on the whole set of selected measurements data. Clicking on "Detect and remove bad BPMs"-button triggers an external python script which analyses the selected files. The output file is written in the TFS format and contains the list of detected bad BPMs is written to the folder of the first selected measurement in the analysis table. - + The output can be found in: `Measurements/.../bad_bpms_iforest_{x,y}`. -During IF-cleaning, the lines corresponding to detected faulty BPMs will be removed from the lin-files. +During IF-cleaning, the lines corresponding to detected faulty BPMs will be removed from the lin-files. Cleaning can be reverted (the original lin files will be restored) by clicking Revert. After cleaning is finished, the optics function can be computed from the harmonic analysis data by clicking Get optics.
- + Cleaning before optics analysis
Cleaning before optics analysis
-### Additional cleaning based on the tune ## +### Additional cleaning based on the tune + Additionally, BPMs can be cleaned based on the tune values computed by harmonic analysis. The chart displaying the selected columns of harmonic analysis data has interactive cursors. These cursors can be moved manually to set the thresholds for tune-based cleaning - all BPMs having tune values outside of the set range will be removed. The cursors can be also automatically set to e.g. 4 sigmas deviation from the average tune values over all BPMs. ### Summary of cleaning steps before optics analysis @@ -54,8 +55,13 @@ The `Frequency` tab displays the computed frequencies for every BPM. A `Get Optics` button can be used to start the optics calculation. This will call an external python script again, with the results available in the [Optics Panel](optics_panel.md). +### Nattune Updater + +- You can set a frequency range and it does not redo the analysis but just picks the highest peak in that range and assigns it to `NATTUNE` in the lin-file. +- This should be very helpful for amplitude detuning analysis. +- Do NOT use the Nattune-Updater if you have free kicks (it adds a `NATTUNE`-Column to the lin-file). + !!! todo Include a screenshot of the frequency panel. - - + [sklearn_IF]: https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.IsolationForest.html diff --git a/docs/guis/betabeat/beam_selection.md b/docs/guis/betabeat/beam_selection.md index db5e04a8..128c8560 100644 --- a/docs/guis/betabeat/beam_selection.md +++ b/docs/guis/betabeat/beam_selection.md @@ -1,43 +1,151 @@ -# The beam selection Window +# The Beam Selection Window -!!! todo - Include screenshot of Beam-Selection Window and describe the settings. +
+
+ The beam selection window +
The Beam Selection Window.
+
+
+The Beam Selection Window is your entry point to the GUI. +Here, you set which machine you will be using and which `python` backend to run. +The options chosen here will also define the **folder-structure** you will be using during your current analysis session. !!! tip "Setting Your Defaults" - The GUI defaults to specific locations for which `Beta-Beat.src` directory to use, the input path of you data, etc. - Different key-value pairs can be set inside for the desired defaults, for example: - - ```bash - beam = LHCB1_RUNII_2018 - inputPath = /some/afs/location/with/your/data/ - outputPath = /some/afs/location/with/your/results/ - betaBeatPath = /some/afs/location/with/your/Beta-Beat.src/ - loadData=True - ``` - These values can be set by a file named `bbgui_user.properties` (with the above syntax) in either the current working directory, from where you run the GUI, or in your home folder. - The latter is only used if there is no such file in the current working directory. + You can set all entries in this window to your preferred defaults for a quick start! + Check the [Defaults Page](defaults.md) for more details. - If you want to use a specific file located anywhere, you can also give the path to this file as the first and only argument when starting the GUI. - It is also possible to set each of these default values by passing them as flag arguments to the GUI call, e.g: - - ``` - --beam LHCB1_RUNII_2018 --inputPath /some/afs/location/with/your/data/ +## Beam + +In this field you can choose from the implemented Beams of the LHC or machines in general. +Use the `generic` accelerator, if your machine does not have its own accelerator class. + +The beam you choose not only determines some of the **default settings**, which can be overwritten by user [defaults](defaults.md) +or changed later on, but also the **folder-structure** of the GUI, which cannot be changed without restarting the GUI. + +## Output + +In this field you can set the output folder for the GUI. +Depending on your choice of `Beam` a default is already preselected for you. + +!!! warning "Write Access" + The GUI needs to be able to write to the selected folder. + If you do not have write access to the folder, you will get a warning and cannot continue to start the GUI. + +#### Special Entries + +- _LHC-Betabeat_: `/user/slops/data/LHC_DATA/OP_DATA/Betabeat/` +- _Other_: Lets you choose your own path, starting from your default (usually `home`) folder for file dialogs. +- _Other (Last Selected)_: Lets you choose your own path, starting from the last selected folder in this dropdown. +- _Other (Accel)_: Lets you choose your own path, starting from default of the selected beam/accelerator. + +#### Folder Structure + +Within your selected output folder, a new folder for the current date will be created. +Withing that folder, a folder for the selected beam/accelerator will be created. +Within that folder in turn, folders for `Measurements`, `Results` and `Models` will be created. +If any of these folders already exist, they will be used, e.g.: + +```text +LHC-Betabeat +└── YYYY-MM-DD + ├── LHCB1 + │ ├── Measurements + │ ├── Results + │ └── Models + └── LHCB2 + ├── Measurements + ├── Results + └── Models +``` + +!!! info "Continue Analysis" + If this structure has already been created, you can also choose the Date-folder directly and continue your analysis. + No new date-subfolder will be created in that case. + The selected folder does not even need to be of date-format, as long as the substructre for the selected beam/accelerator exists.

+ This is useful, if you want to continue a previously started analysis on a different date, e.g. if the GUI crashes after midnight.
+ **:fontawesome-solid-triangle-exclamation:{.warning-colored} To later be able to find data belonging together easily, you should always use the same date folder per CCC measurement session!** + +### Load Data + +If this tickbox is activated and you select a folder, which contains either already the current date or the substructure for the selected beam/accelerator, +the GUI will load the analysis and results data from that folder. +Turn-by-Turn data is skipped to avoid memory issues. + +This feature is very useful, when continuing a previously started analysis, +yet deactivated by default as reloading the data can **take a lot of time and memory**. + +### Old Structure + +!!! warning "Deprecated" + The old structure had been used with the old Betabeat GUI until 2020 and is now deprecated. + There is no real reason to ever use it today, in particular with the `omc3` backend, + as the GUI does not even import the old `BetaBeat.src` data automatically in that case. + +If this tickbox is activated, the GUI will use the old folder structure, i.e. the `Models` folder will be as `models` at the top level, +containing in turn again beam/accelerator folders which then contain the models. + +```text +LHC-Betabeat +└── YYYY-MM-DD + ├── LHCB1 + │ ├── Measurements + │ └── Results + ├── LHCB2 + │ ├── Measurements + │ └── Results + └── models + ├── LHCB1 + │ ├── b1_inj + │ └── b1_30cm + └── LHCB2 + ├── b2_inj + └── b2_30cm +``` + +## Input + +This field lets you choose the default input folder for the GUI, +meaning that file dialogs will usually start from that folder. + +!!! warning "Read Access" + The GUI needs to be able to read from the selected folder. + If you do not have read access to the folder, you will get a warning and cannot continue to start the GUI. + +Special Entries: + +- _LHC-Fill Latest_: `/user/slops/data/LHC_DATA/OP_DATA/Fill_DATA/FILL_DIR/BPM/`, where `FILL_DIR` is a symlink pointing to the latest fill directory. +- _LHC-Fill_: `/user/slops/data/LHC_DATA/OP_DATA/Fill_DATA/` +- _(Same as Output)_: Uses the same path as selected in the `Output` field. +- _Other_: Lets you choose your own path, starting from your default (usually `home`) folder for file dialogs. +- _Other (Last Selected)_: Lets you choose your own path, starting from the last selected folder in this dropdown. +- _Other (Accel)_: Lets you choose your own path, starting from default of the selected beam/acceelerator. + +## Python Executable + +In this field you can choose the `python` binary you want to use for the GUI. +By default this is our production `python3` binary on `lintrack` (`/afs/cern.ch/eng/sl/lintrack/omc_python3/bin/python`), +but you can also choose other versions from `lintrack` (all in `/afs/cern.ch/eng/sl/lintrack/omc_acc_py/envs/` are automatically picked up) +or choose your own environment (e.g. `.venv/bin/python`). + +!!! note "Settings" + You can change this environment at any time later on the the [Settings](settings.md). + +!!! warning "omc3 installation" + The environment needs to have `omc3` installed as a package, + i.e. be able to call `python -m omc3.module arg1 arg2 ...`.
+ + This can be done by running + + ```bash + python -m pip install omc3 ``` + or -??? tip "Additional Default Settings" - Additionally, there are some settings that can only be set via arguments. - Their keys and default values are: - ```bash - oldFolderStructure=True - consoleLogging=False - checkFreeSpace=False + python -m pip install git+https://github.com/pylhc/omc3.git ``` - - `oldFolderStructure` refers to the folder structure, where the `models` folder is at top level and contains the machines as subdirectories. - Setting this value to `False` assumes (and creates) the models in a `Models` folder on the same level as `Measurements` and `Results`, i.e. within the machine-folders. - - `consoleLogging` activates additional logging into the terminal. - The effect is only visible if the GUI was started from the console. - - `checkFreeSpace` activates a quick check of the available space upon start of the GUI. - The result of this check is logged in the console, and hence also only visible if the GUI is started via terminal command. \ No newline at end of file + See [omc3 on github][omc3_github]{target=_blank}. + +[omc3_github]: https://github.com/pylhc/omc3 diff --git a/docs/guis/betabeat/betabeatsource.md b/docs/guis/betabeat/betabeatsource.md new file mode 100644 index 00000000..47a307b2 --- /dev/null +++ b/docs/guis/betabeat/betabeatsource.md @@ -0,0 +1,65 @@ +# BetaBeat.src + +Since 2025, the former `omc3` branch has been moved to the `master` branch of the GUI and is now the default for all new users. +The "BetaBeat.src" branch of the GUI has been retired from `master` to the `BetaBeatSrc` branch +and is no longer under active development. + +Legacy version are still available on [CAS][bbs_cas]{target=_blank .cern_internal}. + +## Meaning of the Output Files + +The naming of output files in Beta-Beat.src analysis can be very unintuitive. +Namely, one will see similar output files for a quantity which go as `get_*.out`, `get_*_free.out` and `get_*_free2.out`, where `*` is the calculated quantity (betas, phase, etc.). +These each correspond to a variation of the calculated quantity, explained below. + +When doing our measurements, we use AC-Dipole driven excitations of the beam for a better signal-to-noise ratio in data acquisition. +However, as the AC-Dipole has an effect on the beam optics functions the reconstructed optics from these measurements are the driven optics, not those of the accelerator itself. +One can compensate for this deviation in different ways, which is why there are several output files for each optics quantity computed. + +!!! example "Meaning of Different Output Files" + | Nomenclature | Meaning | + | :---------------- | :------------------------------------------------------------------------------------------------------------- | + | `get_*.out` | The optics functions **without** compensation, from the driven excitation data. | + | `get_*_free.out` | The optics functions compensated **analytically** using an equation[^MiyamotoMeasurementCouplingRDTsACDipole]. | + | `get_*_free2.out` | The optics functions compensated **the other way**, see bellow. | + + In the case of the `get_*_free2.out` files, the compensation is done differently depending on the computed quantity. + For some quantities (for instance for $\beta$ from phase) this uses the model values, for others (for instance the coupling RDTs $f_{1001}$ and $f_{1010}$) it is a rescaling in which the model values are used *indirectly*. + +The method used to output the `get_*_free2.out` files is sometimes more robust as it does not rely on the existence of certain BPMs in the output (which could be missing after cleaning), and in some edge cases is more accurate[^HoydalsvikSubPerMilCouplingLHC]. + +!!! tip "Do Compare Outputs" + For debugging purposes, if the final result looks unbelievable, it might be of advantage to check the uncompensated output to rule out (or confirm) a failure in the recalibration method. + +[^HoydalsvikSubPerMilCouplingLHC]: + ??? abstract "Reaching the Sub Per Mil Level Coupling Corrections in the LHC", `E. Høydalsvik and T. Persson`, [IPAC 2021](https://accelconf.web.cern.ch/ipac2021/papers/thpab001.pdf){target=_blank}" + ``` + @inproceedings{IPAC:Hoydalsvik:SubPerMilCouplingLHC, + title = {Reaching the {{Sub Per Mil Level Coupling Corrections}} in the {{LHC}}}, + author = {Høydalsvik, Eirik and Persson, Tobias}, + booktitle = {Proceedings of the 12th {{International Particle Accelerator Conference}}}, + publisher = {{JACoW Publishing, Geneva, Switzerland}}, + volume = {IPAC2021}, + doi = {10.18429/JACOW-IPAC2021-THPAB001}, + isbn = {978-3-95450-214-1}, + url = {https://accelconf.web.cern.ch/ipac2021/papers/thpab001.pdf}, + date = 2021, + langid = {english} + } + ``` +[^MiyamotoMeasurementCouplingRDTsACDipole]: + ??? abstract "Measurement of Coupling Resonance Driving Terms with the AC Dipole", `R. Miyamoto`, [BNL--94350-2010-IR, 1013520](https://www.bnl.gov/isd/documents/74582.pdf){target=_blank}" + ``` + @report{MiyamotoMeasurementCouplingRDTsACDipole, + title = {Measurement of {{Coupling Resonance Driving Terms}} with the {{AC Dipole}}}, + author = {Miyamoto, R.}, + year = 2010, + month = 10, + number = {BNL--94350-2010-IR, 1013520}, + doi = {10.2172/1013520}, + url = {https://www.bnl.gov/isd/documents/74582.pdf}, + langid = {english} + } + ``` + +[bbs_cas]: https://cas.cern.ch/project?groupId=cern.lhc&artifactId=lhc-app-beta-beating diff --git a/docs/guis/betabeat/bpm_panel.md b/docs/guis/betabeat/bpm_panel.md index d124628e..605088c1 100644 --- a/docs/guis/betabeat/bpm_panel.md +++ b/docs/guis/betabeat/bpm_panel.md @@ -1,90 +1,236 @@ -# The Beta-Beat GUI BPM Panel +# The BPM Panel -The BPM panel provides a graphical interface to query and visualize information for the BPM data files. -It can load data files for all supported beams, mostly binary SDDS files or files in the SDDS ASCII format. +
+
+ The BPM Panel +
The BPM Panel.
+
+
+ +The BPM panel provides a graphical interface to query and visualize information for the BPM data files, i.e. the Turn-by-Turn data +and select the data to be analyzed further. + +## Loading Data + +### Measurement Groups aka Kick Groups -!!! todo - Include a screenshot, possibly of settings when opening files? +!!! warning "Not yet implemented" + The GUI does [not yet support loading of measurement groups][issue282]{target=_blank .cern_login} (i.e. kick groups). + The idea is to load all data from a single [kick-group, as defined in the Multiturn GUI](../multiturn/excitation.html#kick-groups) at once + or monitor a currently active kick-group and load the files as they are created. -## Opening Files and Applying SVD Cleaning +### Open Files + +Use the ++"Open Files"++{.green-gui-button} button to open turn-by-turn data. + +
+
+ Open Files Dialog +
The Open Files Dialog.
+
+
-### Automatic BPM removal +!!! warning "Model Required" + To be able to load files, you need to first need to have a [model loaded](model_creation.md#model-selection-window). + The name of the model will appear at the top of the GUI. + This is required, as the BPMs are checked vs the model and sorted by longitudinal location. -First, BPMs are removed based on the following criteria: +!!! tip "Naming Filter" + For the LHC, the displayed files in the file-dialog are automatically filtered to show only `@BunchTurn` files of the currently selected beam. + You can change/deactivate that filter ("Files of Type") at the bottom of the dialog! -- known bad BPMs (list is provided in `Beta-Beat.src/harmonic_analysis/clean.py` and can be extended in `Bad BPMs` field) -- BPMs which are not found in the model are discarded -- Flat BPMs (difference between min/max is smaller than `Pk-2-pk cut`) -- Spiky BPMs (value higher than `Max peak cut` found in at least one turn) -- An exact 0 is detected in at least one turn +Multiple files can be opened at once and are added to the current `Measurements` directory, as well as to the table of loaded files in the panel. +If the file contained multiple bunches, they are added as separate entries (see [below](#table-of-loaded-files)). -### SVD-cleaning +If the ["Analyse TbT files on opening" setting](settings.md#gui-tab) is active, a window will open to prompt the user with the ["Do analysis Dialog"][do_analysis_dialog]. -Secondly, SVD cleaning is performed. -SVD modes with localized spikes in their spatial vectors indicate faulty BPMs using `Sum square` setting to find such spikes. -To globally reduce the noise on all BPM readings, only a predefined number of strongest singular modes (`Sing val cut`) remain in the turn-by-turn data. -While the `Sum square` setting has a direct influence on the number of BPMs identified as faulty, the number of modes affects the overall noise level in turn-by-turn signal. -The original application of SVD on BPMs data cleaning can be found [in this publication][svd_clean_rhic]. +!!! tip "Reopening Files" + - If you are opening a file with the same filename as an already opened file, an error will be thrown. + - If you want to open a new file with the same name as a previously opened file, i.e. one with the same name in the `Measurements` directory, + a popup will ask if the old file should be overwritten or simply opened instead (without running the converter). + - If you restart the GUI and select the ["Load Data" option in the beam selection window](beam_selection.md#load-data), + all files in the `Measurements` directory in the selected _Output Path_ will be reloaded (without running the converter). -If SVD is enabled in the settings, the external SVD cleaning python script will be called for the current file during the loading process. -when SVD cleaning detects and removes bad BPMs, they will be marked in the BPM names list. +#### Supported File Formats + +The GUI itself only supports the opening of LHC-type (dual plane BPMs) or SPS-type (single plane BPMs) binary `.sdds` files. +You can choose in the [gui tab of the settings](settings.md#gui-tab) which format your turn-by-turn data is and if you want +to convert it into one of the supported formats. +The GUI will then call the [`omc3.tbt_converter`][tbt_converter]{target=_blank} to convert the file. +All formats that can be read by the [`turn-by-turn` package][tbt_package]{target=_blank} are supported. +If you choose the **"DO NOT CONVERT"** option, the files are simply copied into the current `Measurements` directory. + +!!! tip "ASCII files" + The old ASCII format (for SPS and LHC), which is still in use in some older conversion scripts and MAD-X tracking scripts, + is identified automatically by the converter when choosing `lhc` or `sps` as the file type to be opened. + One can use **the same format** for the conversion, i.e. `lhc` or `sps` respectively, and the converter will output the data in binary format. + The `ascii` input format can also be chosen directly. + +## Table of Loaded Files -All the settings mentioned above can be changed in the global settings panel:
-
- -
Settings panel, where cleaning thresholds can be changed.
-
+
+ Table of loaded files +
The Table of loaded files in the BPM Panel.
+
-Turn-by-turn data cleaning is summarized in the output file which can be found at: -`Measurements/Beam1@...1-6600/Beam1@...sdds.bad_bpms_{x,y}.` +The table at the top of the panel shows the files that are currently opened in the GUI. +These are not necessarily all files present in the `Measurement` directory, as they need to be explicitly opened! +Each column in the table provides information regarding the opened measurement: + +- **File**: +Name of the file, without the path. +- **Bunch ID**: +The ID of the bunch within the file. +If the file contains multiple bunches, multiple entries with the same _File_ name, but different _Bunch IDs_ will be created. +- **Analysis Done**: +Indicator stating whether the analysis has been performed on this file. +_(:fontawesome-solid-triangle-exclamation:{.warning-colored} [Currently not working.][issue285]{target=_blank .cern_login})_ +- **Kick Group**: +Name of the [Kick Group](#measurement-groups-aka-kick-groups) this file belongs to. +_(:fontawesome-solid-triangle-exclamation:{.warning-colored} [Currently not working.][issue282]{target=_blank .cern_login})_ +- **No. of bad BPMs**: +Number of [bad BPMs][bpm_filtering] identified in this file as a sum between the two planes. +This value is `0` upon loading the file and will be updated when the harmonic analysis is done, which also performs the BPM filtering if [cleaning](settings.md#cleaning-tab) is active. +Bad BPMs will be [marked in red in the BPM lists below](#bad-bpms).
+_(:fontawesome-solid-triangle-exclamation:{.warning-colored} The default value for the case of something going wrong when updating this value is `-1` per plane +and hence sometimes `-2` is shown in this column, e.g. when the bad-BPM output file is missing.)_ + +!!! warning "Memory Usage" + File that are opened in this panel are stored in memory. + If your computer is running low on memory, you might want to close some of the open files. + +### Removing Entries + +Clicking on the ++"Remove"++{.red-gui-button} button will remove the selected entries from the table of loaded files.
+:fontawesome-solid-triangle-exclamation:{.warning-colored} This will **not** remove the files from the `Measurements` directory! + +## Investigating Turn-by-Turn Data + +After selecting one or more files in the table of loaded files, the turn-by-turn data is visualized in the two bottom charts, one for each plane. +The charts are [interactive](common_components.md#plotting) and can display either the measured amplitude values over turns for every BPM from the list or display the phase space, which is calculated by two consecutive BPMs. +You can select multiple measurements at once to compare them, but only one BPM per plane at a time. + +=== "Turn-by-Turn view" + +
+
+ Turn-by-Turn view of BPM data +
Turn-by-Turn view of BPM data with two measurements selected.
+
+
+ +=== "Phase space view" + +
+
+ Phase space view of BPM data +
Phase space view of BPM data.
+
+
+ +### Bad BPMs + +After [harmonic-analysis](#start-analysis) has been performed, the [bad BPMs][bpm_filtering] will be marked in red in the lists. +Hovering the BPM name will show a tooltip with the reason the BPM was deemed bad. + +### Averages, Removal of Turns and Splitting Files + +!!! warning "Broken Functionality" + These features [are currently broken][issue283] and we are considering whether they are actually needed. + +The buttons on the top left side of the pane provide some features to handle the BPM data. + +- ++"Create Average"++ allows loading several data files too visualize their average repesentations on the same graph, which helps detecting differences or reducing noise. +- ++"Remove Turns"++ can be used to cut turns from the start or the end, to focus on a specified range of the data. +- ++"Split Files"++ splits the current BPM data file into N files, where N is specified in the dialog and the resulting files will have old-turns/N turns. + +## Start Analysis + +The ++"Analyse Spectra"++{.green-gui-button} button spawns [the configuration dialog](#do-analysis-dialog) for the analysis. +This will call an external program to perform a frequency analysis of the BPM data [**of the selected files**](#table-of-loaded-files), in order to compute tunes and similar beam properties and (optionally) to get the optics functions from that spectrum. +The **"Run optics as well"** checkbox will define whether the [_"Optics Analysis"_ in the _"Do analysis Dialog"_](#do-analysis-dialog) is automatically pre-checked. + +### Do-Analysis Dialog + +=== "Closed Settings" + +
+
+ The Do-Analysis Dialog +
The Do-Analysis Dialog.
+
+
-It contains BPM names and corresponding threshold which identified a BPM as faulty. +=== "Open Settings" -!!! note - A single BPM can appear twice (for each threshold separately), e.g. in the case of exact zero flat signal. +
+
+ The Do-Analysis Dialog with open settings +
The Do-Analysis Dialog with open settings.
+
+
-The content of the loaded files will be displayed in two charts: +This dialog allows you to specify the settings and output for the analysis run +on the currently selected files in the BPM-Panel. +Click the ++"Run"++ button to start the analysis. -- Horizontal BPMs, -- Vertical BPMs. +!!! warning "Parallelization" + Parallelization of the analysis is only implemented on the GUI side, + possibly starting multiple python processes. + Check the caveats of the _"Run Per-File Tasks in Parallel"_ + setting in the _[GUI-Settings Tab](settings.md#gui-tab)_. +### Harmonic Analysis -!!! todo - Include a screenshot with two BPM panels. +Keeping the _Optics Analysis_ checkbox unchecked will only perform the [harmonic analysis][harpy_analysis]. -The charts are interactive and can be used to zoom in/out, or focus on a given rectangle of the shown data. +In this case, you will **not be able to specify an output name** for the results, as the resulting files will be **automatically** put into subfolders of the `Measurements` folder, based on the name of the `.sdds` files. +They therefore usually appear within the same folder as the turn-by-turn data. -The charts can display either the measured amplitude values over turns for every BPM from the list or display the phase space, which is calculated by two consecutive BPMs. +The analysis results are automatically loaded into the [Analysis Panel](analysis_panel.md). +### Optics -!!! todo - Include a screenshot of the bad bpms panel. +In case the _Optics Analysis_ checkbox is checked, also the optics are calculated. +You have the choice to combine the analysis of all files into a single optics, using the individual measurements for statistics, in which case you need to **specify a descriptive output name** for the analysis, the prefix of which will already be provided. +If you don't check the _Combine Analysis_ checkbox, the results are stored in a subfolder of the `Results` folder, based on the name of the `.sdds` files. -## Removing Turns and Computing an Average +The analysis results are loaded automatically into the [Optics Panel](optics_panel.md). +If you want to take a look at the spectrum, it needs to be loaded **manually** +into the [Analysis Panel](analysis_panel.md) from the `Results//lin_files` +subfolder. -The buttons on the top left side of the pane provide useful features to handle the BPM data. +!!! warning "Loading the `lin_files` subfolder" + If the analysis files are loaded via [++"Open Files"++{.green-gui-button} in the Analysis Panel](analysis_panel.md) from the `lin_files` subfolder, + this folder is **copied** into the `Measurements` folder, keeping the `lin_files` name. + If you want to open another set of analyzed files from an `lin_files` folder, the GUI will **complain that the folder already exists**. + To avoid this, use the ++"Attach Files"++{.yellow-gui-button} button instead. -- `Remove Turns` can be used to cut turns from the start or the end, to focus on a specified range of the data. +### Settings and Suffixes -!!! todo - Include a screenshot of before-after comparison for `Remove Turns`. +By expanding the _Settings_ section at the bottom of the dialog +you can optionally change the [settings](settings.md) for the harmonic analysis in the _[Tunes](settings.md#tunes-tab)_, _[Harpy](settings.md#harpy-tab)_, _[Cleaning](settings.md#cleaning-tab)_ and _[Accelerator](settings.md#accelerator-tab)_ tabs, as well as for the optics analysis in the _[Optics](settings.md#optics-tab)_ tab if the _Optics Analysis_ checkbox is checked. -- `Create Average` allows loading several data files too visualize their average repesentations on the same graph, which helps detecting differences or reducing noise. +The _Suffix_-field will be automatically set from your suffix-choices in the [_Harpy_ settings tab](settings.md#harpy-tab) and is only applied to the harmonic analysis output files (i.e. `.lin[xy]`, `.amps[xy]`, `.freqs[xy]`), **not to the folder names**. -!!! todo - Include a screenshot of `Create Average` effect. +!!! warning "Changing the Settings" + This will **change the global settings** for all subsequent analysis runs, + not just for the current one! + You need to click the ++"Apply"++ button to actually apply these settings before the run. -- `Do Analysis` spawns the configuration dialogue for the external analysis. - This will call an external program to perform harmonic analysis of the BPM data, in order to compute tunes and similar beam properties. - The results from the analysis can be seen in the [Analysis Panel](analysis_panel.md). - -!!! todo - Include of screenshot of `Do Analysis` dialogue window. +[tbt_converter]: https://github.com/pylhc/omc3/blob/master/omc3/tbt_converter.py +[tbt_package]: https://github.com/pylhc/turn_by_turn +[issue282]: https://gitlab.cern.ch/acc-co/lhc/lhc-app-beta-beating/-/issues/282 +[issue283]: https://gitlab.cern.ch/acc-co/lhc/lhc-app-beta-beating/-/issues/283 +[issue285]: https://gitlab.cern.ch/acc-co/lhc/lhc-app-beta-beating/-/issues/285 +[bpm_filtering]: ../../measurements/physics/bpm_filtering.md +[do_analysis_dialog]: analysis_panel.md#do-analysis-dialog +[harpy_analysis]: ../../measurements/physics/harpy.md -!!! note - The `Create Average` option requires synchronized data from withing the same bounds, otherwise the results will be meaningless. - The figure below shows three runs from LHC beam one with synchronized peaks for every turn and their corresponding averages. - - [svd_clean_rhic]: https://journals.aps.org/prab/abstract/10.1103/PhysRevSTAB.7.042801 +*[LHC]: Large Hadron Collider +*[SPS]: Super Proton Synchrotron +*[PS]: Proton Synchrotron +*[PSB]: Proton Synchrotron Booster +*[BPM]: Beam Position Monitor diff --git a/docs/guis/betabeat/common_components.md b/docs/guis/betabeat/common_components.md new file mode 100644 index 00000000..ab924eab --- /dev/null +++ b/docs/guis/betabeat/common_components.md @@ -0,0 +1,164 @@ +# Common Components + +Independent of which tab is selected, some general components of the UI are common or even always present. + +!!! note "Changing the Layout" + The layout of the GUI can be changed temporarily by dragging the splitters, which show the "^v" symbols. + It is also possible to completely hide the lower [Console](#console) and [Tasks](#running-tasks) tabs by clicking the "V" symbol in the lower right corner. + These changes are not saved and will be lost when the GUI is closed. + +## Plotting + +All plots are running with the same back-end classes, which allows additional control via mouse and keyboard. + +
+
+ Beta-Beating Plot with BPM hover info. +
Hover info on a Beta-Beating Plot.
+
+
+ +- **Zoom**: Zooming can be achieved by drawing a rectangle with the left mouse button or with the shortcuts listed below. +- **Hover Info**: The plots support the "hover" feature, which allows you to inspect additional details about the plotted points by hovering your mouse cursor over them. + +### Shortcuts + +- ++lbutton++ : Draw and zoom into rectangle. +- ++mbutton++ : Auto-zoom (in 3 Steps: 4σ, 3σ, 2σ). +- ++rbutton++ : Undo last step. +- ++shift+rbutton++ : Undo all steps (reset plot). +- ++mousewheel++ : Zoom relative to mouse position. +- ++shift+mousewheel++ : Zoom y-axis relative to mouse position. +- ++alt+mousewheel++ : Zoom relative to plot center. +- ++shift+alt+mousewheel++ : Zoom y-axis relative to plot center. + +## Top of the GUI + +
+
+ The top of the GUI. +
The top of the GUI.
+
+
+ +At the top left you can find **buttons** to start + +- The [model management](model_creation.md). +- A [settings window](settings.md). +- The [logging window](#logging). + +The next part shows you which **version** of the [omc3][omc3] and [pylhc][pylhc] packages are installed in your +currently selected `python` environment and which ones are recommended by the current version of the GUI. +If you are using an older version than recommended, a lot of the functionality might still work, but some +features might be missing or not work with the arguments the GUI provides. + +The colored button and dropdown menu that follows is the **RBAC** (Role Based Access Control) menu, +which shows you the current status of, and allows you to aquire, an access token, +e.g. for the [creation of knobs](correction_panel.md#knob-creation). + +Next, in the middle of the screen, the **currently selected model** is shown. +This is the model that is usually passed on to the [python tasks](#running-tasks) +and it can be changed in the [model selection](model_creation.md). + +Finally, on the right side we have the **current time** in local time and UTC, +as well as the beam/machine that was selected in the [beam selection window](beam_selection.md) +and which defines the current [folder structure](beam_selection.md#folder-structure). + +## Logging + +There are multiple places to check for logs in the GUI. + +### Console + +
+
+ Logging Console. +
Logging console.
+
+
+ +At the bottom of the GUI you can find the **Console** tab, +which shows the most recent status entries. +These are the logging information that come from the GUI itself and are very basic in nature. +The most recent of these messages is also printed below, in the status bar. + +### Log Viewer + +
+
+ Log Viewer. +
Log viewer.
+
+
+ +The **Log Viewer** can be opened via the third button on the top left and shows the captured output of +the [tasks](#running-tasks) started from the GUI. +This information is much more detailed than the [console](#console), and should be consulted whenever +an error is reported. + +By default the `python` logging is initialized at the `INFO` level. +To enable a more detailed output, you can change the logging level to `DEBUG` for all tasks in the [settings window](settings.md#gui-tab). + +### Terminal + +If the GUI was started from the terminal and the [`consoleLogging` option](defaults.md#additional-gui-defaults) is set to `True` +additional logging information will be printed to the terminal. + +## Running Tasks + +
+
+ Running tasks. +
Running Tasks.
+
+
+ +A "task" in the context of this GUI means the running of an external program in a separate process. +Sometimes even multiple processes might be started consecutively in the same taks, if they are dependent on each other. +As the GUI is a front-end for our `python` library, the external processes are usually calls to `python` modules, +constructed from the currently selected files and [settings](settings.md). +The exact call can often be found in the [terminal](#terminal) or in the `command.run` files often created by th GUI in the selected output folder, +as well as at the top of the `.ini` files created by `python`. + +When a task is started from the GUI, it is shown in the **Running tasks** tab found at the bottom of the GUI next to the console, +with a small animation to indicate that it is running. + +As long as any task is running, there will also be a small animation on the right of the status bar at the very bottom. + +!!! warning "Cancellation of Tasks" + Despite there being "Cancel" :fontawesome-regular-circle-stop:{.cernred} sign next to the running tasks, + the tasks cannot really be aborted and either nothing will happen or the task entry will vanish, + but the actual task will keep running in the background. + This needs to be implemented in the future. + +## File Opening Dialogs + +To make navigating between different folders easier, especially considering the deeply nested paths of `afs` and `nfs`, +some shortcuts have been implemented into the file opening dialogs, which become available for all relevant dialogs **after [the beam selection window](beam_selection.md)**. +They can be found at the top right of the dialog, and hovering them will show their functionality: + +
+
+ Special links in the file opening dialogs. +
Special links in the file opening dialogs.
+
+
+ +- **First Path** (:fontawesome-solid-check::fontawesome-solid-x:): +Return to the initial path you were in when the window opened. +- **Input Path** (:fontawesome-solid-circle-info:): +Go to the path set as [_Input Path_ in the beam selection window](beam_selection.md#input). +- **Output Path** (:fontawesome-solid-eye:): +Go to the path set as [_Output Path_ in the beam selection window](beam_selection.md#output). +- **Root Path** (**<>**) +Go to the root-path for the current GUI instance, i.e. the path in which the accelerator-folder (e.g. `LHCB1`) is located. +This is usually the date-directory within the output folder, unless you have choosen that folder as the _Output Path_, +in which case it will be the same as the _Output Path_ (see the [Continue Analysis Admonition in the Beam Selection Window](beam_selection.md#folder-structure)). +- **Fill Dir** (:fontawesome-solid-arrow-right:) _(Only available for the LHC and only if the folder is mounted)_: +Go to the fill-directory of [the choosen accelerator](beam_selection.md#beam). +- **Accelerator Dir** (:fontawesome-solid-star:) _(Only available for LHC, SPS, PS and PSB, and only if the folder is mounted)_: +Go to the default OMC analyis directory of [the choosen accelerator](beam_selection.md#beam), +which is usually the same as [the _Output Dir_, if the default is used in the beam selection window](beam_selection.md#output). + +[omc3]: https://github.com/omc3 +[pylhc]: https://github.com/PyLHC \ No newline at end of file diff --git a/docs/guis/betabeat/correction_panel.md b/docs/guis/betabeat/correction_panel.md index b24ce54d..88e73c9f 100644 --- a/docs/guis/betabeat/correction_panel.md +++ b/docs/guis/betabeat/correction_panel.md @@ -30,4 +30,4 @@ By selecting one, the user can examine or visualize the values attributed to eac Include a screenshot of the Knob Panel view knobs table !!! todo - Include a screenshot of the Knob Panel view knobs chart \ No newline at end of file + Include a screenshot of the Knob Panel view knobs chart diff --git a/docs/guis/betabeat/defaults.md b/docs/guis/betabeat/defaults.md new file mode 100644 index 00000000..e1d344ce --- /dev/null +++ b/docs/guis/betabeat/defaults.md @@ -0,0 +1,63 @@ +# Defaults + +Defaults can be set by a file named `bbgui_user.properties` (with the above syntax) in either the **current working directory** (from where you run the GUI), or in **your home folder**. +The latter is only used if there is no such file in the current working directory. + +If you want to use a specific file named anything and located anywhere, you can also **give the path to this file as the first and only argument** when starting the GUI. +It is also possible to set each of these default values by passing them as flag arguments to the GUI call, e.g: + +```bash +--beam LHCB1 --inputPath /some/afs/location/with/your/data/ +``` + +## Beam Selection Defaults + +The GUI defaults to specific locations for which `python` binary to use, the input path of you data, etc. +Different key-value pairs can be set inside for the desired defaults, for example: + +```ini +# Beam Selection +beam = LHCB2 +inputPath = /some/afs/location/with/your/data/ +outputPath = /some/afs/location/with/your/results/ +pythonPath = /some/afs/location/with/your/python-env/bin/python +loadData=False # Load already existing data in the outputPath into the GUI +oldFolderStructure=False # Put `models` folder at top level (BBS legacy) +``` + +For details see the [Beam Selection](beam_selection.md) page. + +## Additional GUI Defaults + +Additionally, there are some GUI settings that can either only be set via arguments or +modify/set the default value in the GUI fields: + +```ini +# Console +consoleLogging=False # activate additional logging (visible if started from terminal) +checkFreeSpace=False # check fee space at GUI start (visible if started from terminal) + +# BPM-Panel +runOptics=False # set the tickbox next to the `Run Analysis` button + +# Analysis-Panel +autoclean.limit=0.1 # keep points within this limit, even if they are outliers +clean.sigmas=2 # remove points beyond this many sigmas from the mean +clean.bounds=0.7 # this ratio of points needs to remain otherwise cleaning aborts + +# Amplitude-Detuning-Window +ampdet.tunecut=0.05 # limit around the given tune to exclude from the BBQ tune +ampdet.window=100 # length of the moving average window for the BBQ tune +ampdet.outlierLimit=0.0002 # Cut on outliers around the mean +ampdet.usePreviousBBQ=False # Use previously extraced BBQ data if present +``` + +For more details about these functions see the [BPM-Panel](bpm_panel.md), [Analysis-Panel](analysis_panel.md) and [Amplitude-Detuning](ampdet.md) pages. + +## Default Settings + +When saving the GUI settings, a similar file `settings_xxx.properties` is created. +Instead of loading these settings manually, you can also copy all or a selection of the entries +from the output file into your `bbgui_user.properties` and they will be set automatically when the GUI is started. + +For details see the [Settings](settings.md) page. diff --git a/docs/guis/betabeat/gui.md b/docs/guis/betabeat/gui.md index 28976b18..dd15c1a8 100644 --- a/docs/guis/betabeat/gui.md +++ b/docs/guis/betabeat/gui.md @@ -5,12 +5,14 @@ The GUI can be ran locally, provided you have access to `afs`, but most importan This section provides a short overview for the main features. !!! info - The code documentation of the Beta-Beat GUI can be found on CERN's gitlab pages. - The master and OMC3 branches are generated: + The gitlab CI automatically generates an [API documentation page][bbgui_doc_omc3]{target=_blank} based on the source code.
+ (A legacy version for the `BetaBeat.src` branch is [also available][bbgui_doc_bbsrc]{target=_blank}.) - * [Master branch][bbgui_doc_bbsrc]{target=_blank} - * [OMC3 branch][bbgui_doc_omc3]{target=_blank} +One would usually start with setting up the GUI via: +- [Defaults](defaults.md) to set some default values right from the start of the GUI. +- [The Beam Selection Window](beam_selection.md) to set the beam, paths and the `python` binary to use. +- [The Settings Window](settings.md) to set additional options for the GUI and analysis. The GUI provides several panels, each for a defined use and with a set of options and results: @@ -18,11 +20,20 @@ The GUI provides several panels, each for a defined use and with a set of option - [The Analysis Panel](analysis_panel.md) to display and manipulate the results of harmonic analysis on measurement data. - [The Optics Panel](optics_panel.md) to compare computed optics to nominal models. - [The Correction Panel](correction_panel.md) to display the computed necessary corrections to reach the nominal model. +- [The Amplitude Detuning Panel](ampdet.md) for amplitude detuning analysis. + +some GUI elements are shared between different panels, and are described in the [Common Components](common_components.md) section, +in particular, information with regards to the shared [plotting backend](common_components.md#plotting) can be found there. This site will guide you through the GUI's layout and functionality. For starters, check out [the basics of running the GUI](../about.md). +The main focus of this documentation is the version that uses the `omc3` package. +For some additional information regarding the legacy `BetaBeat.src` version, see [the dedicated page](betabeatsource.md). -[bbgui_doc_bbsrc]: https://lhc-app-beta-beating.docs.cern.ch/master/ -[bbgui_doc_omc3]: https://lhc-app-beta-beating.docs.cern.ch/omc3/ +!!! warning "Bug Reporting" + If you find bugs, please create [issues][betabeat_gui_gitlab_issues]{target=_blank} with the `OMC3-GUI` label. +[bbgui_doc_omc3]: https://lhc-app-beta-beating.docs.cern.ch/omc3/ +[bbgui_doc_bbsrc]: https://lhc-app-beta-beating.docs.cern.ch/master/ +[betabeat_gui_gitlab_issues]: https://gitlab.cern.ch/acc-co/lhc/lhc-app-beta-beating/-/issues diff --git a/docs/guis/betabeat/model_creation.md b/docs/guis/betabeat/model_creation.md new file mode 100644 index 00000000..a691494d --- /dev/null +++ b/docs/guis/betabeat/model_creation.md @@ -0,0 +1,356 @@ +# Model Creation + +## Model Selection Window + +The _model selection window_ **opens automatically** after starting the main GUI frame from the [beam selection window](beam_selection.md). +This window can be opened at any time by clicking the **left-most button at the top** of the GUI, depicting a "model". + +
+
+ Icons at the top of the GUI. +
Open the model creation window with the left-most button at the top, depicting a model.
+
+
+ +If there have been no models previously created, the top part of the window will be blank. +After [creating a model](#model-creation-window), the window will show the **folder names** in the _Models_ folder of the +accelerator sub-folder selected in the [beam selection window](beam_selection.md). + +=== "Blank Model Selection Window" + +
+
+ Model selection window. +
Blank Model selection window.
+
+
+ +=== "Model Selection Window with Created Model" + +
+
+ Model selection window with created model. +
Model selection window with a created model
+
+
+ +The buttons at the bottom of the window are: + +- ++"Create New"++ : +Opens the [model creation window](#model-creation-window) for a new model. +- ++"Load"++{.green-gui-button} _(If a model exists and is selected)_: +Sets the currently chosen model as "selected model" in the GUI and closes this window. + + !!! warning "Loading a model under creation" + This first checks if certain files are present in the model folder; e.g. if the model is still under creation (check the [running tasks](common_components.md#running-tasks)), it will show an error in the [status bar](common_components.md#console). + +- ++"Delete"++{.red-gui-button} _(If a model is selected)_: +Deletes the selected model folder **from disk** :fontawesome-solid-triangle-exclamation:{.warning-colored}. +- ++"Import External"++{.yellow-gui-button} : +Opens a file-dialog +to select a folder with a previously created model at a location outside the current accelerator's _Models_ folder and copies it there. +- ++"Update MQTs"++{.blue-gui-button} _(If a model is selected)_: +Updates the values of the MQTs (which are saved in a separate file) in the currently selected model via extraction from `NXCals`. +A window will open to select a time to extract the MQTs from, which default to the current time. + + !!! warning "Updating MQTs" + This only **updates** the MQTs, which means they need to have been extracted before. + It checks in the model folder if the `extracted_mqts.str` file is present, which it updates, + and if `job.create_model_best_knowledge.madx` exists, which is then reused to re-run. + + !!! warning "Updating MQTs to re-use model" + It is **heavily discouraged** to update the MQTs to re-use a model later during a shift, + as it will lead to confusion if optics have already been analyzed with this model and someone tries to reproduce the results later. + It is therefore usually better to create a new model from scratch and **only use this functionality before doing any analysis**, + e.g. if you extracted the MQTs too early, or if you created a copy of an older model. + +## Model Creation Window + +After clicking on ++"Create New"++ in the [model selection window](#model-selection-window), _model creation window_ opens. + +Currently model creation is only implemented in the GUI for the [LHC](#lhc-model-creation), [SPS](#sps-model-creation), [PS](#ps-model-creation), and [PSB](#psbooster-model-creation) accelerators. + +### General + +All model creation windows for the different accelerators are using **unified window components**, which follow a common structure, described here. +They differ in the accelerator specific details, which are explained in the sections below. + +#### Base + +- **Model Name**: +The name of the model, which will be used to name the folder for the model. +To easily identify a model later on, this should tell the user at a glance **everything important** about the model, e.g. for which **accelerator** the model was created, which optics where used, which **tunes** were set (if particular), if the excitation was special, if **best knowledge** was also created, etc. +Nowadays, the name comes already with a date as prefix-suggestion. + +- **Fetcher**: +Which fetcher should be used to get the optics data from [`acc-models`][acc-models] and populate choices in the _Accelerator_ section of this window. +The choices are **AFS**, which uses the default `acc-models` path on `afs`, and **Path**, which allows you to set a custom path +to a local `acc-models` folder. +After selecting the fetcher, a python process runs in the background to retrieve the data. + + !!! warning "First time running Fetcher" + If this is your first run with this fetcher, **it might take a while to complete** (up to about a minute). Afterwards, the data is cached and the GUI is updated more quickly. + + !!! warning "Fetcher `NONE` not implemented" + In the current GUI implementation, a fetcher/`acc-models` is needed to create a model (see [#202][bbgui_issue_202])! + Switching back from a selected fetcher to `None` might even throw a `NullPointerException` and possibly crash the Model Creation Window. + +#### Tunes + +This section allows you to define the tunes for the model, including the tunes of the exciter element if applicable. + +- **Excitation**: +Choose which exciter drives the beam (or tracking simulation) or **`NONE`** in the case of free kicks. +- **Free Tune**: +The natural tune of the machine, without any driven excitation. +- **Delta Tune** _(Only active if an excitation was selected)_: +The tune delta between the _free tune_ and the _driven tune_, using the same convention as in the [multiturn GUI][multiturn_tune_deltas], +i.e. the difference from the _free tune_ to the _driven tune_ (in contrast to the [tune settings](settings.md#tunes-tab) in which the _driven tune_ is the starting point). +- **Driven Tune**: +This is the tune of the beam during the excitation and is **automatically computed** from the _free tune_ and the _delta tune_. + +#### Full Response + +This section allows you to activate and define the creation of the full response matrices. +See _[Dilly et al. - An updated global optics correction scheme][dilly2018]{target=_blank}_ and the [`omc3` documentation][global_correction_omc3]{target=_blank} for details. + +- **Create**: +Activates the creation of the full response matrices. +- **Variables**: +The variables which are changed to calculate a response of the optics. +The names given here can be the MAD-X circuit names directly, or the group names as defined for the accelerator in `omc3`, +i.e. this follows the same logic as the [variables used for global correction](correction_panel.md). + + !!! tip "Use larger variable groups" + If you do not create a response for a given variable, you will not be able to use it later on in the correction. + Hence, you probably want to use larger groups here, to have a wider range of choice for variables later. + +- **Increment**: +The value by which each variable will be changed to check the response. + +!!! note "FullResponse Task" + The full-response creation will only start after the model is fully created and you have closed the popup-window + asking you to load the model or not (see below). + By that time you can **already use the model** as if it was fully created and you **do not need to wait for this taks to finish** for the _standard_ analysis, until you want to calculate [global corrections](correction_panel.md).
+ The full-response creation is also heavily parallelized where possible, so expect a few processes to run at the same time. + +#### User + +- **Modifier**: +Path to a MAD-X file, which will be called in MAD-X **after** the above selected optics are applied. +This can be used to install your own optics modifications. + +??? info "Modifiers in `omc3`" + Any change to the accelerator sequence is called a "modifier" in the [model creation in `omc3`][model_creation_omc3]{target=_blank} + and modifiers are given as a list to the model creator. + The option here simply appends another entry to this list, which already contains the path to the above selected optics file and possibly the `knobs.madx`, if the online-model was used (see below). + If you need to call multiple files, you need to add `call, file=...` MAD-X commands into the modifier-file you are providing here. + When the model is later built, e.g. for the [global correction checks][global_correction_checks], these modifiers + will be identified from tags in the `job.nominal.madx` file. + +??? warning "Deprecated `modifiers.madx`" + In the past, the modifiers were given as a separate `modifiers.madx` in the model folder. + Due to backwards compatibility, the `modifiers.madx` file is still somewhat supported, but not encouraged. + So **giving here a file called `modifiers.madx` within the model folder might lead to unexpected behavior**. + +#### Create + +Clicking on the ++"Create New"++{.green-gui-button} button will start the model creation. +If any [extraction](#extraction-lhc) is selected, these tasks will run first and they can take a few minutes. + +!!! warning "Loading a new Model" + When the model creation is finished (but before the full-response creation), a popup will ask you if you want to load the model or not. + Before you see this window, clicking on the ++"Load"++{.green-gui-button} button in the [model selection window](#model-selection-window) will only show an error, + even though its name already appears in the list, because the model is not yet fully created. + +### LHC Model Creation + +
+
+ Model creation window for LHC Beam1. +
Model creation window for the LHC.
+
+
+ +#### Tunes (LHC) + +For the LHC the tunes are set by default to `0.28 - 0.01` in horizontal and `0.31 + 0.012` in vertical, +which are our default tunes for LHC measurements. + +#### Accelerator (LHC) + +- **Beam**: +The beam is pre-defined by the accelerator choosen in the [beam selection window](beam_selection.md). +- **Year/Tag**: +This field is automatically filled by the fetcher with the first layer of subfolders in the `acc-models/lhc` repository by the fetcher. +- **Energy**: +The energy at which the accelerator is running in GeV. +- **Optics File**: +The optics used for the model, which has the same name as the one used in the machine. +The **File** dropdown is automatically filled by the fetcher with the files in the `operation/optics` folder within the choosen _year/tag_ +of the `acc-models/lhc` repository. +You can search through the list via regular expression in the **Filter** field. +- **dpp**: The momentum deviation for the model. + +#### Extraction (LHC) + +This section allows you to extract the actual settings from the LHC via NXCals +at the given UTC time at the top of the section. +Use the :fontawesome-regular-clock:-button to set it to the current time. + +We distinguish here between two different cases: + +- **Online Model**: +The online model settings are applied to the **nominal model**, which is used almost everywhere throughout the analysis. +There will be no model created without these settings! +You can choose which settings you want to extract, and if any of these are activated, a `knobs.madx` file will be created, which contains the extracted settings mapped to the respective MAD-X variables. + - **xing**: Crossing angles + - **sep**: Beam separation + - **chroma**: Chromaticity values + - **ip offset**: Beam offsets at the IPs + - **disp**: Dispersion values + - **mo**: Powering of the landau octupoles (MOs) +- **Best Knowledge Model**: +The best knowledge model is created with the same settings as the **nominal model**, +i.e. all extracted knobs from the _online model_ are also applied. +In addition, this model contains also the $b_2$ errors of the main dipoles from the [magnetic model][fidel_webpage]. +This will result in additional `*_best_knowledge.dat` twiss-output files, which are used in the N-BPM method of the beta-from-phase analysis +(see _[Langner et al. - Utilizing the N beam position monitor method for turn-by-turn optics measurements][langner2016]{target=_blank}_). + - **$b_2$ error table**: + As these errors are dependend on the powering of the dipoles, you need to choose the table with the closest energy to the one you are creating the model for. + - **:fontawesome-solid-triangle-exclamation:{.warning-colored} Extract MQTs**: + As the $b_2$ errors change the tunes, you should **always also extract the MQTs** when creating the best knowledge model. + +!!! warning "Java Issues and RBAC token" + Due to Java misconfiguration in the CCC terminals there can be access-issues with the _online model extraction_, + additional steps might need to be taken **before starting the GUI**. + For now, follow the [running in the CCC in 2025 instructions][running_in_the_ccc] and create a valid + RBAC token via the button at the top of the GUI: + +
+
+ RBAC GUI elements +
RBAC GUI-Element (No Token).
+
+
+ +### SPS Model Creation + +
+
+ Model creation window for the SPS. +
Model creation window for the SPS.
+
+
+ +#### Tunes (SPS) + +The **fractional tunes** are set by default to some values, that have suited us in the past, +but as the settings of the SPS can differ quite drastically, you need to check the currently used values in the SPS multiturn application. + +!!! warning "Integer Tunes" + The **integer part of the tunes** is set from the filename of the choosen _Strength File_ (below). + To set them manually, make sure to **first select a strength file and then change the integer tunes**. + +#### Accelerator (SPS) + +- **Year**: +Which year to create the model for. +This field is automatically filled by the fetcher with the first layer of subfolders in the `acc-models/sps` repository. +- **Strength File**: +Strength file to use. +This field is automatically filled by fetcher with the files in the `strengths` folder within the choosen _year_ of the `acc-models/sps` repository. +- **Kinetic Energy**: Activate and set the energy at which the accelerator is running in GeV, if needed for your model. + +### PS Model Creation + +
+
+ Model creation window for the PS. +
Model creation window for the PS.
+
+
+ +#### Tunes (PS) + +!!! warning "Not Adapted to PS" + The tunes are set by default to `0.28 - 0.01` in horizontal and `0.31 + 0.012` in vertical, + which are our default tunes for LHC measurements, but are not suitable for the PS accelerator. + +#### Accelerator (PS) + +- **Year**: +Which year to create the model for. +This field is automatically filled by the fetcher with the first layer of subfolders in the `acc-models/ps` repository. +- **Scenario**: +Operational scenario of the PS accelerator. +This field is automatically filled by the fetcher with the content of the `scenarios` folder within the choosen _year_ of the `acc-models/ps` repository. +- **Cycle Point**: +Desired point in the cycle. +This field is automatically filled by the fetcher with the content of the chosen _scenario_ folder above. +- **Strength File**: +Strength file to use. +This field is automatically filled by the fetcher with available `.str` files in the chosen _cycle point_ folder. +- **Kinetic Energy**: +Activate and set the energy at which the accelerator is running in GeV, if needed for your model. +- **Tune Matching Method**: +Choose the method to match the tunes. +Can be + - `qf`: Main quadrupoles (low energy quads). + - `pfw`: Pole face windings. + - `bh`: Combined function magnet quadrupole. + - `f8l`: Figure-of-eight loop. + +### PSBooster Model Creation + +
+
+ Model creation window for the PSBooster. +
Model creation window for the PSBooster.
+
+
+ +#### Tunes (PSB) + +!!! warning "Not Adapted to PSB" + The tunes are set by default to `0.28 - 0.01` in horizontal and `0.31 + 0.012` in vertical, + which are our default tunes for LHC measurements, but are not suitable for the PS accelerator. + +#### Accelerator (PSB) + +- **Ring Number**: +Ring of the PSBooster to create the model for (1 to 4). +- **Year**: +Which year to create the model for. +This field is automatically filled by the fetcher with the first layer of subfolders in the `acc-models/psb` repository. +- **Scenario**: +Operational scenario of the PSBooster. +This field is automatically filled by the fetcher with the content of the `scenarios` folder within the choosen _year_ of the `acc-models/psb` repository. +- **Cycle Point**: +Desired point in the cycle. +This field is automatically filled by the fetcher with the content of the chosen _scenario_ folder above. +- **Strength File**: +Strength file to use. +This field is automatically filled by the fetcher with available `.str` files in the chosen _cycle point_ folder. +- **Kinetic Energy**: +Activate and set the energy at which the accelerator is running in GeV, if needed for your model. + +[global_correction_checks]: correction_panel.md#correction-checks +[bbgui_issue_202]: https://gitlab.cern.ch/acc-co/lhc/lhc-app-beta-beating/-/issues/202 +[acc-models]: https://acc-models.web.cern.ch/acc-models/ +[multiturn_tune_deltas]: ../multiturn/excitation.md#tune-deltas +[dilly2018]: http://cds.cern.ch/record/2632945 +[model_creation_omc3]: https://pylhc.github.io/omc3/entrypoints/other.html#model-creator +[global_correction_omc3]: https://pylhc.github.io/omc3/entrypoints/correction.html#global-correction +[fidel_webpage]: https://lhc-div-mms.web.cern.ch/tests/MAG/Fidel +[langner2016]: https://link.aps.org/doi/10.1103/PhysRevAccelBeams.19.092803 +[running_in_the_ccc]: ../about.md#running-in-the-ccc-in-2025 + +*[CCC]: Cern Control Center +*[MQTs]: Tuning Trim Quadrupole Magnets of the LHC +*[RBAC]: Role Based Access Control +*[LHC]: Large Hadron Collider +*[SPS]: Super Proton Synchrotron +*[PS]: Proton Synchrotron +*[PSB]: Proton Synchrotron Booster +*[OMC]: Optics Measurement and Correction diff --git a/docs/guis/betabeat/omc3.md b/docs/guis/betabeat/omc3.md deleted file mode 100644 index b783272c..00000000 --- a/docs/guis/betabeat/omc3.md +++ /dev/null @@ -1,79 +0,0 @@ -# Beta-Beat GUI for `omc3` - -!!! info - This page is meant for people, who know the old Gui and want to use the `omc3` functionality in the GUI now! - -For now, this is still in beta and has a lot of not-yet-implemented functionality. -On the up-side, it also has some new-and-improved functionality over the Beta-Beat-Source (`master`) branch. -The basic optics analysis and plotting work! - -## Important changes - -### Python - -In the Beam-Selection Window you need to give it a python-binary (e.g. `venv/bin/python`). -Best would be if you have a local virtual environment. -This **needs to have omc3 installed as a package**. -See [omc3 on github][omc3_github_getting_started]{target=_blank}. -```bash -pip install git+https://github.com/pylhc/omc3.git -``` -This is because python calls are now made by module, i.e.: -```bash -python -m omc3.module arg1 arg2 ... -``` - -### Settings - -* Settings are now all in one place (the settings-button on top). -* Entries in the settings that are lists (e.g. 'Turns' which will be `STARTTURN ENDTURN`) are given as **space-separated** values, NOT comma separated. -* Settings can be reverted as long as you do not click apply. -* Settings are applied automatically on ++okbtn++. -* Settings are reset to last applied on ++cancelbtn++. - -### Opening Files - -* Each tab has now an Open Files button, which opens only the files specific to this tab. -* The magic **+** button is gone, as its functionality was confusing (and there were different stories about its workings). - -### Optics Plotting - -* RDT and CRDT plots are added dynamically depending on the files present in the respective folders. -* Nicer names and more structure in the tree. -* Backend was rewritten, so it is now more modular and easier to add new plot-types. - -### Keys in Plots - -* ++lbutton++ : Draw and zoom into rectangle. -* ++mbutton++ : Auto-zoom (in 3 Steps: 4σ, 3σ, 2σ). -* ++rbutton++ : Undo last step. -* ++shift+rbutton++ : Undo all steps (reset plot). -* ++mousewheel++ : Zoom relative to mouse position. -* ++shift+mousewheel++ : Zoom y-axis relative to mouse position. -* ++alt+mousewheel++ : Zoom relative to plot center. -* ++shift+alt+mousewheel++ : Zoom y-axis relative to plot center. - -### Nattune Updater - -* You can set a frequency range and it does not redo the analysis but just picks the highest peak in that range and assigns it to `NATTUNE` in the lin-file. -* This should be very helpful for amplitude detuning analysis. - -## Known not to work: - -* Other accelerators than the `LHC` (you can trick it a bit, though, by choosing LHC and then changing the accelerator manually in the `settings`). -* Removing turns (but you can set Start and End turn in the settings). -* BBQ compensation for amplitude detuning can't be called directly from the GUI. -* Things that do not work as they are not implemented in `omc3`: - - Global Corrections, - - SegmentBySegment, - - Spectrum Plot Export cannot export both planes into one axis, - - Optics Plot Export cannot have separate limits for the two plots, - - Optics Plot Export cannot export CRDT plots, -* Do NOT use the Nattune-Updater (in the Spectrum panel) if you have free kicks (it adds a `NATTUNE`-Column to the lin-file). - -!!! warning "Bug Reporting" - If you find bugs, please create [issues][betabeat_gui_gitlab_issues]{target=_blank} with the `OMC3-GUI` label. - - -[omc3_github_getting_started]: https://github.com/pylhc/omc3#getting-started -[betabeat_gui_gitlab_issues]: https://gitlab.cern.ch/acc-co/lhc/lhc-app-beta-beating/-/issues diff --git a/docs/guis/betabeat/optics_panel.md b/docs/guis/betabeat/optics_panel.md index 1c848fb2..c3b24fef 100644 --- a/docs/guis/betabeat/optics_panel.md +++ b/docs/guis/betabeat/optics_panel.md @@ -3,9 +3,9 @@ The `Optics Panel` provides graphical interface to compare the computed optics to the nominal model. There are in total three main tabs for the optics panel: -- The [Optics](#Optics Tab) tab, where a tree menu (on the left) provides many physical properties to be displayed. -- The [Segment-by-Segment: Segment](#Segment-by-Segment: Segment Tab) tab, to have a look at properties in a pre-defined segment of the machine. -- The [Segment-by-Segment: Element](#Segment-by-Segment: Element Tab) tab, to have a look at properties for a pre-defined list of elements in the machine. +- The [Optics](#optics-tab) tab, where a tree menu (on the left) provides many physical properties to be displayed. +- The [Segment-by-Segment: Segment](#segment-by-segment-segment-tab) tab, to have a look at properties in a pre-defined segment of the machine. +- The [Segment-by-Segment: Element](#segment-by-segment-element-tab) tab, to have a look at properties for a pre-defined list of elements in the machine. ## Optics Tab @@ -15,6 +15,10 @@ A wide variety of computed physical properties can be visualized across the enti !!! todo Include a screenshot with the main optics tab. +### Open Files + +- TODO: Open and convert BBS files! [outputfiles](betabeatsource.md#meaning-of-the-output-files) + ## Segment-by-Segment: Segment Tab A list of pre-defined segments of the machine can be selected to view properties across said segment. @@ -37,7 +41,7 @@ Clicking `Go` will call for another python script and take you to the `Segment-b ## Segment-by-Segment: Element Tab Pre-defined lists of elements can be selected to view properties across said elements. -The working is similar to the one for different [segments](#Segment-by-Segment: Segment). +The working is similar to the one for different [segments](#segment-by-segment-segment-tab). !!! todo Include a screenshot of the element tab. @@ -63,4 +67,10 @@ The following methods implement different correction algorithms: The results are outputted in the `changeparameters` files. These files store the magnet names and corresponding correction strengths. -They are also displayed in the [Correction Panel](correction_panel.md). \ No newline at end of file +They are also displayed in the [Correction Panel](correction_panel.md). + +### Optics Plotting + +- RDT and CRDT plots are added dynamically depending on the files present in the respective folders. +- Nicer names and more structure in the tree. +- Backend was rewritten, so it is now more modular and easier to add new plot-types. diff --git a/docs/guis/betabeat/settings.md b/docs/guis/betabeat/settings.md new file mode 100644 index 00000000..26e9841f --- /dev/null +++ b/docs/guis/betabeat/settings.md @@ -0,0 +1,500 @@ +# Settings Window + +
+
+ Icons at the top of the GUI. +
Open the settings window with the white-on-blue gear icon .
+
+
+ +Great care has been taken to create a user friendly and easy to find interface for all settings. +The settings window can be initialized by the gear icon in the top left corner of the GUI. + +!!! info "Defaults" + The "Default" values given here are the defaults used in `python`, + These might not be up-to-date, check the [omc3 python documentation][python-docs]{:target="_blank"} for more information. + They might also be different from the defaults used in the GUI, as there are some defaults set upon startup determined by the selected machine. + These GUI defaults are directly visible in the settings, while the `python` defaults are used when no value is given. + +## General Behaviour + +There is some general behaviour, that is true for all settings-tabs: + +- **Empty** text-fields are treated as _"Not given"_ and the **`python` defaults** will be used. +- **Hovering the mouse over the label** of a setting will give additional information. + This is often the `help` provided by the corresponding `python` argument. Check the [omc3 python documentation][python-docs]{:target="_blank"} for more information. +- Entries in the settings that are lists (e.g. _Turns_, which will be `STARTTURN ENDTURN`) are given as **space-separated** values, NOT comma separated. +- Of the buttons at the bottom, the top row refers to the current tab, the bottom row to all tabs. +- Settings that have been changed since the last ++"Apply"++ / ++"Apply All"++ are highlighted in red and can be reverted with the ++"Reset"++ button. +- Settings are applied **automatically** on ++okbtn++. +- Settings are **reset** to last applied on ++cancelbtn++. +- ++"Save to File"++: When saving the settings to file, a file `settings_xxx.properties` is created, containing entries for **ALL** settings, even those not set in the GUI. +- ++"Load from File"++: When loading settings from file, not all possible entries need to be present in that file and **only present ones will be modified** in the UI. + Entries in the file, that are not recognized as settings will be ignored. + +!!! info "Some Background on the Internals" + To "apply" settings simply means that the current values in the UI are assinged to the corresponding settings class, + each an internal representation of a settings tab, + which is used to persistently store the settings in memory and pass them between different parts of the application. + To "reset" the settings, the stored values are reloaded from this internal representation to the UI. + +## Gui Tab + +
+
+ GUI settings tab. +
The Gui tab of the settings window.
+
+
+ +The GUI tab contains settings that steer the behaviour of the GUI. +This is in contrast to the other settings tabs, which control the settings passed on to the `python` tasks. + +- **Turn-by-Turn Datatype of Files to be Opened**: + Specify the datatype of the turn-by-turn data files that you open when clicking on ++"Open Files"++{.green-gui-button} in the [BPM Panel](bpm_panel.md). + If you do **not** convert the files, this needs to be one of **`lhc`** or **`sps`**, as these are the only ones the GUI can handle. + +- **Convert Turn-by-Turn Files on Opening**: + When **`Do not convert`** is selected, turn-by-turn files are simply copied into the current `Measurements` directory. + If **`lhc`** or **`sps`** is selected, the `omc3.tbt_converter` will be called to convert the files from the + datatype in the previous setting to the here selected type, **even if the same format is selected!**
+ :fontawesome-solid-triangle-exclamation:{.warning-colored} _The copied/converted files are the ones that will be passed on to `harpy` later on. + As the default input format there is **`lhc`**, make sure to change it there in case you are using anything else!_ + +- **Phase-Advance as X-Axis in Optics-Tab**: + Uses the phase-advance (`MUX`/`MUY`) column as the X-Axis in the Optics-Tab instead of the longitudinal position (`S`). + +- **Rename Optics-Dir on Import**: + If active and you open an already analysed optics directory, via the ++"Open Files"++{.green-gui-button} in the [Optics Panel](optics_panel.md), + which is **NOT** already in the current `Results` directory, the imported directory will be prefixed with the current time (as was default in the [BetaBeat.src version](betabeatsource.md)). + +- **Analyse TbT Files on Opening**: + If active and you open a turn-by-turn file, via the ++"Open Files"++{.green-gui-button} in the [BPM Panel](bpm_panel.md), + `harpy` analysis will be automatically started (for now: the user will be prompted with the ["Do analysis Dialog"](bpm_panel.md#do-analysis) directly after TbT import). + +- **Python Path**: + Change the location of the `python` executable to be used to run the python scripts. + After a change here, the GUI will check which versions of `omc3` and `pylhc` are installed in the selected environment and update the [entry at the top](common_components.md#top-of-the-gui). + +- **Python Debugging**: + If active, the GUI will run the `python` script with the `-d` flag, which initializes the logging level in our scripts automatically to `DEBUG`. + +- **Use Server for Analysis**: + When set, all `python` tasks requireing lots of memory and processing power (e.g. `hole-in-one` for `harpy` and `optics`) will be run on that server. + If you click the ++"Test"++ button, file creation and reading of the created files from the local machine will be tested and you will be prompted with the results after a few seconds. + +- **Always use Server**: + If active, all `python` tasks will be run on the server, even if they do not require much processing power. + +- **Run Per-File Tasks in Parallel**: + If active, tasks that are started together but can run independently per file will be run in individual tasks in parallel, + e.g. the `harpy` analysis will be run in parallel for each turn-by-turn file, even if started with multiple files selected at once. + When running `optics analysis` with _"combine analysis"_ **deactivated** the analysis will be run in parallel for each file. + Conversely, if opting to run the `optics analysis` directly from the BPM-Panel with _"combine analysis"_ **activated**, + the `harpy` analysis of the selected files will be run sequentially per file, as it is not explicitely parallelized on the python side. + +## Tunes Tab + +
+
+ Tunes settings tab. +
The Tunes tab of the settings window.
+
+
+ +In this tab, the settings for the tunes are defined. +The connection of these settings to the `python` settings is a bit tricky, +because some of the information is passed on to the input arguments of the `accelerator class` (the actual tunes) and some to `harpy` (the settings below). + +### Tunes + +In this grid, the horizontal (`X`), vertical (`Y`) and longitudinal (`Z`) tunes are defined. +In case of standard (i.e. 2D) kicks, the longitudinal tune needs to be set to `0`. + +The tunes are automatically updated when [loading a model](model_creation.md), but can be manually adjusted. + +The first row defines the main line to be found in the spectrum, which is the **driven tune** in the case of AC-Dipole kicks and +the **natural tune** in the case of free kicks. + +The natural tunes can be given either directly or as differences to the main tune, by activating the `Nat. Deltas` checkbox. +This is also reflected in parameters given to `harpy` and can be useful together with the `Autotunes` setting, e.g. if different working points with the same delta are probed. + +!!! warning "Deltas Sign-Convention" + The signs between the `Nat. Deltas` here and in [Multiturn][multiturn] are inverted, because [Multiturn][multiturn] uses the natural tunes as the basis + from which the AC-Dipole is set while `harpy` uses the highest peak in the spectrum (i.e. the AC-Dipole tune line) as the basis from which the natural tunes are found. + +The ++"<-- Model"++ button will load the tunes of the respective row from the currently loaded model, +while the other buttons calculate the tune in the respective row from the other two rows. +++"Get all from Model"++ will load the tunes of all rows from the loaded model. + +The fields are non-editable when it does not make sense in the current settings (e.g. no natural tunes when free kicks are used, switching between natural tunes and deltas). +**"Make all tune-fields editable"** overrides this and does exactly what it says. + +### Settings + +- **Free Kick**: + If active, free kicks are used instead of AC-Dipole kicks. + +- **Autotunes**: + If active, the highest peak in the whole spectrum is automatically assumed to be the main tune, either in the **`transverse`** planes or in **`all`** planes including the longitudinal. + Otherwise the main tune is defined as the highest peak in the spectrum around the tunes given in the first row ± the tolerance. + +- **Clean Limit**: + When cleaning is active, BPM outliers are detemined as those that are further away than others from the average. + This limit sets a hard border to the cleaning, where **outliers closer than the given limit to the average tune will not be removed**. + +- **Tolerance**: + The tolerance for the peak search in the spectrum. + This tolerance is used for all peaks (unless `Autotunes` is active, in which case it is not used for the main tune), i.e. for all harmonics/resonance lines searched for in the spectrum. + +## Harpy Tab + +
+
+ Harpy settings tab. +
The Harpy tab of the settings window.
+
+
+ +The Harpy tab contains the settings for the [harmonic `harpy` analysis][harpy_analysis]. + +- **Files**: + This field is not editable and automatically set when selecting TbT files in the [BPM Panel](bpm_panel.md) and running the analysis. + It is only shown here, as `files`is an argument to `harpy` and an attribute on the internal `HarpySettings` class, which is set later from the user selection. + +- **Outputdir**: + This field is not editable and automatically set when running the harmonic analysis, as the selected file-names are used to define the output directory. + When running analysis from the GUI, the output files are put into the same directory as the input files, + unless also the optics-analysis is run at the same time, in which case they will be put in a sub-directory (`linfiles`) of the + respective optics output in the `Results` directory. + The field is only shown here, as `outputdir` is an argument to `harpy` and an attribute on the internal `HarpySettings` class, which is set later from the user selection. + +- **Model**: + This field is not editable and automatically set when loading a model. + It contains the path to the `twiss.dat` file of the loaded model. + The field is only shown here, as `model` is an argument to `harpy` and an attribute on the internal `HarpySettings` class, which is usually already set. + +- **Turns**: + Start and end turn to be used from the turn-by-turn data. Default: `[0, 50000]`. + - The order does not matter. + - If one argument is negative or zero, the very first turn is included. + - If the larger argument is larger than the number of turns, the last turn is included. + - If both arguments are higher than the number of turns, there will be an error. + - If the larger argument is also negative, these turns will be removed from the end. + - If both arguments are inside the range of turns, the turn of the larger argument will be the first one excluded (i.e. how `python` slices a list `[start:end]`). + +- **Window**: + The type of windowing function used for the harmonic analysis, to create a closed-form of the signal. + Default: `hann`. + +- **TurnBits**: + The number of bits to be used for zero-padding of the turn-by-turn data, which therefore defines the (interpolated) frequency resolution. + Here, the number of bits is the log of the number of turns in the data, i.e. `turn_bits = log2(turns)` or `turns = 2**turn_bits`, where `turns` is the number of measured turns + zero padding. + This also determines the memory footprint of the analysis and should be reduced for computers with low RAM.
+ :fontawesome-solid-triangle-exclamation:{.warning-colored} Note, that for `6600` turns of measurement data, this number should not be set lower than `13`!
+ Default: `20`. + +- **OutputBits**: + The number of bits to be used for binning of the output data, i.e. `number_of_bins = 2**output_bits`. + This determines the final resolution of the frequency spectrum and the size of the output files. + Within each bin, only the highest peak is kept, leading to uneven frequency distribution. + Default: `12`. + +- **Write Out**: + This parameter determines which output files are written out. + Each file has usually a `x` and `y` version for each per plane. + The following options are available: + - `lin`: Write out the `.lin`-file, which contain a table of BPMs and summarize their main and resonance lines, as well as additional information, e.g. noise. + - `spectra`: Write out the `.amps` and `.freqs`-files, which contain the amplitudes and frequencies within the given `Tolerance` (see [Tunes Tab](#tunes-tab)) around the main and resonance lines. + - `full_spectra`: This setting overrides the `spectra`-setting and writes out **all** amplitudes and frequencies of the binned spectrum in the same file-format. + - `bpm_summary`: Write out the `.bad_bpms`-file, which contains a summary of BPMs that are determined as bad or not. + +- **Unit**: + The unit of the input turn-by-turn data. + Default: `m`.
+ :fontawesome-solid-triangle-exclamation:{.warning-colored} This unit is only valid for the **input data**, internally and in the output files `m` are used.
+ :fontawesome-solid-triangle-exclamation:{.warning-colored} The units for measured LHC turn-by-turn files are `mm`.
+ +- **TbtDataType**: + The datatype of the input turn-by-turn data. + Many options are available here, as they could be used when running the analysis from command-line. + Yet, as we have imported the data already into the GUI, and the GUI only supports `lhc` and `sps` turn-by-turn data, this setting should be set to either of these two values. + Default: `lhc`. + +- **Resonances**: + The multipole order of the resonances looked for in the spectrum and written out in the `lin`-files. + Needs to be between 2 and 8 (including). + If you want to run optics analysis for high-order RDTs later on, you need to set this number respectively, depending on the order of the RDT you want to analyse (see _RDT Magnet Order_ in the [Optics-Tab](#optics-tab) below). + Default: `4` (octupoles). + +### Automated Suffixes + +The harmonic analysis accepts a `suffix` parameter as input, to distinguish between different analysis runs, e.g. with various parameter settings, on the same file. +The _"Automated Suffixes"_ feature of the GUI creates this suffix automatically using the values of the here selected parameters, allowing you to easily compare the impact of different settings on the same data. +This uses not only parameters from this tab but also from the [cleaning-tab](#cleaning-tab) and [tunes-tab](#tunes-tab). +You can also define your own suffix, which will be added to the automatically created one. +The `python` default is `""`, i.e. no suffix. + +## Cleaning-Tab + +
+
+ Cleaning settings tab. +
The Cleaning-tab of the settings window.
+
+
+ +Most of the cleaning, for which the settings can be changed here, are part of the [harmonic analysis module `harpy` in `omc3`][harpy_analysis] +and will be executed during the "Analyse Spectrum" phase. +Some of this procedure is also described on the [BPM filtering page][bpm_filtering]. + +!!! warning "Deactivating Cleaning" + Cleaning can be deactivated via the **Active** toggle, but this is not recommended when working with measured data (in contrast to simulation data), + not only because measured data usually contains BPMs with faulty signals, but also because the synchronizing of measured data to model via the **First BPM** setting + is done within the cleaning module (see below). + +??? info "Why is cleaning part of the harmonic analysis?" + Cleaning is part of the harmonic analysis in `harpy` as the [frequency analysis is done on the v-matrix of the SVD][harpy_analysis]: + SVD is used to reduce the noise in the BPM data by selecting only the most important modes and in the same step also to detect bad bpms. + As this decomposition is a linear transformation, the frequency analysis can be run directly on decomposed v-matrix, without + having to re-compose the data into the time-domain, saving time and memory. + The disadvantage is that, as we do not save the SVD matrices, there is no way to only run _cleaning_ without frequency analysis at the moment. + For more details, see [this documentation][harpy_analysis] and [doi:10.18429/JACoW-IPAC2022-WEPOMS035][harpy_ipac]. + +- **Active**: + If active, the cleaning module is run during the "Analyse Spectrum" phase. + See the caveat above about not running it. + Default: `False`. + +- **Bad BPMs**: + A list of [BPMs already known as "bad"][bad_bpms], i.e. not to be used for frequency analysis. + +- **Wrong Polarity BPMs**: + A list of BPMs that have been found to have wrong polarity. + Their signal will be inverted. + +- **First BPM**: + The BPM which is used as the reference for synchronizing the BPMs to the model. + This should be the first BPM in the turn-by-turn data, which is usually the first BPM after the injection, + so it is different for different machines and even the LHC beams. + The "synchronization" is done by simply ignoring the first turn from all BPMs starting at the given BPM to the last BPM in the model, + meaning the measured data is synchronized to the model, not the other way around. + +- **Max Peak**: + BPMs with any orbit value **larger** than this value will be removed from the analysis. + This ensures the removal of BPMs with unrealisticly high signals, e.g. very large noise. + Default: `0.02`. + +- **Peak-to-Peak Cut**: + BPMs with an absolute difference between their maximum and minimum value **lower** than this value will be removed from the analysis. + This ensures that BPMs with a very flat signal are removed. + Default: `1e-8`. + +- **Singular Value Cut**: + Keep this amount of modes with the highest singular values, i.e. the most important modes. + The remaining modes will be removed from the analysis. + This is one of the most important parameters for general noise removal. + Default: `12`. + +- **SVD Dominance Cut**: + Limit for single BPM dominating a mode. + If any BPM has a larger value than this in a single mode, it will be removed from the analysis. + Only the BPM with the highest value will be removed and then the SVD-matrices are renormalized, + if "SVD Dominance Iterations" is set, this procedure is then repeated for the remaining BPMs. + Default: `0.925`. + +- **Keep Dominant BPMs**: + _[Deprecated: Remove!][gitlab_issue279]_ + +- **SVD Dominance Iterations**: + _[Coming Soon!][gitlab_issue279]_
+ Maximal number of iterations of U matrix elements removal and renormalisation in iterative SVD cleaning of dominant BPMs. + Only used, if the "SVD Dominance Cut" is not `None` and any BPM is above the dominance cut. + As only the BPM with the highest value in a mode is removed, this is also the maximum number of BPMs removed due to the dominance cleaning. + If this is set to `0`, the dominance cleaning is skipped (i.e. the "SVD Dominance Cut" is ignored) and all BPMs are kept. + Default: `3`. + +- **Keep Exact Zeros**: + By default, BPMs that contain exact zeros in their data are removed as in the LHC zeros are added to the data when the value was not found (in other machines this might be `NaNs` instead). + If, for some reason, you expect exact zeros in your data and you want to keep those BPMs, set this to `True`. + Default: `False`. + +- **Opposite Direction**: + If the measured beam data is in the opposite direction from the model, as e.g. the case for the LHC Beam 2 (when not using a Beam 4 model), + this box needs to be checked so that the analysis knows about this direction change. + In the GUI this should be set automatically when choosing LHCB2. + Default: `False`. + +### GUI Cleaning + +The GUI provides additional ways of cleaning BPMs on the output of the harmonic analysis in the [Analysis Panel](analysis_panel.md). +The BPMs given here to the **Keep BPMs** field will be kept, even if they are outside the specified cut-offs or identified as outliers. +The defaults here for the LHC are the BPMs **closest to the AC-Dipole**, as they are used for compensating for the additional phase-advance +introduced by the AC-Dipole and if they are not found in the data, the optics analysis will fail. + +## Optics-Tab + +
+
+ Optics settings tab. +
The Optics-tab of the settings window.
+
+
+ +- **Files**: + Files to to use for the optics analysis. + These are the output files from `harpy`. + This field is not editable and is only shown here, as `files` is an argument to `optics_measurement` and an attribute on the internal `OpticsSettings` class. + The actual files to use are chosen from the [Analysis Panel](analysis_panel.md), after which this field is automatically filled in when shown in the [Run Optics](analysis_panel.md#run-optics) popup window. + +- **Outputdir**: + Directory to place to output of the optics analysis. + The field is not editable and is only shown here, as `outputdir` is an argument to `optics_measurement` and an attribute on the internal `OpticsSettings` class. + The actual directory is chosen by the user per analysis, when setting an analysis name in the [Run Optics](analysis_panel.md#run-optics) popup window. + +- **Calibrationdir**: + Path to the directory containing the [calibration][bpm_calibration] files, used to rescale the BPM amplitudes and amplitude errors. + This field should be automatically set correctly, when choosing an accelerator in the [Beam Selection Window](beam_selection.md). + +- **Phase Advance via Union of BPMs**: + Uses the `how=outer` pandas method to join dataframes of multiple measurements, which is equivalent to a union of BPMs (i.e. uses all BPMs present in any measurement file), + instead of the default `how=inner` which creates an intersection of BPMs (i.e. uses only BPMs present in all measurement files). + Default: `False`. + +- **Nonlinear Calculations**: + Activate which "nonlinear" calculations should be performed: The calculation of Resonance Driving Terms (RDTs) and/or the calculation of combined RDTs. + +- **RDT Magnet Order**: + When RDT calculation is active, this field specifies the highest order of magnetic fields for which the corresponding RDTs are calculated. + Needs to be between 2 and 8 (including). + Calculation of RDTs of a given order require the lines of that order to have been identified in the harmonic analysis, hence the _Resonances_ field of the [Harpy-Tab](#harpy-tab) needs to be set to at least the same value. + Default: `4` (octupoles). + +- **Use Three-Bpm Method**: + When active, the [Three-BPM Method][three_bpm_method] is used to calculate beta-from-phase, otherwise the [N-BPM Method][n_bpm_method] is used. + Default: `False`. + +- **Calculate only coupling**: + When active, skips most of the optics calcualtions and calculates only phases and coupling RDTs. + Useful for quick analysis or machines that do not support (e.g. not enough BPMs) some of the other analysis methods. + Default: `False`. + +- **3D-Excitation**: + Activate this, when [3D-Excitation/3D-Kicks][three_d_kicks] were used to calculate chromatic parameters directly from the longitudinal information of the harmonic analysis. + Default: `False` + +- **Isolation Forest Active**: + Activate for additional filtering of BPMs before analysis via the [Isolation Forest][isolation_forest_cleaning] machine learning method. + Default: `False`.
+ :fontawesome-solid-triangle-exclamation:{.warning-colored} _[This method is currently under re-evaluation][isolation_forest_issue]._ + +- **Calculate Second-Order Dispersion**: + Activate to calculate also second order dispersion. + Default: `False`. + +- **Calculate Chromatic Beating**: + Activate to calculate chromatic beatings: W, PHI and coupling. + Default: `False`. + +- **Coupling Method**: + Switch between the different coupling methods. Default: `2`. + - `0`: Disabled. + - `1`: 1 BPM Method. + - `2`: 2 BPMs Method.
+ +- **Range of BPMs** + Select the range of BPMs for beta-from-phase calculation. + Can be an odd number between `5` and `15` BPMs (including). + Default: `11`. + +- **Compensation Mode** + Mode of phase compensation for the analysis in case of a driven beam excitation, + to remove the effect of the AC-Dipole (present in the measurements) from the actual phase advances in the machine (i.e. when the AC-Dipole is not used during the rest of the operation). + This can be `model`, `equation` or `none`. + Default: `model`. + +## Accelerator-Tab + +
+
+ Accelerator settings tab. +
The Accelerator-tab of the settings window.
+
+
+ +In this tab, the settings to determine and define the accelerator class are specified, +which is the `python`-internal representation of the accelerator and its settings in use. + +!!! warning "Automatically Set" + Most of these settings are automatically set from the selected machine and there is **no need to change them manually**. + If you do, you can analyse data from other machines, but the results will be put into the output directory of the selected machine, + which might be very confusing to find this data later on. + The best way to change the machine is to restart the GUI and select the machine you want to use in the [Beam Selection Window](beam_selection.md). + +- **ModelDir**: + The directory in which the model is stored. + This is automatically set by the currently loaded model. + +- **Accelerator Name**: + Name of the accelerator, this is automatically set by the selected beam/accelerator but can be overwritten by the user, **which is not recommended!**{.warning-colored} + +- **LHC Mode**: + Only active if `lhc` is selected. + Mode (e.g. `hllhc`) or year of the LHC accelerator, this is automatically set by the current year but can be overwritten by the user to analyse old or simulation data. + +- **Beam**: + Only active if `lhc` is selected. + Beam of the LHC that is currently analysed. + This is automatically set by the currently selected beam but can be overwritten by the user to analyse the other beam, **which is not recommended!**{.warning-colored} + +- **PSBooster Ring**: + Only active if `psb` is selected. + Ring of the PSB that is currently analysed. + +- **SuperKEKB Ring**: + Only active if `skekb` is selected. + Ring of the SuperKEKB that is currently analysed. + This is automatically set by the selected beam/accelerator but can be overwritten by the user, **which is not recommended!**{.warning-colored} + +## Adding New Settings + +!!! warning "For Developers" + Quite a lot of functionality has been implemented to make the creation of new settings entries as smooth as possible, + not only the transfer of values between model and UI but also allowing them to be also easily manipulated from configuration files. + + **Please use it!** + + It should be mostly a copy-and-paste from other already implemented entries, + if you are using an AI it will probably autosuggest the right functions. + In short: + + In `model/settings`: + + - add a **descriptive attritbute** to the respective settings class. + - add your vlaue to the **constructor** of the class, with default values. + - add your value to the **copy-constructor** of the class. + - add a nice **tooltip** to the label (e.g. the help text from the corresponding `python` argument). + - use `getProperty()` to automatically **extract** the value from the property file in a unified way and set the attribute on the class. + - use `setProperty()` to automatically **set** the value in the property file in a unified way from the current value of the class. + - add your value into the `toString()` function of the class. + + In `view/settings`: + + - add the **label** and appropriate user **interface element**. + - use `getComponentValue()` to automatically **extract** the value from the UI in a unified way and set the attribute on the class. + - use `setComponentValue()` to automatically **set** the value in the UI in a unified way from the current value of the class. + - use `addColorActionListener()` on the new label to **automatically set the color on changes**. + +[python-docs]: https://pylhc.github.io/omc3/ +[multiturn]: ../multiturn/gui.md +[bpm_filtering]: ../../measurements/physics/bpm_filtering.md +[bad_bpms]: ../../measurements/physics/bpm_filtering.md#manual +[isolation_forest_cleaning]: ../../measurements/physics/bpm_filtering.md#isolation-forest +[bpm_calibration]: ../../measurements/physics/bpm_calibration.md +[three_d_kicks]: ../../measurements/physics/threedkicks.md +[gitlab_issue279]: https://gitlab.cern.ch/acc-co/lhc/lhc-app-beta-beating/-/issues/279 +[n_bpm_method]: https://journals.aps.org/prab/abstract/10.1103/PhysRevAccelBeams.20.111002 +[three_bpm_method]: https://repository.cern/records/eny2v-4y338 +[isolation_forest_issue]: https://github.com/pylhc/omc3/issues/184 +[harpy_ipac]: https://accelconf.web.cern.ch/ipac2022/papers/wepoms035.pdf +[harpy_analysis]: ../../measurements/physics/harpy.md \ No newline at end of file diff --git a/docs/guis/chroma/gui.md b/docs/guis/chroma/gui.md new file mode 100644 index 00000000..a42ff100 --- /dev/null +++ b/docs/guis/chroma/gui.md @@ -0,0 +1,182 @@ +# The Non-Linear Chromaticity GUI + +The non-linear chromaticity GUI provides functionality to analyze [chromaticity scans](#performing-scans) in the LHC. +The GUI itself has no functionality for making these measurements and only serves to extract and analyze data from `NXCALS`. + +!!! info "Kerberos" + Note that using the GUI requires a valid Kerberos token. + +The GUI is published with `acc-py`, and can be run with: + +```bash +/acc/local/share/python/acc-py/apps/acc-py-cli/pro/bin/acc-py app run chroma-gui +``` + +## Performing Scans + +Chromaticity scans are performed by modulating the frequency of the RF cavities in the LHC. +The tune will be impacted by the chromaticity of the machine, and online tune data is automatically recorded to `NXCALS`. + +!!! warning "Feedbacks OFF" + Make sure to turn off both the tune and orbit feedbacks before performing an RF scan. + See with the current EIC that no other operations are ongoing that could be affected. + +To perform a scan, trim the RF circuit in steps to reach the desired momentum deviation. +A good rule of thumb, _for the LHC_, is that: + +$$ +dpp = \frac{\Delta f_{RF}}{140} \cdot 10^{-3}. +$$ + +A good modulation aims to reach between $2 \cdot 10^{-3}$ and $3 \cdot 10^{-3}$ in momentum deviation. +Typically, the scans are performed with ±300Hz in steps of 20Hz. + +!!! tip "Max Modulation Amplitude" + Scans have been performed safely in the past with ±400Hz, in cases where specific high orders were investigated. + +## Analyzing Scans + +To analyze data from a scan, start by launching the GUI as instructed above. +It should open to this default view: + +
+
+ Chroma GUI landing page +
Chroma GUI Landing Page
+
+
+ +### Starting a New Analysis + +To start an analysis, click `File` in the top left, then click `New`. +The following menu will appear: + +
+
+ Pop up menu for new analysis +
New Measurement Analysis
+
+
+ +In there, set the following: + +- For `Location`, select a directory where to store all data for this measurement analysis. +- For `Model B1` select the _directory_ with the relevant beam 1 model. +- For `Model B2` select the _directory_ with the relevant beam 2 model. +- Optionally, add a description of the measurement. +- Finally, click `Create`. + +### Extracting Scan Data + +Next, go to the `Timber` tab and select `start` and `end` dates to extract data from, then click `Extract Data`. + +!!! tip "Time Convention" + Note that the times are expected in UTC. One can check the online [Timber][timber_web]{target=_blank .cern_internal} interface for the correct time range of the scan data to extract. + +!!! info "Data Extraction Process" + There is no need to click `Extract raw BBQ` unless to re-analyze the raw data. There are specific UCAP nodes which have done this analysis already. + + There is no loading bar, the panel will just say "Extracting data from Timber..." on the right (and show some things in the terminal). Be patient. + +When the extraction is done, the extracted variables will be listed in the central list view. +Clicking on any of the variables will plot the associated data just below. + +
+
+ Timber tab with plot of selected extracted data +
Timber Tab with Plot of Selected Extracted Data
+
+
+ +### Cleaning Extracted Data + +Move on to the `Cleaning` tab. + +- Potentially change the start and end times depending on when the modulation happens in your extracted data via `Refine Start` and `Refine End` entries. + + !!! warning "Expected Times" + Please note that the `Refine Start` and `Refine End` entries refer to times in the Dataframes themselves, and it is possible that there are timezone issues from the extracted data times. + One can check the times on the plotted data itself. + +- Click the `Create Plateaus` button. This will extract the correct tune values from dp/p and create steps that can be analyzed. These will then be displayed, for the selected beam, both the RF frequency and the raw tune data. + +
+
+ Cleaning tab with raw tune data +
Cleaning Tab with Plot of RF Frequency and Raw Tune Data
+
+
+ +- Click `Clean Data` in the top part of the window. This will compute the tune average for each step and remove outliers. The windows for each tune can be specified and outliers removed in `Bad Tune Lines` in the top part. The minimum plateau length is used to remove very short steps. + +In the plotting part of the window, move on to the `Cleaned Data` tab next to the `Raw Data` one. +This will display the clean tune data, with its error bar for each step. +Ideally this error bar should not be too visible. +Note that some steps may be entirely cleaned out due to the cleaning settings. + +
+
+ Cleaning tab with cleaned tune data +
Cleaning Tab with Plot of RF Frequency and Cleaned Tune Data
+
+
+ +### Computing Chromaticity + +Move on to the `Chromaticity` tab. + +- Select the highest order to be computed and plotted in `Chromaticity Orders to Plot`. Here 3 is a good start but you might want go higher based on the resulting data fits. All lower orders are computed anyways, check them if wanted in the plot. +- Click `Compute Chromaticity`. A fit is performed up to the provided order. + +The results will be shown in plots below. +Similarly, the computed value for each order is shown in a table in the top right part of the window. + +
+
+ Chromaticity tab with fit to data up to provided order +
Chromaticity Tab with Fit of Data up to the Provided Order
+
+
+ +!!! tip "Restricting Fit Range" + One can manually set the `DPP Range` values to exclude extreme `dpp` values that would look fishy from the fit. + +### Determining Corrections + +Move to the `Corrections` tab. + +- Keep the method set to `Global` correction scheme. +- For `Observables to correct` select `DQ2` or `DQ3` to correct $Q''$ or $Q'''$. Adapt the selection to the fitted order from the previous step. +- Click `Correct` to compute corrections for the given settings. + +
+
+ Corrections tab determined trims +
Corrections Tab with Determined Trims for the Given Measurement and Settings
+
+
+ +!!! info "Trimming Corrections" + The resulting correction needs to be **added** to all correctors as displayed, with no sign change. + + In the example screenshot above, this means going to `LSA App Suite`, selecting the relevant corrector circuit for `B1` and trimming an additional `818.1284` to the current value. + + The relevant LHC circuits can be found on pages 2 and 3 of this MD note: + + ??? abstract "MD6864 --- Decapole Studies at Injection, `M. Le Garrec et al.`, 2023, URL: [CERN-ACC-NOTE-2023-0018](https://cds.cern.ch/record/2879070){target=_blank}" + ``` + @techreport{LeGarrecMD6864DecapoleStudies2023, + type = {{Accelerators \& Technology Sector Note}}, + title = {{MD6864 --- Decapole Studies at Injection}}, + author = {Le Garrec, Mael and Carlier, Felix Simon and Dilly, Joschua Werner and Ferrentino, Vittorio and Maclean, Ewen Hamish and Paraschou, Konstantinos and Tomas Garcia, Rogelio}, + year = {2023}, + month = oct, + number = {CERN-ACC-NOTE-2023-0018}, + institution = {CERN}, + url = {https://cds.cern.ch/record/2879070} + } + ``` + +[timber_web]: https://timber.cern.ch/ + +*[EIC]: Engineer in Charge, operators of the LHC diff --git a/docs/guis/developing/ide_install.md b/docs/guis/developing/ide_install.md deleted file mode 100644 index bdd482e6..00000000 --- a/docs/guis/developing/ide_install.md +++ /dev/null @@ -1,92 +0,0 @@ -# IDE Setup - -The easiest way to develop the GUI is using the modified Eclipse versions provided by [Accsoft-Eclipse][accsoft_eclipse]{target=_blank}. -There is also an [installation guide available][accsoft_eclipse_wiki]{target=_blank}. - -For people using pycharm it might make sense to use IntelliJ IDEA, however we do not yet know how to export a JAR (see also [GUI Releases][gui_releases]). - -As both IDEs require [CommonBuildNextGeneration (CBNG)][cbng_wiki]{target=_blank} to resolve dependencies and make releases, one should either run these from somewhere in the Technical Network (e.g. from the `dev-server`) or [mount the required paths via `sshfs`][mounting_tn]. - -## Installation - -=== "Eclipse" - Download your preferred version from their [download page][accsoft_eclipse]{target=_blank} and install. - With this version, `CBNG` comes automatically installed and can be used by simply dragging the desired project into the [CBNG window][cbng_eclipse]{target=_blank}. - For more info see the [accsoft eclipse wiki][accsoft_eclipse_wiki]{target=_blank}. - -=== "IntelliJ IDEA" - Download your preferred version from their [download page][idea_download]{target=_blank} and install. - `CBNG` needs to be setup in IDEA manually, by setting the Gradle home path in: - ``` - File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle - ``` - to the specified location `/user/pcrops/devtools/CBNG/PRO/` - - A more extensive guide can be found in the [CBNG Wiki for IDEA integration][cbng_idea]{target=_blank}. - Alternatively, run CBNG directly [from the commandline](#cbng-from-commandline) instead. - -=== "CBNG from the Command Line" - Another sometimes easier alternative that works with any IDE is to run CBNGs `bob` with the desired command (e.g. `build`, `dependencies`, `eclipse`, `idea`) in the folder of the project from the commandline. - The full path to `bob` is: - ``` - /user/pcrops/devtools/CBNG/PRO/bin/bob - ``` - - !!! info - See `bob --help` for instructions about its commands. - -## Importing a Project - -The project can be imported using the git-integrations of the IDEs directly, using the Gitlab paths below. -This should be straightforward, but you are giving up some control. -In the next subsections the manual path of getting the source-code into the IDE is outlined in the hope to point to some pitfalls that may occur and how to avoid them. - -Firstly, you should clone the desired repository to an adequate location on your hard-drive, depending on which project you want to work on: - -=== "Beta-Beat GUI" - ```bash - git clone https://gitlab.cern.ch/acc-co/lhc/lhc-app-beta-beating - ``` - -=== "Kmod GUI" - ```bash - git clone https://gitlab.cern.ch/acc-co/lhc/lhc-app-kmod - ``` - -You then simply import the project into your IDE. - -??? warning "IntelliJ Specificity" - For IntelliJ, you might have to - - 1. Create an empty `build.gradle` file if you want to trigger a gradle import dialogue where you need to choose **use local gradle distribution** and set the **gradle home** to `/user/pcrops/devtools/CBNG/PRO/bin/bob` ([as above](#gradlehome)) - 2. Go to `File -> Project Structure ... -> Modules` and set the **Dependencies storage format** to `Eclipse (.classpath)`. - This one you should check on a regular basis, as it tends to reset itself. - -To make it runnable, you will have to use CBNG to **resolve dependencies** and **build** the project first. -Depending on your IDE you should run CBNGs `eclipse` or `idea` followed by `build`. -Running `dependencies` can help. - -!!! warning - No one in the OMC-Team is a `CBNG` expert, and sometimes running these commands leads to the desired outcome (of a runnable project) or not depending on the color of the DG's clothing. - -## Running the GUI - -If everything worked fine, the Gui should now be runnable via the `void main()` function in the `main.Main.java`, which can be invoked by **right-clicking on `main.Main`** and choosing **Run** or manually setting a Java **Run configuration** in the `Run` menu. - -## Useful Links - -* [CBNG Wiki][cbng_wiki]{target=_blank} -* [Accsoft-Eclipse Downloads][accsoft_eclipse]{target=_blank} -* [Accsoft Eclipse Wiki][accsoft_eclipse_wiki]{target=_blank} - -[mounting_tn]: ../../howto/setup/shared_filesystems.md#mounting-tn-resources-on-gn-machines -[gui_releases]: releases.md - -[idea_download]: https://www.jetbrains.com/idea/download/ -[cbng_wiki]: https://wikis.cern.ch/display/DVTLS/CBNG -[cbng_eclipse]: https://wikis.cern.ch/display/DVTLS/CBNG+-+Eclipse+Integration -[cbng_idea]: https://wikis.cern.ch/display/DVTLS/CBNG+-+IntelliJ+IDEA+integration -[accsoft_eclipse]: http://eclipse.cern.ch/ -[accsoft_eclipse_wiki]: https://wikis.cern.ch/display/DVTLS/Eclipse+IDE - -*[DG]: Director General: Currently Fabiola Gianotti diff --git a/docs/guis/developing/kmod_special.md b/docs/guis/developing/kmod_special.md deleted file mode 100644 index 4431bc1c..00000000 --- a/docs/guis/developing/kmod_special.md +++ /dev/null @@ -1,14 +0,0 @@ -# Special Features of the KMod GUI Development - -## Analyzing Tasks of the AutoTrim - -Analyzing tasks are executed after the trimming task of one `KmodProcess`. -The list of analyzing tasks can hold as many tasks as needed since they are getting executed in the background while another process is trimming. -The results are displayed to the corresponding tab on the result panel. -Most of the time each analyzing task represents one python script which is called from the GUI. - -!!! todo - KMod specific Python analysing tools. - Mention to transform to Python3? - Link on how to add external programs (BBGUI). - diff --git a/docs/guis/developing/releases.md b/docs/guis/developing/releases.md deleted file mode 100644 index 2e3b5ffc..00000000 --- a/docs/guis/developing/releases.md +++ /dev/null @@ -1,4 +0,0 @@ -# Software Releases - - - diff --git a/docs/guis/kmod/analyzing.md b/docs/guis/kmod/analyzing.md new file mode 100644 index 00000000..eb371111 --- /dev/null +++ b/docs/guis/kmod/analyzing.md @@ -0,0 +1,100 @@ +# Modulation Analysis + +Any modulation's data is automatically saved in `NXCALS` and can be retrieved later for analysis. +We will briefly go over how to retrieve a previous modulation's data. +To see how to perform analysis on the data, jump to the [Analyzing Modulations](#analyzing-modulations) section. + +## Retrieving Modulations + +One can load a modulation from the `MODULATIONS` tab of the lower center part the GUI window, by clicking the big green `+` button, as shown below. + +
+
+ Loading Modulation +
MODULATIONS Panel from Which to Load
+
+
+ +Clicking this button will open the `Retrieve` window. +There, select start and end times (`From` and `To` fields) between which to search for modulations and click the `FETCH KMOD` button. + +A list of modulations will appear in the view below, showing for each the time of the modulation and the circuits that were modulated. +Select the desired modulations and click the `Extract` button. + +
+
+ Exploring and selecting modulations to extract +
Modulations Available for Extraction
+
+
+ +## Analyzing Modulations + +After performing or retrieving a modulation, the measured data will be available in the `MODULATIONS` tab of the lower center part of the GUI. +A graph shows the measured tunes for each beam, as well as the modulated currents for the time of the modulation. + +!!! note + + The following focuses on the analysis of modulations done at Interaction Points, aiming to determine values such as $\beta^{*}$ values, waist shifts, etc. + +Just above the graph are also displayed both the beam energy as well as the optics, which are automatically queried from the beam process active during the modulation. +These can be manually changed in case they are incorrect. + +
+
+ View of a performed modulation +
View of a Performed Modulation
+
+
+ +From there, click the `Launch analysis!` button. +A first window will open with some options to select. +Select either `Round beams` or `Flat beams` as relevant and enter the expected $\beta^{*}$ values in `H` and `V` planes at the IP. + +!!! warning "Units Conventions" + + It is rather unclear in the interface but the $\beta^{*}$ values are expected in `[m]`. + +
+
+ Kmod analysis settings +
Analysis Settings Selection
+
+
+ +Below, `Browse` for a location where to save the data. +The GUI handles the structure among IPs, planes etc. and just needs to be provided with a directory. + +!!! tip "Choice of Location" + + We have the convention of exporting analysis data to a `Kmod` folder in the location of the day for measurements, which is set by the `Beta-Beat` GUI. + For a given day this would be: `/user/slops/data/LHC_DATA/OP_DATA/Betabeat/YYYY-MM-DD/Kmod`. + + One should then make a subfolder for the export of the modulation, e.g. `.../Kmod/IP1_60cm`. + +Select a directory (or create one with the folder button at the top right) and click `Choose`. + +
+
+ Output directory selection +
Kmod Analysis Output Directory Selection
+
+
+ +Once back to the previous window, click `ANALYZE!` and the relevant codes will be run in the background. +As soon as the analysis is finished, the main GUI window will switch to the `ANALYSIS` tab, and display a graph of the regression fit for each modulated circuit. + +
+
+ Kmod analysis result +
Kmod Analysis Result
+
+
+ +To the right of the graph both the `Analysis Inputs` and `Results` can be explored, each in their own tab. +The exported data is already in the right format to be imported in the `Beta-Beat` GUI for better data points around the IPs in order to determine a correction. + +!!! note "Saving Data" + + There is no need to click the yellow `Save Data To File` button at the bottom right of the window as the data has already been written to disk after analysis. + This button is only useful if one wants to re-export the data in a different location. diff --git a/docs/guis/kmod/autotrim.md b/docs/guis/kmod/autotrim.md deleted file mode 100644 index 3e6d9841..00000000 --- a/docs/guis/kmod/autotrim.md +++ /dev/null @@ -1,189 +0,0 @@ -# Auto Trim - -The `AutoTrim` functionality combines all existing tasks in the Kmod GUI. -The user can choose tasks to do for each IP. -The `AutoTrim` then executes all the trimming tasks and analyzing tasks in the best order possible to optimize the process. - -The user can input parameters once to do the k-modulation and other analysis tasks on many IP's. -The results and current status of each process is displayed on the main panel. -The `AutoTrim` provides something like a pipeline of many k-modulations and their analyzing tasks. - -!!! tip "First Time AutoTrim" - - If you are in the CCC and have never used the `AutoTrim` before, follow these steps: - - 1. Open the `AutoTrimDialog` by clicking on the `AutoTim` button located on the left side of the main panel. - 2. Add the IPs you want to trim or analyze with the buttons on the left side. - 3. Input the trim parameter or load an existing trim for each IP tab. - 4. Select the analyzing options you want to execute. - 5. Input the needed values for the trim and all the optional tasks. - 6. Once everything is set up, right press the `Start` button and select the directory where to save the results (It will save the results depending on the trim time and IP. See wiki for more information). - 7. The `AutoTrim` will now check if the orbit feedback is on and the tune feedback is off. Make sure to put them in the desired state. - 8. The `ResultsView` will open and the `AutoTrim` gets started. - -## AutoTrim Panel - -### The InputPanel - -This input panel provides all the options to set every parameter for k-modulation. -On the left panel the user can choose which IP to trim or analyze. - -Depending on the parameters, the panel will show input panels for the specific IPs: each panel has a top bar with optional tasks that can be executed after the trim as well as an input field for the current energy. -The energy value is gathered live from the LHC, but can be edited. -Underneath is another tabbed pane for each task in the current process which needs some user input. - -
- -
The AutoTrim input panel.
-
- - -By pressing the start button, it will ask the user for the save directory and then starts the `AutoTrim` process. -`AutoTrim` will then create a result folder for each IP, open the `ResultsView` on the main panel and start the pipeline of processes. -The chosen save directory is the root directory. -The `AutoTrim` will then create a subdirectory for each IP where the result files are stored. - -In principle, this will perform a full IP trim for all of the selected IPs and planes. -For more details, see the [full IP trim](full_ip_trim.md) section. - -### The ResultsView - -The `ResultsView` is the main panel of an `AutoTrim` process. -It is built as a tabbed pane which holds the content of the processes for many IPs and displays information such as process status, results, etc. -The status panel and the result panel are the main components for each process. - -
- -
The ResultsView.
-
- -At the top is a `thread queue` bar which displays all the active, finished and scheduled threads. - -
- -
The thread queue of the results view.
-
- -!!! tip - By double-clicking on the IP label of the tabbed pane its possible to extract the IP panel in another frame. - It will snap back to the tabbed pane if it gets closed by the user. - -#### The Status Panel - -The status panel shows information about the current process, with the currently running task is displayed at the top. -The user can click through the list of tasks to see start/end time, input parameters, log entries, and the current status. - -There is also a panel for the input parameter of thes current task. -This has to be done in the actual task code since the view doesn't have a reference to the task. -The last panel is the logger text area for each task. -Per default, it will show the last logging entry with the corresponding time, but the user can expand the list by clicking on the drop-down button. - -
- -
The AutoTrim Status Panel.
-
- -??? info "Status Types Explained" - | Status | Description | - | :-------------------------------- | :------------------------------------------------------------------------ | - | `Starting`{: style="color:green"} | Task is creating all the needed objects or loads some data from a file.* | - | `Running`{: style="color:green"} | Main functionality of this task is currently executed. | - | `Finished`{: style="color:blue"} | Task finished without any problems. | - | `Waiting`{: style="color:blue"} | Task is waiting for some synchronization variable.* | - | `Scheduled`{: style="color:grey"}| Task is in the queue and ready to be executed. | - | `Canceled`{: style="background:yellow"} | Task got canceled by the user (Not possible still a big TODO). | - | `Crashed`{: style="color:red"} | Task crashed because an exception is fired or a critical error occurred. | - - \* Not used at the moment, might be useful later (non thread-safe functionality, etc.) - -## Loading Existing Trims from Timber - -The `AutoTrim` provides two ways to add existing trim data to the process queue: - -- Adding the selected Timber entry directly to an existing IP tab in the `AutoTrim` panel. There, one can only select the trim entries depending on the IP of the tab. -- Selecting any trim you want with the `Trim-Selection` panel, which will then add the selected trims as tabs to the `AutoTrim` panel. - -### Load a trim directly to an AutoTrim-Tab - -Start by creating your IP tab by clicking on the button on the left side: tick the `Load existing trim` checkbox and it will open the trim selection panel. - -
- -
AutoTrim: load existing trim.
-
- -Expand the date picker and choose the day when the trim was executed. -Left click on the trim you want to load and press the `Select trim` button. - -
- -
AutoTrim: load existing trim, date picker.
-
- -The loaded trim date is then displayed on the trim panel and all the other input fields for the Full IP Trim are disabled, as input is not needed. -To discard the loaded trim and proceed with the Full IP Trim instead, untick the `Load existing trim` checkbox. - -### The Trim-Selection Panel - -The `Trim-Selection` panel will add the selected trim data as tabs to the `AutoTrim` panel. -It also provides some basic options to apply to every tab, such as setting analyzing the orbit to default. -This might be the best option if you want to reanalyze many trims with the same model. - -Open this panel by pressing the `Load Trims` button located on the bottom center of the `AutoTrim` panel. -Filter the Timber entries by IP and date, then select the trim entries in the `Search Results` panel and press the green `Add selected trim` button. -The trims are now selected and displayed in the `Selected Trims` panel. -By clicking on `confirm` the tabs will be added to the `AutoTrim` panel. - -You can now set some basic options for the selected trims in the `Options` pane. -These values are automatically set as preset values for the loaded trim tabs. - -
- -
The AutoTrim Trim Selection Wizard.
-
- -## Simulation Mode - -The kmod application provides two different modes to execute all its functionality: - -- The `Measurement mode`, which is the standard mode and should be used in the control center to gather real data from the LHC. -- The `Simulation mode`, which only simulates these live measurements. - -If you start a normal trim task in `Simulation mode` the `AutoTrim` will load the last trim data from timber. -This data is then displayed like a normal trim during a live measurement. -The energy value is not automatically loaded from Timber, and uses a preset value of 6500.0 GeV. -The `AutoTrim` won't check if the Orbit and Tune feedback is on or off. - -## Analyzing a Trim - -### Input Tab - -This input tab is separated into two sides, one for each existing beam in the LHC. -One side holds the input fields for all needed parameters in order to run the beta star analysis script. -It is also possible to provide only one estimated beta star value as input by ticking the `Use round optics` option. -This checkbox will disable the input for the beta star in the vertical plane and uses the horizontal input for both. - -Parameters: - -- **B* X [m]**: Estimated horizontal beta-star (X) of measurements as a double. -- **B* Y [m]**: Estimated vertical beta-star (Y) of measurements as a double. -- **Waist Shift [m]**: Estimated waist-shift as double value. - -
- -
The Analyzing Configuration.
-
- -### Results Panel -This analyzing task will display the results on the Analyzing Trim tab. -It will list the $\beta^{*}$ values and waist shift on the horizontal and vertical plane for each beam. -The saved plots of the script are displayed on the right side for each beam. -By clicking on the image it will expand and show the full-size plot in a new frame. - -
- -
The Analyzing Trim Results.
-
- - -*[IP]: Interaction Point \ No newline at end of file diff --git a/docs/guis/kmod/full_ip_trim.md b/docs/guis/kmod/full_ip_trim.md deleted file mode 100644 index 067bd1d8..00000000 --- a/docs/guis/kmod/full_ip_trim.md +++ /dev/null @@ -1,38 +0,0 @@ -# Performing a Full IP Trim - -The `Full IP Trim` module of the GUI executes the K-Modulation on a selected Interaction Point with its predefined quadrupoles. -Each bigger experiment like ATLAS (IP1), ALICE (IP2), CMS (IP5) and LHCb (IP8) is referred to by its corresponding number in the LHC complex. - -
- -
Choose an IP.
-
- -By using this module, the quadrupole identifier and several other parameters are predefined to the corresponding Interaction Points. -After the modulation is done, the trim data is present on the database and can be visualized and analyzed using the measurement view dialog. -In order to start the K-Modulation on a magnet, the power converter has to be accessed using the CERN provided LSA Java API. - -The available parameters are the following: - -- **Delta I**: Change of magnet strength in Amperes. Default value is `6.0A`. -- **Frequency**: How fast the magnet strength is changed. Default value is `0.013`. -- **Cycles**: How many times the modulation is done. Default value is `3`. - -
- -
Select trim parameter.
-
- -## Result Panel - -While the Full IP Trim is executed the current and the tune values are displayed live in the result panel. -After the modulation is done, it will show the whole trim results in the corresponding `ResultPanel` of this trimming task. -The trim results are stored in the `save directory` of the current IP. - -
- -
Trim result panel.
-
- -*[IP]: Interaction Point -*[LSA]: LHC Software Architecture \ No newline at end of file diff --git a/docs/guis/kmod/gui.md b/docs/guis/kmod/gui.md index bc0c07a4..7acdc367 100644 --- a/docs/guis/kmod/gui.md +++ b/docs/guis/kmod/gui.md @@ -1,14 +1,41 @@ # The Kmod GUI -The Kmod GUI provides functionality to perform [K-Modulation][kmod_method] either as a full IP trim or through an individual magnet circuit, in the form of a graphical interface. +The Kmod GUI provides functionality to perform [K-Modulation][kmod_method] in the LHC. It also has the ability to extract and analyze data from previous trims. -This site will guide you through the GUI's layout and functionality. -For starters, check out [the basics of running the GUI][gui_basics]. +This section will guide you through the GUI's layout and functionality. +We also provide a procedure page for [performing K-modulation in the CCC][kmod_measurements]. -Alternatively, take a look at the [procedure for performing K-modulation in the CCC][kmod_measurements]. +The GUI is a lightweight Python application built on `acc-widgets`. +It can be run either from the `CCM` or the command line: -[gui_basics]: ../about.md +=== "From the CCM" + + Have a [working `CCM`][gui_basics] running as `lhcop`, then navigate to `LHC Control` -> `LHC Beam Measurements` -> `K-Modulation`. + +=== "From the Command Line" + + The app is published with `acc-py`, and can be run with: + + ```bash + /acc/local/share/python/acc-py/apps/acc-py-cli/pro/bin/acc-py app run pykmodlhc + ``` + +After opening, the GUI should look like this: + +
+
+ Kmod GUI landing page +
Kmod GUI Landing Page
+
+
+ +The following pages are available: + +- [Performing a Modulation](modulating.md) for how to select circuits and settings and running modulations. +- [Analyzing Data](analyzing.md) for how to retrieve previous modulations from `NXCALS`, analyze any modulation data and export results. + +[gui_basics]: ../about.md#running-in-the-ccc-in-2025 [kmod_method]: ../../measurements/physics/kmod.md [kmod_measurements]: ../../measurements/procedures/kmod.md diff --git a/docs/guis/kmod/individual_modulation.md b/docs/guis/kmod/individual_modulation.md deleted file mode 100644 index 2b89f582..00000000 --- a/docs/guis/kmod/individual_modulation.md +++ /dev/null @@ -1,54 +0,0 @@ -# Performing Individual Magnet Modulation - -The Kmod GUI also allows for a modulation of a given magnet circuit. -This is used for example for the quadrupoles in the matching section of the experimental insertions, or in the RF insertion, where one circuits corresponds to one quadrupole. -The Kmodulation data can then be used to extract the beta-functions at instruments (e.g. BSRT) between the quadrupoles. - -As of 2018, the instruments for which the measured beta-function has been used for calibration are the Wirescanner (`BWS.5`) and the undulator (`MU.B5`) or dipole D3 (`MBRS.5`) for the BSRT. -All these instruments are located between `Q5R` and `Q5L`. -Additionally, in beam 2, between `MQM.7L4.B2` and `MQY.6L4.B2` the `BGV` demonstrator is located (`B7L4.B2`). - -## Circuit Selection - -The first step is to select a magnet circuit to use. -You can do so under `Parameter Selection` -> `Select Quadrupole`. - -The circuit corresponding to the quadrupole to be modulated has to be selected on the right hand side of the panel and added via the `add quadrupole` button to the left hand side. -As example for the naming convention, the circuit `RQ5/.R4B2/K1` corresponds to the `MQY.5R4.B2` in the LHC sequence file. -Under `Trim Function`, select `Sine Function` before continuing. - -
- -
Select circuits.
-
- -## Trim Start - -The trim current, frequency, and number of cycles should be entered on the right hand side of the window and need to be set via the `apply settings` button. -Normal values for trim I in IR4 are 2A at injection for the `Q5` and 12A at 6.5 TeV for the `Q5`. -Values for other magnets can be found in the elogbook in the shifts logs of the `28/04/2018` and `07/10/2016`. - -Data acquisition is started with the `Start Acquiring` button, following by starting the trim with the `Start trim` button. -After the trim is finished, acquisition of data needs to be stopped using the `Stop Acquiring` button. - -!!! todo - Include screenshot of trim start - -!!! warning - The start and end time should be noted down in the elogbook for later data extraction, as no automatic extraction like in the IP modulation case exists. - -## Trim Extraction - -After acquisition during a trim, data can then be extracted by selecting the circuit in the `Select Quadrupole` panel under `Parameter selection` and pushing the `extract previous trim` button. -The trim start and end times as well as the beam energy need to be entered. -In the following panel, the trim data can then be saved via the `Save magnet measurement` button. - -!!! todo - Include screenshot of trim extraction - -The analysis of the extracted Kmod data is described in the [next section](trim_analysis.md). - - -*[BSRT]: Beam Synchrotron Radiatin Telescope -*[BGV]: Beam Gas Vertex detector (for beam size measurement) -*[LHC]: Large Hadron Collider \ No newline at end of file diff --git a/docs/guis/kmod/load_model.md b/docs/guis/kmod/load_model.md deleted file mode 100644 index 2684db6f..00000000 --- a/docs/guis/kmod/load_model.md +++ /dev/null @@ -1,25 +0,0 @@ -# Loading a model from into Kmod GUI - -You can load the model created from the [Beta-Beat GUI](../betabeat/gui.md) or [Multiturn GUI](../multiturn/gui.md) for each beam by pressing the `load model` button. -Select the desired model directory in the pop-up dialog and confirm by pressing the `open` button. -If everything worked fine and the specified folder contains the needed `twiss_elements` file, the GUI will display the model's name. - -You can choose another model directory by pressing on the `update model` button which appears if a model is already selected. -The model data is used for preset values in the GUI and the orbit-offset script needs the model for its calculations. - -
- -
Loading a Model
-
- - -??? tip "Setting the Beta-Beat.src directory" - - To change the setting of the used `Beta-Beat.src` directory, navigate to `File` -> `Set Beta-Beat dir` and select the location where the `Beta-Beat.src` directory to be used is located. - The Kmod GUI will automatically take the proper Python scripts from this directory. - This is automatically reset to the standard directory `/afs/cern.ch/eng/sl/lintrack/Beta-Beat.src/`. - - The GUI will check if the `Beta-Beat.src` directory contains the `ProgramVersions.properties` file, which is needed for calling an external python script. - You can change the standard directory by creating a `user.properties` file in the project folder. - The kmod GUI will automatically read this file and change the Beta-Beat.src directory to this new value. - This file must contain `BetaBeatDir=[newBBdir]` (replace the placeholder correctly). \ No newline at end of file diff --git a/docs/guis/kmod/modulating.md b/docs/guis/kmod/modulating.md new file mode 100644 index 00000000..10a22ef7 --- /dev/null +++ b/docs/guis/kmod/modulating.md @@ -0,0 +1,59 @@ +# Performing a Modulation + +Performing a modulation is rather simple. +This page will showcase the interface and workflow, but more details and checks that should be followed are available in the [Kmod Measurement Procedure][kmod_measurements]. + +## Selecting Circuits + +In the top left of the GUI window, all locations with circuits available for modulation are displayed, in a circular manner similar to their position in the machine. + +To start, select a given `IP` in that view by clicking on it. +It will display with a green background. +The available circuits at this location will appear in the list view below. + +In the `Filters` section, select the side(s) of the location (`Left`, `Right` or both) and the affected beams (`Beam 1`, `Beam 2` or both) for the modulation. +In the list below select the circuits to be modulated. + +
+
+ Selecting circuits for modulation +
Selecting Q1 Circuits Left and Right of IP1 for Both Beams
+
+
+ +## Choosing Settings + +Once the desired circuits are selected, move on to the `Settings` section just below and choose: + +- The modulation waveform (`Sinusoidal` or `Rectangular`). +- The number of modulation periods. +- The duration of a single modulation period. +- The modulation amplitude, either as `Current` or `Q` (tune) deviation. + +!!! tip "OMC Defaults" + + Default values we usually use are: `2 period` of `90s` each, `Sinusoidal`, and with a`Q deviation` of `0.009` (for injection tunes). + +!!! warning + + Be careful with the `Q deviation` setting, which should be based on the current working point. + One tune will rise by the selected amount (at the height of the modulation), while the other will drop by the same amount during modulation. + + This could inadvertently lead to a Closest Tune Approach (CTA) or resonance crossing if the setting was chosen wrongly. + See the [Kmod Measurement Procedure][kmod_measurements] for more relevant checks. + +Once the settings are chosen, click the green `Add Selection to Playlist` button at the bottom left of the panel. +The modulation plan will show up in the upper center part of the GUI window. + +## Modulating + +Repeat the previous steps for all circuits you want to modulate. +Once all the desired modulations are added to the playlist, click the green `RUN` button just to its right. +It is not recommended to run different modulations simultaneously. + +The modulation is performed automatically and as it progresses the selected circuits' currents as well as the measured tunes for each beam are displayed in the lower center part of the GUI. + +When the modulation is finished it will show up in the `MODULATIONS` tab of the lower center part of the GUI, ready to be analyzed. +The finished modulation is automatically logged to the `LHC-OMC` logbook. + +[kmod_measurements]: ../../measurements/procedures/kmod.md diff --git a/docs/guis/kmod/trim_analysis.md b/docs/guis/kmod/trim_analysis.md deleted file mode 100644 index 9cb65298..00000000 --- a/docs/guis/kmod/trim_analysis.md +++ /dev/null @@ -1,71 +0,0 @@ -# Analyzing Trim Data - -The Kmod GUI provides functionality to load previously recorded trim data and perform a k-modulation analysis of the results. -The steps are described below. - -## Extract Trim Panel - -If you want to extract data from a previous trim, press on the `Extract Previous Trim` button. -Input the right energy value for this trim in the top right input field and press the `Select trim` or the `Last Trim` button. -Just ignore the rest (TODO: why???) - -The `Select trim` button will open the trim selection panel and the `Last trim` button will just load the last trim entry from Timber. - -
- -
The "Select Trim" Panel.
-
- -If you chose `Select trim`, then select the desired IP then navigate othe desired date and confirm with pressing on the green `Select trim` button. -You can switch between different IPs and dates by using the `combo` boxes. - -
- -
Select Trim by Date.
-
- -## Measurement View Dialog - -The selected/loaded trim will then be displayed in the `Measurement View Dialog`, from which you can analyze the trim data with different options. - -
- -
Measurement View.
-
- -To get beta-star values, press the `Analyze Trim button`, then in the next dialog select the directory in which to save the trim data and the results. -You will need to input the *estimated* beta star in the horizontal and vertical planes as well as the waist shift for each beam. - -The values are loaded from the model files. -If no model is loaded, you have to input those values. -The (old) python code of this script can be found [here][kmod_python2]{target=_blank}. -The results are stored in the file named `beta_star.out`. - -
- -
Estimated beta-star input.
-
- - -!!! tip "Special Case: Individual Magnet Modulation" - - If individual circuits/magnets have been modulated, the analysis cannot (yet) be triggered from the GUI. - Instead, the `gui2kmod.py` script has to be called from the command line. - - For the input arguments, the working directory (`--working_directory`) should point to a folder where the extracted data of both modulated quadrupoles is present and the `--circuit` option should be selected, followed by the two circuit names. - The initial guesses should be set to a large beta function and waist (e.g. `--BetastarAndWaist 200,-100`) to speed up the convergence. - - An *example* script call would look as follow: - ```bash - gui2kmod.py --circuit rq5.l4b1,rq5.r4b1 --beam b1 --BetastarAndWaist 200,-100 --instruments MONITOR,RBEND,INSTRUMENT,TKICKER --working_directory /path/to/data - ``` - - Results are then saved in the working directory in a folder with the magnet names. - -!!! todo - I think Hector took care of Kmod analysis for `omc3` so maybe the above tip section should point to the newest codes? - - -*[IP]: Interaction Point - -[kmod_python2]: https://github.com/pylhc/Beta-Beat.src/blob/master/kmod/gui2beta/gui2kmod.py \ No newline at end of file diff --git a/docs/guis/multiturn/excitation.md b/docs/guis/multiturn/excitation.md new file mode 100644 index 00000000..85296bc0 --- /dev/null +++ b/docs/guis/multiturn/excitation.md @@ -0,0 +1,261 @@ +# Performing Beam Excitation + + + + +Once [all the checks](safety.md) have been performed, one can start measurements. +In the Multiturn GUI one can perform beam excitation with either the AC Dipole or the ADT, and both procedures are very similar. +Select either the `ACDipole` or `ADTACDipole` tab at the top of the GUI, depending on the desired excitation device. + +## Common Settings + +The following settings are set identically for both the AC Dipole and the ADT, in the left-hand side of the GUI: + +### Kick Groups + +Before exciting the beam, one should select or create a kick group. +A kick group collects measurements under a single name, gathers them in the logbook and makes it easier in the future to simultaneously load related kicks at once. + +??? tip "Kickgroups in JSON" + Each kick group also has a corresponding `.json` file in `/user/slops/data/LHC_DATA/OP_DATA/Betabeat/KickGroups/MULTITURN_ACQ_GROUPS`, in which the paths to the acquired turn-by-turn data and their individual `.json` files containing information about the excitation parameter is stored. + See also the [PyLHC tool for KickGroups][pylhc_kickgroups]{target=_blank}. + +Creating a new group is done by clicking the ++"Select Active group"++ button in the top left corner of the GUI, which will open the following dialog: + +
+
+ Select Active Group Dialog +
Select Active Group Dialog
+
+
+ +Typically one wants to create a new kick group. +To do so: + +- Click the ++"Create new Group"++ button at the bottom in the centre, which will open the following dialog, with a default naming scheme: + +
+
+ Create New Group Dialog +
Create New Group Dialog
+
+
+ +- Adapt the text entry under `Group Name` to reflect the measurements to be done in this group. +A good naming practice is to lead with the date and beam number as suggested, e.g. `YYYY-MM-DD_BEAM1_Measurement_description`. +Make sure to press `Enter` after typing the name. +Optionally add a description in the field below, and click the ++"Create"++ button. +Once created the new group will appear at the bottom of the list of available groups. + +- Select the new group and click the ++"Activate selected"++. +This should then create a new entry in the `LHC-OMC` logbook with information about the group, and all acquisitions done in this group will be logged to that entry automatically. + +### Tunes Setup + +The fields in this section expect the values of the horizontal and vertical tunes for the selected beam: + +
+
+ Tunes setup section +
Tunes Setup Section
+
+
+ +They should be the natural tunes used in the machine during measurements. +Either enter the values manually or, to enter the current tunes click the ++"Acquire QH"++ and ++"Acquire QV"++ buttons which will update the value to the current one measured with the BBQ. +These values can be manually refined if necessary. + +!!! warning "Unexpected Tunes" + This acquisition is also a sanity check for the state of the machine. + It can happen that the machine tunes are different from what is expected, e.g. because it was forgotten to revert them to the desired working point. + Such a mistake would easily be detected with a press of this button, which can prevent unexpected beam dumps. + __Use this feature!__ + +### Concentrator Settings + +These settings refer to the excitation to be performed. +The excitation device needs to know which bunches to excite and how long the excitation should last (in terms of turns). + +
+
+ Concentrator settings section +
Concentrator Settings Section
+
+
+ +#### Bunches + +- To select the bunches, click the ++"Select ..."++ button under the `Bunches` section, which opens the following dialog: + +
+
+ Bunch Selection Panel +
Bunch Selection Panel, Highlighting the Filled Slots in Green
+
+
+ +- Choose ++"Select Bunches with Beam"++ to select all bunches present in the machine, or individually select the bunches by clicking on their slots. +This determines which bunches to record the BPM turn-by-turn data for. +It is also possible to manually enter the (comma-separated) bunches to excite. +Once done, click ++"OK"++ in the top right to validate the selection. + +#### Turns + +- Set the number of turns to maintain the excitation for in the `Turns` field below. +These correspond to the excitation plateau length, and does not include ramp-up and ramp-down times. + +!!! tip "Excitation Duration" + For AC-Dipole measurements, this setting is typically __6600 turns__ of flat-top excitation, while for ADT measurements it is typically __40,000 turns__. + Do not set these values higher than these for the respective measurements, as this can lead to the AC Dipole being damaged or the BPM buffers overflowing causing data to be lost or overwritten. + +## AC Dipole Excitation + +Selecting the `ACDipole` tab will change the right-hand side of the GUI window to display the following: + +
+
+ AC Dipole Tab +
AC Dipole Tab
+
+
+ +The two following settings need to be set before starting measurements. + +### Tune Deltas + +The excitation device drives the beam motion to a different frequency than the natural tune, which is determined by its offset from the natural tune, called the "tune delta". +Set these values in the `start` fields of the `Tune deltas` section, for both the horizontal and vertical planes (`Horizontal settings` and `Vertical settings` sections). + +!!! tip "Typical Default Values" + + We often perform optics measurements using the $Q_x = 0.28$, $Q_y = 0.31$ tunes, and the following tune deltas: + + - The horizontal tune delta is typically set to $\Delta Q_x = -0.01$. + - The vertical tune delta is typically set to $\Delta Q_y = 0.012$. + + These values result in typical excitation tunes of $Q_x^{driven} = 0.27$ and $Q_y^{driven} = 0.322$. + Depending on the specific measurements, other tunes and tune deltas may be required. + Always consult with the experts on shift if unsure about the values to use. + + !!! warning "Diagonal Kicks" + Kicking completely "diagonal", i.e. with the same absolute delta in both planes, can lead to [additional resonance excitation and loss of DA](https://accelconf.web.cern.ch/ipac2016/papers/thpmr044.pdf){target=_blank}. + One should therefore always use slightly different tune deltas in the two planes. + +The resulting driven tunes will be automatically computed and displayed under `Start Excitation tune`. +Make sure to double check these values, as a wrong setting can lead to a direct beam dump. + +### Kick Amplitudes + +Kick amplitudes, together with the tune deltas, contribute to determining the excitation strength. +Generally larger excitations lead to better signal-to-noise ratio and allow measuring more faint beam modes and RDTs, but come with the risk of beam losses and therefore signal degradation, or even beam dump. + +Set the Kick Amplitudes by changing the value in `Excitation amplitude (%)` field, for both the horizontal and vertical planes (`Horizontal settings` and `Vertical settings` sections). +Always ask the experts on shift if unsure about the kick amplitudes to set. + +??? info "Kick Amplitudes at Injection" + + As the beams have a relatively low rigidity at injection, small kick amplitudes lead to large peak to peak oscillations and we generally use small amplitudes. + A reasonable starting point is anywhere between __1%__ and __3%__, then going up slowly in steps of __2%__, until beam losses during kicks stop being reasonable. + +??? info "Kick Amplitudes in the Ramp" + + Performing kicks in the ramp requires careful planning. + As the beam energy increases, so does the beam rigidity and hence larger kick amplitudes can be used. + Nevertheless, careful monitoring of losses during acquisitions and adjusting the kick amplitudes accordingly is crucial. + + Typically, we prepare a table various kicks to be performed, indicating the time in the ramp, corresponding energy, phase knob setting, ATS factor, kick amplitude and optics file. + These should follow the various match points for the given energy ramp program, and the kick strengths should scale approximately linearly with the beam energy, starting from safe strength at injection. + + Most of these information can be found by opening a `CCM` then navigating to `LHC Control` -> `LHC Beam Control` -> `Settings` -> `Generation`. + Once the app has opened, select the `Edit types` tab then the `Beam Process Type` sub-tab. + Search & select the relevant beam process using the `Filter` field on the left, then click the big black ++"Show/Hide optic Table"++. + This will create a popup window displaying the match points during the ramp (if the BP is for a ramp) with their time, energy and optics file. + +
+
+ Beam Process Optics Table from LSA Generation App +
Beam Process Optics Table from LSA Generation App
+
+
+ + An __example table__ is shown below, generated for the proton-proton `RAMP-SQUEEZE-6.8TeV-ATS-2m-2025` beam process as in the picture above. + It is okay to copy-paste a previous table and update it. + + | Time | Energy (TeV) | Phase Knob | ATS | Kick Amplitude (%) | Optics | + |:-----:|:------------:|:----------:|:---:|:------------------:|:----------------------------------------:| + | 30s | 0.46 | 100% | 1 | 3 | R2025aRP_A11mC11mA10mL10m_PhaseKnob100On | + | 240s | 1.0 | 50% | 1 | 7 | R2025aRP_A11mC11mA10mL10m_PhaseKnob50On | + | 405s | 1.9 | 0% | 1 | 13 | R2025aRP_A11mC11mA10mL10m | + | 580s | 2.9 | 0% | 1 | 19 | R2025aRP_A700cmmC700cmA10mL700cm | + | 720s | 3.7 | 0% | 1 | 24 | R2025aRP_A370cmmC370cmA10mL370cm | + | 860s | 4.5 | 0% | 1 | 30 | R2025aRP_A200cmmC200cmA10mL200cm_1 | + | 1010s | 5.5 | 0% | 0.8 | 36 | R2025aRP_A200cmmC200cmA10mL200cm_0-8 | + | 1160s | 6.2 | 0% | 0.6 | 41 | R2025aRP_A200cmmC200cmA10mL200cm_0-6 | + | 1247s | 6.7 | 0% | 0.5 | 45 | R2025aRP_A200cmmC200cmA10mL200cm_0-5 | + + The values in this table are a good starting point, but it is important to monitor the losses and reduce the kick amplitudes accordingly. + +??? info "Kick Amplitudes at Top Energy" + + At top energy the increased beam rigidity allows us larger kick amplitudes. + A reasonable starting point is __5%__, then going up in steps of __5%__ until beam losses during kicks stop being reasonable. + Remember that it is very time-consuming to get back to this state when losing the beam at top energy, so monitor beam losses carefully and be reasonable with the kick increases. + +### Exciting the Beam + +Trigger an acquisition by clicking the yellow ++"Acquire with ACDipole excitation"++ button at the bottom left of the GUI. +The AC Dipole will arm, then kick the beam. +Make sure to have a `BLM Display` application open and to monitor the losses during that time. + +Afterwards, a new tab will open at the very top of the GUI to display the BPM measurements, which can be checked: a menu list lets one select any BPM from each beam, and view the recorded bunch centroid turn-by-turn data through the acquisition. + +??? info "Losses on Kicks" + Sometimes when increasing the kick amplitude, one will notice large losses. + In this case it is recommended to kick a couple times at this amplitude or just below to see if the losses reduce or are consistent. + + Should they reduce the beam might have just needed cleaning and one can increase the kick amplitude further. + Otherwise, stop increasing unless a beam dump is affordable. + Refer to the experts on shift if unsure about the losses, and whether the kick amplitude can be increased further. + +!!! danger "Do not Kick Both Beams Simultaneously" + + Firstly, kicking both beams simultaneously might exceed the losses threshold and lead to a beam dump. + + Secondly, triggering an acquisition will always turn off the tune feedback, radial loop, and orbit feedback for that beam. + Afterward, the system restores these to the exact state they were in before the acquisition. + This means if one kicks Beam 1 and quickly after Beam 2, Beam 1’s feedback loops will be left off! + This is because they were off when the system triggered the Beam 2 measurement, and the system restores the global state. + + As a rule of thumb, wait a few seconds in between kicking the two beams. + +## ADT AC-Dipole Excitation + +Selecting the `ADTACDipole` tab will change the right-hand side of the GUI window to display the following: + +
+
+ ADT AC-Dipole Tab +
ADT AC-Dipole Tab
+
+
+ +Currently ADT AC-dipole measurements are almost identical to the AC Dipole measurements, but due to the limitations of the magnet, cannot (yet) reach the same kick-strengths as the dedicated AC-dipole. +This deficit can be overcome in improving the signal-to-noise ratio through increased measurement lengths, i.e. up to __40,000 turns__. +Refer to the [AC Dipole Excitation](#ac-dipole-excitation) section above for the settings and steps. + +Trigger an acquisition by clicking the yellow ++"Acquire with ADT/AC excitation"++ button at the bottom left of the GUI. + +*[AC Dipole]: Alternating Current Dipole +*[ADT]: LHC Transverse Damper +*[BBQ]: Base Band Tune, a system used to continuously measure the beam's tunes +*[RDT]: Resonance Driving Term +*[BP]: Beam Process +*[beam dump]: Whenever the beams are sent out of the machine by the protection systems. It is equivalent to losing 100% of the beam at once. + +[pylhc_kickgroups]: https://pylhc.github.io/PyLHC/entrypoints/kickgroups.html diff --git a/docs/guis/multiturn/gui.md b/docs/guis/multiturn/gui.md index 9d75fa87..c061655e 100644 --- a/docs/guis/multiturn/gui.md +++ b/docs/guis/multiturn/gui.md @@ -1 +1,40 @@ -# The Multiturn GUI \ No newline at end of file +# The Multiturn GUI + +The Multiturn GUI provides functionality to set up and perform beam excitation with the AC Dipole or the ADT. +Excitations feature automatic saving of turn-by-turn BPM data. +This section will guide you through the GUI's layout and functionality. + +The GUI is a Java application and is typically run from the `CCM`: + +=== "From the CCM" + Have a [working `CCM`][gui_basics] running as `lhcop`, then navigate to `LHC Control` -> `LHC Beam Measurements` -> `Multiturn`. + +After opening, the GUI should look like this: + +
+
+ Multiturn GUI landing page +
Multiturn GUI Landing Page
+
+
+ +After opening, select at the top of the GUI either the `Acquisition BEAM1` or `Acquisition BEAM2` tab, depending on the beam you plan on measuring. + +!!! warning + It is recommended to not kick both beams from the same GUI, as it can lead to crashes and unexpected behavior. + Open a separate GUI for each beam. + +!!! tip "Closing Tabs" + To avoid kicking the wrong beam accidentally, one can drag and drop the tab for the unused beam out of the GUI. + +The following pages are available: + +- [Safety Checks](safety.md) for how important checks to be performed for measurements. +- [Beam Excitation](excitation.md) for how to excite the beam with either the AC Dipole or the ADT. +- [Scheduled Excitations](scheduler.md) for how to schedule and run AC-Dipole measurements with a set of predefined kick amplitudes. + +*[AC Dipole]: Alternating Current Dipole +*[ADT]: LHC Transverse Damper +*[BPM]: Beam Position Monitor + +[gui_basics]: ../about.md#running-in-the-ccc-in-2025 diff --git a/docs/guis/multiturn/safety.md b/docs/guis/multiturn/safety.md new file mode 100644 index 00000000..4e1951a8 --- /dev/null +++ b/docs/guis/multiturn/safety.md @@ -0,0 +1,110 @@ +# Safety Checks + +After selecting which beam to excite and acquire data for, the next step is to prepare the correct excitation settings and check for various state flags. +A first check to perform is that specific systems of the machine themselves are in the correct state to allow for beam excitation. +Some general checks are [available on this page](../../measurements/procedures/general_checks.md), and below are the specific checks to perform in the Multiturn GUI. + +!!! info "Good Red, Bad Red" + As one will see below, an indicator colored in red is not always a bad thing in the Multiturn GUI, due to conventions. + Check thoroughly the meaning of each indicator (also called flag) from the instructions below and make sure they are in a correct state. + +??? tip "Quick Recap" + + Please read the following sections carefully regarding the meaning of various flags. + Here is a quick recap of flags to check and the expected state for measurements: + + | Flag | Expected State | Notes | + |---------------------|:--------------------------------------------------------------------------------------:|-------------------------------------------------------------------------------------| + | **Beam Presence** | **Green** | Beam must be present. | + | **Setup Beam** | **Green** | Beam must be in Setup mode. | + | **ATLAS BCM** | **Red** | Should be masked (red). Ask EIC to contact ATLAS control room to mask BCM. | + | **Orbit Feedback** | **Red** | Orbit feedback should be off during measurements. Turned on/off automatically | + | **Radial Loop** | **Red** | Radial loop feedback should be off during measurements. Turned on/off automatically | + | **Tune Feedbacks** | **Red** | All tune feedbacks should be off during measurements. Turned off/on automatically. | + | **Chroma Feedback** | **Green** | Displays acceptable (or not) state of last measured chromaticity value. | + | **Landau Feedback** | **Red** or **green** | MOs usually off, unless you want to include their effect in the measurements. | + +## Flag Status + +At the top left of the GUI, a small section titled `Flag Status` displays simple main flags, as shown below: + +
+
+ Flag Status Section +
Flag Status Section
+
+ +Their meanings are as follows: + +- `Beam Presence`: indicates whether beam is circulating in the LHC, for the beam corresponding to the selected tab. This will be green if beam is present, red otherwise. __Always make sure it is green__. +- `Setup Beam`: indicates whether the beam status set by the operator is `Setup`. It will be green if the beam is in `Setup` mode, red otherwise. __Always make sure it is green__. +- `ATLAS BCM`: indicates whether the ATLAS BCM has been masked from the interlock. It is green if the ATLAS BCM is active, red otherwise. __Always make sure it is red__, as we measure in special beam conditions and want it to be masked. + +!!! info "Masking the BCM" + The ATLAS BCM can only be masked by ATLAS operators, from their control room. + Ask the current EIC to call the ATLAS control room and ask to mask their BCM before starting measurements. + +## Measurement Environment + +The `Measurement Environment` section just below provides a quick overview of the current machine feedback and damping states, as can be seen below: + +
+
+ Measurement Environment Section +
Measurement Environment Section
+
+ +### Feedback State + +- `OrbitOFF` (red) indicates that the orbit feedback is currently off and will appear green and change to `OrbitON` when it is active. +- `RadialLoopOFF` (red) shows the radial loop feedback is off; when on, it will appear green as `RadialLoopON`. + +??? info "What are those?" + The orbit feedback acts on correctors to keep the measured closed orbit to the reference one. + The radial loop feedback acts on the RF cavities to keep the beam's bunched in the center of their respective RF buckets. + +Both these feedback systems should be off during measurements, but on between kicks. +They will automatically be turned off when you start a measurement, and will be turned back on as soon as the acquisition is complete. + +### Tune Feedback State + +These buttons represent the state of the tune feedback for each beam and plane: + +- `B1 H`: Beam 1, Horizontal +- `B1 V`: Beam 1, Vertical +- `B2 H`: Beam 2, Horizontal +- `B2 V`: Beam 2, Vertical + +Red indicates the feedback is off, green indicates it is on. + +??? info "What are those?" + The tune feedback acts on dedicated quadrupole circuits in the arcs to keep the beam's tunes to the desired values. + +These feedback should be off during measurements, but on between kicks. +They will automatically be turned off when you start a measurement, and will be turned back on as soon as the acquisition is complete. + +### Chroma State & Landau Damping + +Similarly to the above, these flags display the state of the chromaticity for each beam and plane (for chroma state), or simply each beam (for landau damping). + + +- `Chroma State`: indicates the status of the last measured chromaticity value; displays as green if acceptable for optics measurements and red otherwise. __Always make sure it is green__. +- `Landau Damping`: refers to the powering of the MO circuits and is red when the MOs are off, green when they are powered. __It should usually be red__, but __can be green__ should you choose to include the effects of the MOs in your measurements. + +Talk to the experts on shift if you are unsure about these settings. + +??? info "What are those?" + The chromaticity state is a simple check on the beam's chromaticities vs acceptable values. + The Landau damping flags display the powering state of the octupole circuits in the arcs, which are used to damp the beam's coherent oscillations. + +## Kicker Keys + +In order to allow for beam excitation with the AC Dipole or the ADT, the physical key must be inserted in the nearby server room, and turned to correct setting. +Let the current EIC know which device you plan on using, and ask them to go insert the key in the server room. + +When all these checks are satisfied, proceed to the [next step of the measurement setup](excitation.md). + +*[ATLAS BCM]: ATLAS Beam Condition Monitor +*[EIC]: Engineer in Charge, operators of the LHC +*[AC Dipole]: Alternating Current Dipole +*[ADT]: LHC Transverse Damper diff --git a/docs/guis/multiturn/scheduler.md b/docs/guis/multiturn/scheduler.md new file mode 100644 index 00000000..3c848ce3 --- /dev/null +++ b/docs/guis/multiturn/scheduler.md @@ -0,0 +1,72 @@ +# AC Dipole Scheduler + +It is possible to automate the process of running measurements with different kick amplitudes using the AC Dipole Scheduler. +To access the scheduler, select the `ACDipoleScheduled` tab at the top of the GUI. +The right-hand side of the GUI window will then display the following: + +
+
+ AC-Dipole Scheduler Tab +
AC-Dipole Scheduler Tab
+
+
+ +## Creating a Kick Schedule + +A kick schedule can be created either manually or by loading a prewritten template schedule from file. +It is also possible to edit the template that is already present in the GUI by changing the `H Amplitude (%)` and `V Amplitude (%)` values in the table. +It is not possible to edit the `Index` column. +To reset this template table, select the button ++"Reload from Template"++ below the table. + +### Manual Creation + +To create a kick schedule from scratch, select the ++"Create Table"++ button below the table. +This will open the following dialog: + +
+
+ Create Kick Schedule Dialog +
Create Kick Schedule Dialog
+
+
+ +Set the start and end amplitudes as well as the step size in their respective fields. +Note that the start and end are inclusive. +Click the ++"Create Kick Table"++ when done. + +This will bring you back to the previous view, with the `H Amplitude (%)` and `V Amplitude (%)` columns filled with the inferred kick steps. +The `Index` column is automatically filled with row numbers, don't mind it. + +For instance the scenario from the screenshot above will create a table with 4 rows - `3%`, `5%`, `7%`, and `9%` for both the horizontal and vertical kick amplitudes. + +### Prewritten Schedules + +To load a prewritten kick schedule, select the ++"Import .csv"++ button below the table. +This will open a file dialog to navigate and select the `.csv` file containing the kick schedule. + +There exists a small repository of prewritten kick schedules to be imported, which can be found in the `/user/slops/data/LHC_DATA/OP_DATA/Betabeat/MULTITURN_KICK_SCHEDULES/` directory + +
+
+ Prewritten Kick Schedules +
Prewritten Kick Schedules
+
+
+ +## Running a Kick Schedule + +Once a kick schedule is ready, it is necessary to setup the horizontal and vertical kick tune deltas just below. +Refer to the [common settings](excitation.md#common-settings) as well as the [AC-Dipole](excitation.md#ac-dipole-excitation) section on the previous page to set these. +Please also make sure the [safety checks](safety.md) have been performed. + +Click the yellow ++"Acquire with ACDipoleScheduled excitation"++ button at the bottom left of the GUI to start running the schedule. +This will an acquisition with the first row's settings, and will automatically move on to the next row once the AC Dipole is ready to kick again. + +!!! info "Cancelling a Schedule" + To cancel the acquisition while running a kick schedule, press the ++"Stop"++ button. + Note that if the scheduler has moved on to the next row and is already waiting for the AC Dipole to be ready when ++"Stop"++ is pressed, the schedule will stop after the next kick is complete and not before. + There is no way to cancel the next kick once it is waiting for the AC Dipole to be ready. + +It is also possible to run the kick schedule from a specific row, by selecting the given row in the table and then clicking the ++"Start from Selection"++ button. + +*[AC Dipole]: Alternating Current Dipole diff --git a/docs/guis/rdt_feeddown/correction.md b/docs/guis/rdt_feeddown/correction.md new file mode 100644 index 00000000..fb89e595 --- /dev/null +++ b/docs/guis/rdt_feeddown/correction.md @@ -0,0 +1,52 @@ +# The Correction Tab of the RDTfeeddown GUI + +This part of the GUI allows you to quantify the RDT correction predicted from a specific corrector and can then interactively correct the RDT feeddown using this prediction. + +## The Tabs Explained + +- [Graph](#__tabbed_1_1){.rdtfeeddown_tab-link} tab: Displays the RDT feeddown data and the correction prediction graphically. + +- [Response](#__tabbed_1_2){.rdtfeeddown_tab-link} tab (_optional_): Allows you to quantify the RDT shift predicted from a specific corrector. + +=== "Graph Tab" + +
+
+ RDTfeeddown Correction Graph Tab +
RDTfeeddown Correction Graph Tab
+
+
+ + **Main Features:** + + - Load Files: Load the corrector response files generated by the [Response](#__tabbed_1_2){.rdtfeeddown_tab-link} tab. + + - ``Analysis File to Match``: Select the output file from the [Input](input.md){.rdtfeeddown_tab-link} tab that you want to match with the corrector response. + + - Plot: Plot the RDT data and the correction prediction. This will trigger a list of corrector knob names to be shown beneath the **Knob Manager** section. These will default to a value of 0. Values can be changed by entering a number and pressing Enter or clicking Update Knobs and Re-Plot. + +=== "Response Tab" + +
+
+ RDTfeeddown Correction Response Tab +
RDTfeeddown Correction Response Tab
+
+
+ + Similar to the [Input](input.md){.rdtfeeddown_tab-link} tab, this tab allows you to load measurement folders and reference data in the format outputted by the [OMC analysis tools](omc_homepage) to quantify the RDT response for a constant corrector strength between 2 different crossing angles. + + !!! warning "Response Behaviour Assumption Warning" + This assumes a linear response! + + **Main Features:** + + - ``Reference Folder``: Select the reference measurement folder containing the measurement data with the corrector strength applied and the reference crossing angle. + + - ``Response Folder``: Select the measurement folder containing the data with the same corrector strength as the reference measurement applied, and a different crossing angle to the reference measurement + + - ``LHCB1 same as LHCB2 mode``: If this option is selected, the response will be calculated assuming that the corrector name is the same for both LHC beams. This is useful when the corrector name is not beam-specific. + + - Find Response: This button will calculate the response of the RDT to the crossing angle with the specified corrector strength applied. The output will be in the format that can be used in the [Graph](#__tabbed_1_1){.rdtfeeddown_tab-link} tab. + + [omc_homepage]: https://pylhc.github.io/packages/omc3/about.html \ No newline at end of file diff --git a/docs/guis/rdt_feeddown/gui.md b/docs/guis/rdt_feeddown/gui.md new file mode 100644 index 00000000..9721e780 --- /dev/null +++ b/docs/guis/rdt_feeddown/gui.md @@ -0,0 +1,28 @@ +# The RDTfeeddown GUI + +
+
+ RDTfeeddown Gui Landing Page +
RDTfeeddown Gui Landing Page
+
+
+ +To launch and use the RDTfeeddown GUI, use the following command: + +```bash +python -m pip install omc3 +``` + +Help Icon or Help Icon : shows some quick tips for using the GUI. + +Error Log Icon : shows the error log for debugging. + +!!! tip "Navigating Plots Tip" + To pan in any of the plots, use Ctrl+LeftClick and drag the mouse. + +The following pages are available detailing the tabs and how to use them: + +- [Input](input.md){.rdtfeeddown_tab-link} tab: for how to input files to produce an analysable format. +- [Validation](validation.md){.rdtfeeddown_tab-link} tab: for how to use that analysable format to plot the RDT response as a function of crossing angle amongst another analyses. +- [Correction](correction.md){.rdtfeeddown_tab-link} tab: for how to quantify the response of RDT for a constant corrector powering, between two crossing angles (i.e. assuming linearity) and use that to match to the analysable format measurement. + diff --git a/docs/guis/rdt_feeddown/input.md b/docs/guis/rdt_feeddown/input.md new file mode 100644 index 00000000..ac850349 --- /dev/null +++ b/docs/guis/rdt_feeddown/input.md @@ -0,0 +1,71 @@ +# Input Tab of the RDTfeeddown GUI + +
+
+ RDTfeeddown Gui Landing Page +
RDTfeeddown Gui Landing Page
+
+
+ +The [Input](input.md){.rdtfeeddown_tab-link} tab (i.e. the landing page) of the GUI provides an interface to input data for the RDTfeeddown analysis. + +You can load measurement folders, reference data, and crossing angle knob data directly through the GUI. + +When the analysis is run, a file is outputted, containing the RDT values, along with each measurement's corresponding knob (crossing angle) values, in a format suitable for further analysis or validation. + +## Default Input/Output Directories + +To set up default input and output directories, create a configuration file named `rdtfeeddown_default.json` (in the current working directory where you will launch the GUI from) with the following structure: + +```json +{ + "default_input_path": "[insert input path here]", + "default_output_path": "[insert output path here]" +} +``` + +Otherwise, these can be set in this tab of the GUI. + +## Providing Input to the RDTfeeddown GUI + +You can provide input to the RDTfeeddown GUI using the following methods: + +1. ``File Input``: Load input files by clicking the relevant button in the GUI and selecting the appropriate file. +2. ``Manual Input``: Manually enter file paths in the provided fields within the GUI (except for measurement folders). + +!!! warning "Input Format Warning" + All folder inputs should be in the form used for the results directory of measurements in the [OMC analysis tools](omc_homepage). + +## Input Fields Explained + +- ``Model``: Requires any model folder generated by the [OMC tools](omc_homepage). Its only purpose is to provide the list of BPMs to look at. +- ``Reference Measurement Folder``: The measurement folder that contains the reference data. +- ``Measurement Folders``: Folders containing the data you want to compare with the reference measurement. +- ``Xing Knob Name``: The name of the crossing angle knob to use for the analysis in the exact form required by the `Timber` database. + +## Simulation Mode + +``Simulation Mode``: allows you to use simulation data when no crossing angle knob data is available from `Timber`. In this case, the GUI will not attempt to load any crossing angle knob data from `Timber` and will only use the provided properties file. + +!!! warning "Xing Knob Name Consistency" + It will use the knob name given with no checks, and this must be consistent across all measurements since plotting will fail if knob names are inconsistent. + +## Properties File + +The ``Properties File`` is a CSV file that contains the crossing angles used in the model. It should have the following structure: + +
+ MATCH, KNOB +
+
+Where MATCH is the name of the measurement folder, and KNOB is the corresponding value of the relevant crossing angle knob. + +## Running the Analysis + +Run Analysis: Runs the analysis on the provided data (i.e. collating crossing angle knob values and the RDT values), and displays a list of the output files in the GUI on the [Validation](validation.md){.rdtfeeddown_tab-link} tab. + +## Other Features + +- Validate Knob: Not required unless you want to check that the crossing angle knob name exists in the `Timber` database for the measurement. + + [omc_homepage]: https://pylhc.github.io/packages/omc3/about.html \ No newline at end of file diff --git a/docs/guis/rdt_feeddown/validation.md b/docs/guis/rdt_feeddown/validation.md new file mode 100644 index 00000000..5822ad43 --- /dev/null +++ b/docs/guis/rdt_feeddown/validation.md @@ -0,0 +1,65 @@ +# Validation Tab of the RDTfeeddown GUI + +
+
+ RDTfeeddown Validation Tab +
RDTfeeddown Validation Tab
+
+
+ +The [Validation](validation.md){.rdtfeeddown_tab-link} tab of the GUI provides a way to load data in the format created by the [Input](input.md){.rdtfeeddown_tab-link} tab, and display it to validate it. + +## Input Fields Explained + +- Add Files: Add the generated files from the [Input](input.md){.rdtfeeddown_tab-link} tab of the GUI containing the RDT data you want to plot (this simply adds the filenames to a list for easy access). +- Load Selected Files for Plotting: Load the selected files to display their data in the plotting tabs (this then checks that the files are compatible to be plotted together). The loaded files will be displayed in the box below the button. + +## Plotting Tabs Explained + +!!! warning + Ignore the error message below for both the [RDT](#__tabbed_1_2){.rdtfeeddown_tab-link} and [RDT shift](#__tabbed_1_3){.rdtfeeddown_tab-link} tab, if you only have RDT data from one beam loaded (in this example it would only be LHCB1 data) - this should not affect the plotting. + + ```text + Error accessing LHCB2 RDT data: 'NoneType' object is not subscriptable + ``` + + +=== "BPM" + +
+
+ RDTfeeddown Validation BPM Tab +
RDTfeeddown Validation BPM Tab
+
+
+ + This tab displays the RDT as a function of crossing angle for a BPM of your choice. + + !!! tip "Searching for BPMs Tip" + You can search for a BPM by typing its name in the search box and pressing the Search BPM button. This just checks if the BPM exists in the list of BPMs. + + Either pressing Enter or Plot BPM will plot the RDT at that BPM as a function of crossing angle. + +=== "RDT" + +
+
+ RDTfeeddown Validation RDT Tab +
RDTfeeddown Validation RDT Tab
+
+
+ + This tab displays the RDT as a function of position *s* for all crossing angles when Plot RDT is pressed. + +=== "RDT shift" + +
+
+ RDTfeeddown Validation RDT Shift Tab +
RDTfeeddown Validation RDT Shift Tab
+
+
+ + This tab displays the average RDT shift as a function of crossing angle when Plot RDT shifts is pressed. + + diff --git a/docs/guis/segment_by_segment/gui.md b/docs/guis/segment_by_segment/gui.md new file mode 100644 index 00000000..5ab88973 --- /dev/null +++ b/docs/guis/segment_by_segment/gui.md @@ -0,0 +1 @@ +# The Segment-by-Segment GUI diff --git a/docs/guis/usage/guidelines.md b/docs/guis/usage/guidelines.md new file mode 100644 index 00000000..f91a16c7 --- /dev/null +++ b/docs/guis/usage/guidelines.md @@ -0,0 +1,71 @@ +# GUI development Guidelines + +## General Guidelines + +Usually the testing of GUI codes is quite relaxed and there is no review process. +This is for three reasons: + +1. Automated testing a GUI is more complicated than testing individual modules. +1. The GUIs are just "sugar" on top of the actual analysis codes, which if everything fails, can usually still be run via the command line. +1. "Testing" is assumed to be done "during development", meaning the coder should run at least the normal stages of their GUI once before releasing it. + +### Model-View-Controller Architecture + +While not strictly enforced, our GUIs follow the [Model-View-Controller][mvc_wiki]{target="_blank"} architecture, +as it is a very useful and therefore also very common GUI pattern. +[A better explanation can be found here][mvc_geeks]{target="_blank"}, but this section summarizes a few key points relevant to our usecase. + +The main philosophy of the MVC architecture is to separate the actual GUI elments, the _View_, from the underlying data, stored in the _Model_, +and let the _Controller_ handle the communication between the two and with the user. + +In our code this is not always possible or strictly enforced and sometimes it is even hard to distinguish whether something should be part of the +_Controller_ or the _View_, but it is a good idea to at least think about if it can be done for the specific part you are working on. + +Main advantages of the MVC architecture are: + +- The _Model_ components are usually easier to test. +- It automatically reduces complexity and coupling in the GUI code, by its built-in separation of functionality and modularization. +- This makes it easier to reutilize code between different parts of the GUI (e.g. re-use of the same data) or even between different GUIs (e.g use the same plotting components). +- It is easier to find the part in the code that you want to change (i.e. do you want to make a cosmetic change? - _View_; or a workflow change? - _Controller_; or a change in how to store data? - _Model_). + +## Java Guidelines + +While the `java` development is not as strictly regulated as the `python` repositories, +this code has been used for many years and probably will be continued to be used for many years to come. + +**Try to keep it clean!** + +Because GUI testing is hard and because we have easy access to old versions via [CAS][cas_cern]{target="_blank" .cern_internal}, +there is no tests suite and no review process for the `java` development and changes can be simply pushed to the `master` branch. + +Some "best practices" have been established through the years: + +- Follow the [MVC architecture](#model-view-controller-architecture). +- **Do not re-invent the wheel**, reuse or at least orient yourself to existing code whenever possible. +- If you see horribly written code (yes, it exists /s), do not hesitate to fix it. +- Use `camelCase` for variable names and `PascalCase` for class names. +- Put all external paths as constants into the `src/java/cern/lhc/betabeating/external/ExternalPathsCollection.java`. +- As in `python`, use constants (`static final String`) for strings. +- If you are introducing new "properties", which can be set via the `bbgui_user.properties` file, use the prefix `PROPERTY_` (and `static final String`) to make them easily searchable in the code. +- Follow the note about [adding new settings](../betabeat/settings.md#adding-new-settings). +- Do not use `Strings` for file paths, for now we mostly use `File` objects (but see also the [Issue #239][issue_239]). + +!!! tip "Factory Pattern" + One pattern that you will find in different places of `java` code is the [factory design-pattern][factory_pattern_wiki]{target="_blank"}. + While useful in some scenarios, I personally (jdilly) find it too verbose and annoying to implement, + in the past there were even [scripts to automatically write the factory-code][internal_program_writer]{target="_blank"} because it needs so many lines of repeating code. + + In particular, this pattern was used for the [creation of the `ExternalProgram` classes][factory_pattern_doc] to allow the setting of + multiple attributes before even creating the class, without having to write multiple constructors + (which in turn is a limitation of the `java` language, as you cannot set "default" values as in `python`). + The newer implementations of the `ExternalPrograms` follow a different approach: + One constructor with all **required** parameters, which means _"this programm can run"_ and the optional + attibutes can be set later on via the setter-methods. + +[cas_cern]: https://cas.cern.ch +[issue_239]: https://gitlab.cern.ch/acc-co/lhc/lhc-app-beta-beating/-/issues/239 +[mvc_wiki]: https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller +[mvc_geeks]: https://www.geeksforgeeks.org/mvc-framework-introduction/ +[factory_pattern_wiki]: https://en.wikipedia.org/wiki/Factory_method_pattern +[internal_program_writer]: https://gitlab.cern.ch/acc-co/lhc/lhc-app-beta-beating/-/blob/BetaBeatSrc/src/java/cern/lhc/betabeating/external/helper/InternalProgramWriter.java +[factory_pattern_doc]: https://gitlab.cern.ch/acc-co/lhc/lhc-app-beta-beating/-/blob/BetaBeatSrc/src/java/cern/lhc/betabeating/external/documentation diff --git a/docs/guis/usage/ide_install.md b/docs/guis/usage/ide_install.md new file mode 100644 index 00000000..fe574596 --- /dev/null +++ b/docs/guis/usage/ide_install.md @@ -0,0 +1,153 @@ +# IDE Setup + +There are multiple IDEs that have been used in the past to delevop the GUI. +While editing the code itself can be done with any IDE, running the application comes with some pitfalls, +due to the usage of [Common Build Next Generation (CBNG)][cbng_wiki]{target=_blank .cern_login} to resolve dependencies. +CBNG is only available in the Technical Network and one needs to either run the development tools from somewhere in the TN (e.g. from the `dev-server`) or [mount the required paths via `sshfs`][mounting_tn]. + +In principle running the CBNG commands can be done through the command-line, +but to have full debugging capabilities it is recommended to set it up in the IDE directly. + +The easiest IDE to setup is the modified [Accsoft Eclipse](#eclipse) versions, as for [IntelliJ IDEA](#intellij-idea) and [VSCode](#vscode) additional configuration is required. +We recommend nonetheless the usage of VSCode, as this is the one most widely used in our team and hence we have the most experience with it. +To be able to use the same IDE for different languages is also of value. + +## Setting Up the IDE + +### VSCode + +To be able to use [VSCode][vscode_webpage]{target=_blank} as an IDE for Java, the [Extension pack for Java][vscode_java]{target=_blank} needs to be installed. + +Additionally, the following settings need to be set in `Extensions -> Language Support for Java -> Gradle`: + +- *Java > Import > Gradle > Wrapper: Enabled*:
+ Needs to be **un-ticked**. +- *Java > Import > Gradle: Version*:
+ Needs to be **empty**. +- *Java > Import > Gradle: Home*:
+ Set to the absolute path to the CBNG directory, e.g. `/user/pcrops/devtools/CBNG/PRO/` or [wherever you have mounted][mounting_tn] the `/user` folder (see screenshot). +- *Java > Import > Gradle > Java: Home*:
+ Set to where the Java SDK is installed, e.g. `/usr/lib/jvm/java-11-openjdk/` on your current system. This is very important as otherwise the wrong Java version might be used! +- *Java > Import > Gradle > User: Home*:
+ Set a path to where you want your local gradle wrapper to put the cached data, e.g. `/tmp/bob_username/`. + Beware that this setting might also be steered via the `GRADLE_USER_HOME` environment variable. Make sure that you do not have conflicting values there, as it is not clear which one will have priority. + +
+
+ VSCode settings for CBNG. +
Example VSCode settings for CBNG.
+
+
+ +If everything worked correctly, the CBNG specific tasks and dependencies should be available from within the IDE in the *Gradle* (Elephant) view in the sidebar. + +
+
+ VSCode Gradle Tasks. +
VSCode Gradle Tasks.
+
+
+ +??? note "Lauch Configuration" + To create a launch configuration for the main class, add the following to the `launch.json` file: + ```json + { + "type": "java", + "name": "Main", + "request": "launch", + "mainClass": "cern.lhc.betabeating.main.Main", + "projectName": "betabeating-app" + } + ``` + +!!! warning "Troubleshooting" + If you are having problems with the setup, check the [CBNG Wiki][cbng_wiki]{target=_blank} for further details. + Often it is enough to remove the cached dirs, typically `/tmp/bob_username` (see `GRADLE_USER_HOME` above) and `/tmp/bob_cache_username` (check `BOB_USER_CACHE`) and then restart VSCode (`Ctrl + Shift + P` -> `Reload Window`). + +### Eclipse + +A more extensive guide can be found in the [CBNG Wiki for Eclipse integration][cbng_eclipse]{target=_blank}. + +In short, download your preferred version from their [download page][accsoft_eclipse]{target=_blank} and install. +With this version, `CBNG` comes automatically installed and can be used by simply dragging the desired project into the CBNG window. + +### IntelliJ IDEA + +A more extensive guide can be found in the [CBNG Wiki for IDEA integration][cbng_idea]{target=_blank}. + +In short, download your preferred version from their [download page][idea_download]{target=_blank} and install. +`CBNG` needs to be setup in IDEA manually, by setting the Gradle home path in: + +```text +File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle +``` + +to the specified location `/user/pcrops/devtools/CBNG/PRO/` or [wherever you have mounted][mounting_tn] the `/user` folder + +??? warning "IntelliJ Specificity" + After importing a project (see below), you might have to: + + 1. Create an empty `build.gradle` file if you want to trigger a gradle import dialogue where you need to choose **use local gradle distribution** and set the **gradle home** to `/user/pcrops/devtools/CBNG/PRO/bin/bob` (as above). + 1. Go to `File -> Project Structure ... -> Modules` and set the **Dependencies storage format** to `Eclipse (.classpath)`. + This one you should check on a regular basis, as it tends to reset itself. + +### CBNG from the Command Line + +Another sometimes easier alternative that works with any IDE is to run CBNGs `bob` with the desired command (e.g. `build`, `dependencies`, `eclipse`) in the folder of the project from the commandline. +The full path to `bob` is: + +```text +/user/pcrops/devtools/CBNG/PRO/bin/bob +``` + +!!! info + See `bob --help` for instructions about its commands. + +!!! warning "Environment Variables" + CBNG needs to be run with the same environment variables as the IDE, e.g. `JAVA_HOME`, `BOB_USER_CACHE` and `GRADLE_USER_HOME` (see [VSCode](#vscode)). + You can for example export them in your `~/.bashrc` file, or in the terminal where you run CBNGs `bob` commands. + + ```bash + export BOB_USER_CACHE=/tmp/bob_cache_username + export GRADLE_USER_HOME=/tmp/bob_username + export JAVA_HOME=/usr/lib/jvm/java-11-openjdk/ + ``` + +## Importing a Project + +The project can be imported using the git-integrations of the IDEs (Eclipse and IntelliJ) directly, using the Gitlab paths below. +This should be straightforward, but you are giving up some control. + +It is recommended to import a project manually, follwing the steps below: +Firstly, you should clone the desired repository to an adequate location on your hard-drive, depending on which project you want to work on: + +=== "Beta-Beat GUI" + ```bash + git clone https://gitlab.cern.ch/acc-co/lhc/lhc-app-beta-beating + ``` + +You then simply import/open the project into your IDE. + +To make it runnable, you will have to use CBNG to **resolve dependencies** and **build** the project first. +Depending on your IDE, this might be run automatically (VSCode) or you should run CBNGs `eclipse` or `idea` (in case of these IDEs) followed by `build` (all IDEs). +Running `clean` and/or`dependencies` can also help. + +!!! warning + No one in the OMC-Team is a `CBNG` expert, and sometimes running these commands leads to the desired outcome (of a runnable project) or not depending on the color of the DG's clothing. + +## Useful Links + +- [CBNG Wiki][cbng_wiki]{target=_blank} +- [Accsoft-Eclipse Downloads][accsoft_eclipse]{target=_blank} + +[mounting_tn]: ../../resources/shared_filesystems.md#mounting-tn-resources-on-gpn-and-other-machines +[idea_download]: https://www.jetbrains.com/idea/download/ +[accsoft_eclipse]: http://eclipse.cern.ch/ +[cbng_eclipse]: https://confluence.cern.ch/display/DVTLS/CBNG+-+Eclipse+Integration +[cbng_idea]: https://confluence.cern.ch/display/DVTLS/CBNG+-+IntelliJ+IDEA+integration +[cbng_wiki]: https://confluence.cern.ch/display/DVTLS/CBNG +[vscode_java]: https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack +[vscode_webpage]: https://code.visualstudio.com/ + +*[DG]: Director General +*[TN]: Technical Network diff --git a/docs/guis/usage/releases.md b/docs/guis/usage/releases.md new file mode 100644 index 00000000..690e98b5 --- /dev/null +++ b/docs/guis/usage/releases.md @@ -0,0 +1,105 @@ +# Releasing the Beta-Beating GUI + +!!! warning "GUI Releases" + This page describes the process of releasing a new version of the [Beta-Beating GUI](../betabeat/gui.md), + as this is the main Java GUI we are responsible for. + The python GUIs are released following the standard [python release process](../../packages/development/howto_release.md). + The release of other Java GUIs should be similar to this guide, but please contact the respective maintainer of the GUI for further details. + +## Normal Release + +!!! tip "Preparation" + - Add new features to the [changelog][bbgui_changelog]{target=_blank .cern_login}:
+ To track changes and easily identify breaking changes, please add them to the [CHANGELOG.md][bbgui_changelog]{target=_blank .cern_login}. + Preferrably, this should be done already before merging the changes into the master branch, but should at least ensured to be **up-to-date during release**. + - Update version in [product.xml][bbgui_product_xml]{target=_blank .cern_login}:
+ The version number needs to be updated in the [product.xml][bbgui_product_xml]{target=_blank .cern_login} file. + **If an already used version number/identifier is used, the release procedure will fail.** + - Have a clean repository and no uncommitted changes:
+ The release process runs in the current folder of your local machine and will fail if there are any uncommitted changes in the repository. + **Make sure your repository is synced and up-to-date.** + +!!! success "How to run" + To run the task for a **normal release**, start CBNG's `release` from the GUI (e.g. in VSCode in `Gradle > Gradle Projects > betabeating-app > Tasks > cbng > release`) or run + + ```bash + bob release + ``` + + from commandline. + +This task will build the project, run tests (if they existed, see admonition below) and automatically upload the `.jnlp` file to the +[BE deployment servers][deployment_url] at: + + http://bewww.cern.ch/ap/deployments/applications/cern/lhc/lhc-app-beta-beating-omc3/ + +On this server, all previous versions can be found, and the latest version is automatically linked within the `PRO` folder, +which is used to start the GUI from the CCM in the CCC. +Older versions can be run directly via [jws using the links to the `.jnlp` file][jws_programs]. +An entry on the [CAS][cas_cern]{target=_blank .cern_internal} will be created for the new release. +The release is also [automatically tagged][bbgui_tags]{target=_blank .cern_login} with the prefix `release-` and the version number in the [product.xml][bbgui_product_xml]{target=_blank .cern_login} file. + +!!! warning "Breaking Things" + In contrast to our `python` backend development, there is no real CI and testing for the GUIs. + This means, that you **need to make sure** manually, that everything works as expected and no functionality is broken, before release. + In case of major bugs occuring online, you can always revert to using a previous version from the [CAS][cas_cern]{target=_blank .cern_internal} (search for `omc3` or `beta-beating`). + +## Dev-Release + +!!! success "How to run" + To run the task for a **dev release**, start CBNG's `devrelease` from the GUI (e.g. in VSCode in `Gradle > Gradle Projects > betabeating-app > Tasks > cbng > devrelease`) or run + + ```bash + bob devrelease + ``` + + from commandline. + +This release procedure will upload the `.jnlp` file to the [BE deployment servers][deployment_dev_url] at: + + http://bewww.cern.ch/ap/deployments-dev/applications/cern/lhc/lhc-app-beta-beating-omc3/ + +(note the `deployments-dev` distinction). +Older versions can be run directly via [jws using the links to the `.jnlp` file][jws_programs]. +An entry on the [CAS][cas_cern]{target=_blank .cern_internal} will be created for the new release, yet it will be only available for 30 days. +After that time you need to find the `.jnlp` file manually from the [deployment servers][deployment_url]{target=_blank}. + +There is no special preparations required for this release type and tests are not automatically run. +The version from the [product.xml][bbgui_product_xml] will be used, but if the same version has been released already, **the files on the [deployment servers][deployment_url] will be overwritten**. + + + +## Creating a JAR + +Creating a `.jar` needs to be done via CBNG as well, so that the correct dependencies are included and the main class is set. +To achieve this, a new task has been implemented in the [`build.gradle`][bbgui_build_gradle], which automatically creates a `lhc-app-beta-beating-omc3-X.X.X-all.jar` file in the `build/libs` folder. + +!!! success "How to run" + To run the task to **create a JAR**, start CBNG's `omcJar` from the GUI (e.g. in VSCode in `Gradle > Gradle Projects > betabeating-app > Tasks > other > omcJar`) or run + + ```bash + bob omcJar + ``` + + from commandline. + +??? info "Pitfalls creating a JAR" + Creating a runnable `.jar` file is not a trivial task and there had been a lot of trial-and-error to get it right. + For some reason, a lot of files need to be **excluded** from the `.jar` file, as otherwise it will not run. + If you need to create a new method to create the `.jar`, check the [build.gradle][bbgui_build_gradle] for reference. + +[bbgui_build_gradle]: https://gitlab.cern.ch/acc-co/lhc/lhc-app-beta-beating/-/blob/master/build.gradle +[bbgui_product_xml]: https://gitlab.cern.ch/acc-co/lhc/lhc-app-beta-beating/-/blob/master/product.xml +[bbgui_changelog]: https://gitlab.cern.ch/acc-co/lhc/lhc-app-beta-beating/-/blob/master/CHANGELOG.md +[deployment_url]: http://bewww.cern.ch/ap/deployments/applications/cern/lhc/lhc-app-beta-beating-omc3/ +[deployment_dev_url]: http://bewww.cern.ch/ap/deployments-dev/applications/cern/lhc/lhc-app-beta-beating-omc3/ +[bbgui_tags]: https://gitlab.cern.ch/acc-co/lhc/lhc-app-beta-beating/-/tags +[cas_cern]: https://cas.cern.ch +[jws_programs]: ../../resources/links.md#jws-programs + +*[CCC]: CERN Control Center +*[CCM]: Common Console Manager +*[CBNG]: Common Build Next Generation +*[GUI]: Graphical User Interface +*[CAS]: Controls Artifact Service +*[jws]: Java Web Start diff --git a/docs/howto/setup/guis.md b/docs/guis/usage/remote.md similarity index 93% rename from docs/howto/setup/guis.md rename to docs/guis/usage/remote.md index 4a70a525..17441c03 100644 --- a/docs/howto/setup/guis.md +++ b/docs/guis/usage/remote.md @@ -1,7 +1,5 @@ -# GUI's - -How to's related to the setup and running of the Gui's +# Running Outside of the TN ## Running GUIs Locally @@ -34,15 +32,19 @@ Once logged in with your CERN credentials (Add `CERN.CH\` in front of your usern which opens a putty-terminal connected to `lxplus` and starts a `X-Server` in the background.
- +
+ Putty and Xserver on cernts
Putty and XServer on cernts
+
Executing any graphical software from this terminal will ask for connection authorization, which you need to approve.
- +
+ Approval prompt for a connection to XServer
Approval prompt for a connection to XServer
+
This way you can run any graphical application smoothly. @@ -54,7 +56,7 @@ If your internet connection fails, you should still be able to resume your curre 1. Open `X-Win32 18 Configuration`. 2. `Manual...` → `More...` → `command`. 3. Target: `"C:\Program Files (x86)\PuTTY_CERN\putty.exe" -ssh -X machine_at_cern.cern.ch`. - + Fill out the other fields to your liking. You can even create a shortcut on the screen, from the right-click menu on the newly created connection. @@ -85,5 +87,6 @@ If your internet connection fails, you should still be able to resume your curre *[CD]: Continuous Delivery *[lxplus]: Linux Public Login User Service +[sshuttle]: https://sshuttle.readthedocs.io/en/stable/ [kmod_gui]: ../../guis/kmod/gui.md [bb_gui]: ../../guis/betabeat/gui.md diff --git a/docs/howto/about.md b/docs/howto/about.md deleted file mode 100644 index 053c8164..00000000 --- a/docs/howto/about.md +++ /dev/null @@ -1,3 +0,0 @@ -# How To's - -In this section non-measurement related How to's can be found, that will help you to setup your machine, make teleworking easier and in general try to help you, so that you do not have to find solutions all by yourself. diff --git a/docs/logbook/AD/2023_ad.md b/docs/logbook/AD/2023_ad.md index 33ede33f..1f64b6ec 100644 --- a/docs/logbook/AD/2023_ad.md +++ b/docs/logbook/AD/2023_ad.md @@ -4,4 +4,4 @@ |:----------------:|:--------:|:------:|:----:|:--------:|:---------------------------------:|:-------------------------------------------------:| ---8<-- "docs/logbook/footer_shifts" \ No newline at end of file +--8<-- "docs/logbook/footer_shifts" diff --git a/docs/logbook/AD/2024_ad.md b/docs/logbook/AD/2024_ad.md index c42dd4df..e751beda 100644 --- a/docs/logbook/AD/2024_ad.md +++ b/docs/logbook/AD/2024_ad.md @@ -6,11 +6,9 @@ Tooltips: *[SHIFT PURPOSE TEXT]: Text inside the tooltip --> - | Start Date | End Date | Shifts | Type | Contact | Shift Purpose | Logbook Link | |:----------------:|:--------:|:------:|:----:|:--------:|:---------------------------------:|:-------------------------------------------------:| - ---8<-- "docs/logbook/footer_shifts" \ No newline at end of file +--8<-- "docs/logbook/footer_shifts" diff --git a/docs/logbook/LEIR/2023_leir.md b/docs/logbook/LEIR/2023_leir.md index a59a3436..6d3a1659 100644 --- a/docs/logbook/LEIR/2023_leir.md +++ b/docs/logbook/LEIR/2023_leir.md @@ -5,5 +5,4 @@ |:----------------:|:--------:|:------:|:----:|:--------:|:---------------------------------:|:-------------------------------------------------:| - ---8<-- "docs/logbook/footer_shifts" \ No newline at end of file +--8<-- "docs/logbook/footer_shifts" diff --git a/docs/logbook/LEIR/2024_leir.md b/docs/logbook/LEIR/2024_leir.md index cb618cdc..ec655a92 100644 --- a/docs/logbook/LEIR/2024_leir.md +++ b/docs/logbook/LEIR/2024_leir.md @@ -7,10 +7,9 @@ Tooltips: *[SHIFT PURPOSE TEXT]: Text inside the tooltip --> - | Start Date | End Date | Shifts | Type | Contact | Shift Purpose | Logbook Link | |:----------------:|:--------:|:------:|:----:|:--------:|:---------------------------------:|:-------------------------------------------------:| ---8<-- "docs/logbook/footer_shifts" \ No newline at end of file +--8<-- "docs/logbook/footer_shifts" diff --git a/docs/logbook/LHC/2022_lhc.md b/docs/logbook/LHC/2022_lhc.md index 43072116..d9a58fe9 100644 --- a/docs/logbook/LHC/2022_lhc.md +++ b/docs/logbook/LHC/2022_lhc.md @@ -5,7 +5,9 @@ Some entries (underlined) offer a tooltip when hovered, with a quick description The tables below can be sorted by clicking next to the column headers. !!! tip "Results Visualization" + Various results graphs and the scripts to make them are available in `lintrack`: + ``` /afs/cern.ch/eng/sl/lintrack/LHC_commissioning2022/ ``` @@ -87,5 +89,4 @@ The tables below can be sorted by clicking next to the column headers. *[Rematched IR7 Optics]: Measured optics for new IR7 configuration. No corrections needed. *[2023 LHC Configuration]: Measured 2023 configuration in at several points in ramp, flattop and squeeze. Measured before / after IR8 xing rotation. Compared optics in squeeze to earlier measurements in the year. - --8<-- "docs/logbook/footer_shifts" diff --git a/docs/logbook/PS/2023_ps.md b/docs/logbook/PS/2023_ps.md index 1ce475c0..1c06739a 100644 --- a/docs/logbook/PS/2023_ps.md +++ b/docs/logbook/PS/2023_ps.md @@ -63,5 +63,4 @@ | 2023-11-03 10:00 | 2023-11-03 15:00 | 0.5W | MD | Ewen | Preparation and test of GammaTR jump on flat cycle + ACD kicks through knobs | [Start](logbook://2023-11-03,2621,3856883) | | 2023-11-03 10:30 | 2023-11-03 20:00 | 1W | MD | Vittorio | Q and Q' change with F8L and PFW on 2GeV bare machine plus measurements with AC Dipole excitation | [Start](logbook://2023-11-03,2621,3856881) | - --8<-- "docs/logbook/footer_shifts" diff --git a/docs/logbook/PS/2024_ps.md b/docs/logbook/PS/2024_ps.md index afb80a19..6458cc85 100644 --- a/docs/logbook/PS/2024_ps.md +++ b/docs/logbook/PS/2024_ps.md @@ -74,5 +74,4 @@ - --8<-- "docs/logbook/footer_shifts" diff --git a/docs/logbook/PSB/2023_psb.md b/docs/logbook/PSB/2023_psb.md index 5ee68463..32310220 100644 --- a/docs/logbook/PSB/2023_psb.md +++ b/docs/logbook/PSB/2023_psb.md @@ -22,5 +22,4 @@ | 2023-11-03 16:30 | 2023-11-03 19:00 | 0.5W | MD | Ewen | RDT measurement with ACD+chrip on 160MeV near 3Qy, cont. | [Start](logbook://2023-11-03,2621,3857003) | - --8<-- "docs/logbook/footer_shifts" diff --git a/docs/logbook/PSB/2024_psb.md b/docs/logbook/PSB/2024_psb.md index b838cc7a..d1cf330d 100644 --- a/docs/logbook/PSB/2024_psb.md +++ b/docs/logbook/PSB/2024_psb.md @@ -1,5 +1,4 @@ - # Timeline of PSB optics measurements in 2024 --8<-- "docs/logbook/footer_shifts" diff --git a/docs/logbook/SPS/2023_sps.md b/docs/logbook/SPS/2023_sps.md index 666d67bc..02dcf4ea 100644 --- a/docs/logbook/SPS/2023_sps.md +++ b/docs/logbook/SPS/2023_sps.md @@ -9,7 +9,6 @@ | Start Date | End Date | Shifts | Type | Contact | Shift Purpose | Logbook Link | |:----------------:|:--------:|:------:|:----:|:--------:|:---------------------------------:|:-------------------------------------------------:| - ---8<-- "docs/logbook/footer_shifts" \ No newline at end of file +--8<-- "docs/logbook/footer_shifts" diff --git a/docs/logbook/footer_shifts b/docs/logbook/footer_shifts index 9b5ee48e..c0670c6b 100644 --- a/docs/logbook/footer_shifts +++ b/docs/logbook/footer_shifts @@ -1 +1 @@ -*[Shifts]: Manual entry of number of shifts (1 shift = 8h) worked during this measurement as well as an identifier when these shifts happened. W - Weekdays (Day), WN - Weekdays (Night), H - Holidays or weekend (Day). HN - Holidays or weekend (Night) E.g. 0.5W 1WN \ No newline at end of file +*[Shifts]: Manual entry of number of shifts (1 shift = 8h) worked during this measurement as well as an identifier when these shifts happened. W - Weekdays (Day), WN - Weekdays (Night), H - Holidays or weekend (Day). HN - Holidays or weekend (Night) E.g. 0.5W 1WN \ No newline at end of file diff --git a/docs/measurements/physics/about.md b/docs/measurements/physics/about.md index a06b3d51..1a310a7c 100644 --- a/docs/measurements/physics/about.md +++ b/docs/measurements/physics/about.md @@ -5,4 +5,4 @@ [Ewens presentation at Uni Goettingen][maclean_goettingen_2019]{target=_blank} gives a good general introduction into the topic of LHC related accelerator physics. -[maclean_goettingen_2019]: https://indico.cern.ch/event/788195/contributions/3364867/attachments/1886006/3109100/2019_07_25_HASCO_lcomp.pdf \ No newline at end of file +[maclean_goettingen_2019]: https://indico.cern.ch/event/788195/contributions/3364867/attachments/1886006/3109100/2019_07_25_HASCO_lcomp.pdf diff --git a/docs/measurements/physics/bpm_calibration.md b/docs/measurements/physics/bpm_calibration.md index 20428c34..c0404668 100644 --- a/docs/measurements/physics/bpm_calibration.md +++ b/docs/measurements/physics/bpm_calibration.md @@ -6,7 +6,7 @@ Knowledge of calibration factors can be used to increase the accuracy of measure There are currently two methods to determine BPM calibration factors, using either the ratio between the dispersion or the $\beta$-functions computed from phase and from amplitude. A special type of optics called _Ballistic Optics_ have been designed for the measurement of calibration factors. -The most efficient way to get those factors is via an undisturbed function, i.e. in a drift by turning off quadrupoles, creating a standard drift space between BPMs. +The most efficient way to get those factors is via an undisturbed function, i.e. in a drift by turning off quadrupoles, creating a standard drift space between BPMs. !!! warning "Calibration for Ballistic Optics" The computation of BPM calibration factors is only done for ballistic optics and their related BPMs because the $\beta$-function and dispersion are known in such drifts. @@ -58,7 +58,7 @@ $$ [^RamaDispersionCalibration]: ??? abstract "BPM Calibration Independent LHC Optics Correction, `R. Calaga, and R. Tomás, and F. Zimmermann`, [IEEE Particle Accelerator Conference, 2007](https://ieeexplore.ieee.org/document/4440536){target=_blank}" ``` - @inproceedings{Calaga:4440536, + @inproceedings{Calaga:4440536, author={Calaga, R. and Tomas, R. and Zimmermann, F.}, booktitle={2007 IEEE Particle Accelerator Conference (PAC)}, title={BPM calibration independent LHC optics correction}, @@ -73,4 +73,4 @@ $$ *[BPM]: Beam Position Monitor -[bpm_calibration_constants]: https://github.com/pylhc/PyLHC/blob/master/pylhc/constants/calibration.py \ No newline at end of file +[bpm_calibration_constants]: https://github.com/pylhc/PyLHC/blob/master/pylhc/constants/calibration.py diff --git a/docs/measurements/physics/bpm_filtering.md b/docs/measurements/physics/bpm_filtering.md index b2e0d78c..214518d0 100644 --- a/docs/measurements/physics/bpm_filtering.md +++ b/docs/measurements/physics/bpm_filtering.md @@ -1,3 +1,5 @@ +# BPM Filtering + - The content of this page has been converted from the presentation given as ["OMC3 bad BPM detection" on the 31.03.2025](https://indico.cern.ch/event/1531923/) . - ## OMC-Analysis -![BPM vs Owl](../../assets/images/bpm_filtering/bpmvsowl.png) - * To get reliable and reproducible optics measurements, we cannot trust all BPM data that we are getting. * At different stages of the code, we try to determine the "trustworthyness". * Some BPMs are fully excluded, others are getting errorbars based on their noise-level (which are often used as *weights*, e.g. for correction calculations). - ## Automatic * First the Turn-by-Turn Data is checked for "obvious" signs. @@ -34,7 +31,6 @@ The content of this page has been converted from the presentation given as ["OMC ## Manual - * KNOWN: Identified manually; sticking out spectrum/optics regularly. * Large error bars. * Non-sensical data points. @@ -45,10 +41,11 @@ The content of this page has been converted from the presentation given as ["OMC * Measure in different optics to confirm BPM issue. * **Good hint:** Filtering them solves observed issues. -
- +
+ Beta-beating with large errorbars
Observed Beta-Beating with some large errorbars (e.g. IP1 and IP5) and unrealistic beating (around 2200m in Y)
+
## Isolation Forest @@ -59,8 +56,12 @@ The content of this page has been converted from the presentation given as ["OMC !!! 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! -![Isolation Forest Example](../../assets/images/bpm_filtering/iforest.png) - +
+
+ Isolation forest visualisation +
Isolation Forest Clustering of BPMs Revealing Outliers
+
+
[E. Fol - Machine Learning for BPM failure detection](https://indico.cern.ch/event/762124/contributions/3174751/attachments/1740028/2815322/hss_meeting_2410.pdf)
[E. Fol - Isolation Forest for bad BPMs: performance evaluation](https://indico.cern.ch/event/776442/contributions/3228674/attachments/1759222/2853627/omc_meeting_26nov.pdf) @@ -89,15 +90,11 @@ options: Example: All bad BPMs from 2025, written into file and all > 50% in terminal -``` +```bash python -m omc3.scripts.bad_bpms_summary --dates 2025-* \ --accel_glob LHCB* \ --outfile bad_bpms_2025.txt \ --print_percentage 50 ``` -![A Bad BPM](../../assets/images/bpm_filtering/badbpm.png) - - - -*[BPM]: Beam Position Monitor \ No newline at end of file +*[BPM]: Beam Position Monitor diff --git a/docs/measurements/physics/coupling.md b/docs/measurements/physics/coupling.md index 3db869e7..c81a6783 100644 --- a/docs/measurements/physics/coupling.md +++ b/docs/measurements/physics/coupling.md @@ -11,10 +11,9 @@ This section pertains to the measurement and reconstruction of coupling resonanc and - for the full mathematical details - to the papers of [Bazzani][bazzani_normal_form]{target=\_blank} and [Bartolini][bartolini_normal_form]{target=\_blank}. - ## The 2-BPM-Method -One possible method to calculate coupling used for LHC - which is independent of BPM calibration errors - makes use of two nearby BPMs in order to cancel out calibration factors. +One possible method to calculate coupling used for LHC - which is independent of BPM calibration errors - makes use of two nearby BPMs in order to cancel out calibration factors. It is therefore called the _two BPM method_. Under the assumption that no other perturbations than linear transverse coupling are present in the lattice, the Courant-Snyder coordinates $h_{x/y}^\pm$ read: @@ -29,7 +28,7 @@ $$ \end{align} $$ -where $\zeta_{x/y}^\pm$ denotes normal form coordinates and $f_{1001}$ and $f_{1010}$ are the coupling RDTs. +where $\zeta_{x/y}^\pm$ denotes normal form coordinates and $f_{1001}$ and $f_{1010}$ are the coupling RDTs. A calculation of the relations above can be found in Franchi's paper about emittance sharing: [10.1103/PhysRevSTAB.10.064003][franchi_emittance_sharing]{target=\_blank}. By the term _spectral lines_, we usually denote the Fourier transforms of the turn-by-turn spectrum: @@ -37,7 +36,7 @@ By the term _spectral lines_, we usually denote the Fourier transforms of the tu $$ \begin{align} H^\pm(n_x,n_y) &= \mathcal{F}\{h_x^\pm\}(n_xQ_x+n_yQ_y) \\ - V^\pm(n_x,n_y) &= \mathcal{F}\{h_y^\pm\}(n_xQ_x+n_yQ_y) + V^\pm(n_x,n_y) &= \mathcal{F}\{h_y^\pm\}(n_xQ_x+n_yQ_y) \end{align} $$ @@ -56,7 +55,7 @@ The calibration factors $C_{x/y}$ cancel out if one divides the spectral line by $$ \begin{align} A_{0,n_y} &= \frac{H^+(0,n_y)}{\left|H^+(1,0)\right|} \\ - B_{n_x,0} &= \frac{V^+(n_x,0)}{\left|V^+(0,1)\right|} + B_{n_x,0} &= \frac{V^+(n_x,0)}{\left|V^+(0,1)\right|} \end{align} $$ @@ -98,7 +97,7 @@ $$ $$ The normalised spectral lines $A_{0,n_y}$ and $B_{n_x,0}$ are the Fourier components of the complex coordinates. -However, only the projections onto the real axis can be measured. +However, only the projections onto the real axis can be measured. The next step is to calculate the complex coordinates from the measured ones. Since $h_z^\pm = z \pm ip_z$, the complex coordinate can be obtained from position and momentum. @@ -159,7 +158,7 @@ This allows to express the real normalised spectral lines as: $$ \begin{align} A(0,n_y)_a &= \frac{H(0,n_y)_a}{\left| H(1,0)_a \right|} = \frac{H(0,n_y)_a}{\left| H(1,0)_b \right|} \\ - B(n_x,0)_a &= \frac{V(n_x,0)_a}{\left| V(0,1)_a \right|} = \frac{V(n_x,0)_a}{\left| V(0,1)_b \right|} + B(n_x,0)_a &= \frac{V(n_x,0)_a}{\left| V(0,1)_a \right|} = \frac{V(n_x,0)_a}{\left| V(0,1)_b \right|} \end{align} $$ @@ -229,4 +228,4 @@ which can finally be used to calculate the coupling RDTs $f_{1001}$ and $f_{1010 [bartolini_normal_form]: https://cds.cern.ch/record/333077 [herr_cas]: https://cds.cern.ch/record/1507631 [herr_forest_nf]: https://cds.cern.ch/record/2743949/files/Herr-Forest2020_Chapter_Non-linearDynamicsInAccelerato%20(1).pdf -[tomas_rdt]: https://inspirehep.net/literature/680877 \ No newline at end of file +[tomas_rdt]: https://inspirehep.net/literature/680877 diff --git a/docs/measurements/physics/error_propagation.md b/docs/measurements/physics/error_propagation.md index 6207e88f..b3a874a0 100644 --- a/docs/measurements/physics/error_propagation.md +++ b/docs/measurements/physics/error_propagation.md @@ -31,12 +31,11 @@ In such a case, we get the famous formula: $$ \begin{equation} -\sigma_f^2=\sum_i \left(\frac{\partial f}{\partial x_i}\right)^2 \sigma_i^2 +\sigma_f^2=\sum_i \left(\frac{\partial f}{\partial x_i}\right)^2 \sigma_i^2 \end{equation} $$ However, sometimes we should not neglect the covariances. For details, see the more extensive [Wikipedia article about propagation of uncertainty][wiki_propagation_uncertainty]{target=_blank} or your favourite statistics textbook. - [wiki_propagation_uncertainty]: https://en.wikipedia.org/wiki/Propagation_of_uncertainty diff --git a/docs/measurements/physics/harpy.md b/docs/measurements/physics/harpy.md new file mode 100644 index 00000000..14515c26 --- /dev/null +++ b/docs/measurements/physics/harpy.md @@ -0,0 +1,19 @@ +# Harmonic Analysis with Harpy + +This page describes how the harmonic analysis is performed with the `harpy` module. +If you want to know how to use the `harpy` module, refer to the [`omc3` analysis workflow][omc3_analysis]. + +!!! todo "Implement this page" + Explain how harpy works. + Similar to [Malina - Harpy: A Fast, Simple and Accurate Harmonic Analysis with Error Propagation](https://accelconf.web.cern.ch/ipac2022/doi/JACoW-IPAC2022-WEPOMS035.html) + but more detail: + + - SVD, Noise cleaning, Noise estimation + - Why numpy FFT? What about SUSSIX, LASKAR? + - Zero padding + - Binning + - Error propagation + - BPM cleaning + - Line identification + +[omc3_analysis]: ../../packages/omc3/analysis.md \ No newline at end of file diff --git a/docs/measurements/physics/ir_linear_optics.md b/docs/measurements/physics/ir_linear_optics.md index a5f1a8b7..8315ff0d 100644 --- a/docs/measurements/physics/ir_linear_optics.md +++ b/docs/measurements/physics/ir_linear_optics.md @@ -1 +1 @@ -# LHC IR Linear Optics \ No newline at end of file +# LHC IR Linear Optics diff --git a/docs/measurements/physics/ir_nonlinear_optics.md b/docs/measurements/physics/ir_nonlinear_optics.md index ee76e696..c0eb5c34 100644 --- a/docs/measurements/physics/ir_nonlinear_optics.md +++ b/docs/measurements/physics/ir_nonlinear_optics.md @@ -1 +1 @@ -# LHC IR NonLinear Optics \ No newline at end of file +# LHC IR NonLinear Optics diff --git a/docs/measurements/physics/kmod.md b/docs/measurements/physics/kmod.md index 85757267..a295fda1 100644 --- a/docs/measurements/physics/kmod.md +++ b/docs/measurements/physics/kmod.md @@ -1,4 +1,3 @@ - # K-Modulation This section gives a brief overview over the K-Modulation method. @@ -16,7 +15,7 @@ $$ \beta_{x,y} = \pm 2 \Delta K^{-1}\Big[ cot(2 \pi Q_{x,y}) [ 1 - cos(2 \pi \Delta Q_{x,y}) ] + sin(2 \pi \Delta Q_{x,y}) \Big] $$ -If these measurements are conducted for two adjacent quadrupoles, the evolution of the $\beta$-function in-between the modulated quadrupoles can also be inferred[^FelixKmodPaper]. +If these measurements are conducted for two adjacent quadrupoles, the evolution of the $\beta$-function in-between the modulated quadrupoles can also be inferred[^FelixCarlierKmodPaper]. Here, the average $\beta$-function in the quadrupole is expressed in terms of the optics functions $\beta_0$, $\alpha_0$, and $\gamma_0$ at the end of the quadrupole. Assuming a drift space between the quadrupoles, these coordinates can then be expressed in terms of the distance of the quadrupole end to the middle of the drift-section $L^*$, the minimum $\beta$-function $\beta^*$, and $w$, the offset of this minimum with respect to the center of the drift. @@ -27,7 +26,6 @@ The $\beta$-function at other elements in the drift space can then be determined Compared to other methods, K-Modulation allows to infer a potential waist shift and its direction, which is not possible using the turn-by-turn based methods. However, K-Modulation is usually more time-intensive, and is only applicable with individually powered quadrupoles. - [^MintyZimmermann]: ??? abstract "Measurement and Control of Charged Particle Beams, `Michiko G. Minty, Frank Zimmermann`, [https://doi.org/10.1007/978-3-662-08581-3](https://link.springer.com/book/10.1007%2F978-3-662-08581-3){target=_blank}" ``` @@ -43,7 +41,7 @@ However, K-Modulation is usually more time-intensive, and is only applicable wit } ``` -[^FelixKmodPaper]: +[^FelixCarlierKmodPaper]: ??? abstract "Accuracy and Feasibility of the Beta* Measurement for LHC and High Luminosity LHC Using K Modulation, `F. Carlier, and R. Tomás`, [Phys. Rev. Accel. Beams **20**, 2017](https://link.aps.org/doi/10.1103/PhysRevAccelBeams.20.011005){target=_blank}" ``` @article{PhysRevAccelBeams.20.011005, diff --git a/docs/measurements/physics/threedkicks.md b/docs/measurements/physics/threedkicks.md index 63844030..8d90b03c 100644 --- a/docs/measurements/physics/threedkicks.md +++ b/docs/measurements/physics/threedkicks.md @@ -1,2 +1 @@ - # 3D Kicks diff --git a/docs/measurements/procedures/about.md b/docs/measurements/procedures/about.md index e6069c4d..9d0e69fd 100644 --- a/docs/measurements/procedures/about.md +++ b/docs/measurements/procedures/about.md @@ -1,4 +1,3 @@ - # Checklists In this section there are multiple checklists for procedures, that can be used as guidance during measurements. diff --git a/docs/measurements/procedures/ampdet.md b/docs/measurements/procedures/ampdet.md index a7a80a51..aa1b34bc 100644 --- a/docs/measurements/procedures/ampdet.md +++ b/docs/measurements/procedures/ampdet.md @@ -47,12 +47,16 @@ See Info-box "Tune Deltas" below.

- -
Bad Spectrum.
+
+ A  bad spectrum +
Bad Spectrum.
+
- -
Good Spectrum.
+
+ A  good spectrum +
Good Spectrum.
+
- [ ] Repeat until the spectrum looks usable @@ -63,7 +67,6 @@ Horizontal: -0.009,
Vertical: +0.007. - ### Actual Measurement !!! warning "When kicking with crossing angles" @@ -74,7 +77,6 @@ If you see losses in the IPs with crossing angles, but you are not yet happy with your maximum amplitude and you still have a lot of beam intensity left, you can kick at the same amplitude a few times and hope that the losses go down (the outermost particles are scraped) and then (carefully) continue increasing amplitude again. - - [ ]
Kicks in the vertical plane

While keeping the AC-Dipole amplitude in the horizontal plane constant (but not zero, to avoid weird AC-Dipole behaviour and to see if there is coupling effects), @@ -183,12 +185,16 @@ on how to optimize the analysis and only need to be applied where necessary. which might differ a bit from the actual window if `Autotunes` are used.

- +
+ Tune settings panel
Tune settings.
+
- +
+ Tune tolerance window
Approximate tolerance window, shown in blue for the horizontal and in red for the vertical tune.
+
- [ ]
Use `Autotunes` and `Nat. Deltas` @@ -205,8 +211,10 @@ on how to optimize the analysis and only need to be applied where necessary. while the GUI/harpy searches for the natural tune at Δ from the driven tune.

- +
+ Tune settings panel
Tune settings.
+
- [ ]
Good Frequency Resolution (`TurnBits > 15`) @@ -239,12 +247,16 @@ on how to optimize the analysis and only need to be applied where necessary. The following steps describe how to do that.

- -
Example of `NATTUNEX` data with outliers.
+
+ Example of `NATTUNEX` data with outliers +
Example of `NATTUNEX` data with outliers.
+
- -
Example for clean (but not perfect) `NATTUNEX` data.
+
+ Example for clean `NATTUNEX` data +
Example for clean (but not perfect) `NATTUNEX` data.
+
- [ ]
Check Frequency Chart @@ -258,8 +270,10 @@ on how to optimize the analysis and only need to be applied where necessary. Very helpful when trying to identify where the currently found natural tune is located in the `Frequency Spectrum`, is to activate the `Resonance Lines` and select `Nat. Tune (Measured)`, which shows the average natural tunes of all BPMs (of the first selected analysis data).
- -
Show the natural tune in the frequency spectum.
+
+ GIF showing the natural tune in the frequency spectum +
Show the natural tune in the frequency spectum.
+

@@ -281,8 +295,10 @@ on how to optimize the analysis and only need to be applied where necessary.
  • Click Update Lin-File.
    - -
    How to update the natural tune in the Lin-File.
    +
    + GIF showing the update lin-file functionality +
    How to update the natural tune in the Lin-File.
    +
    - [ ]
    Clean wrong BPMs (where applicable) @@ -293,8 +309,10 @@ on how to optimize the analysis and only need to be applied where necessary. no points are beyond an automatically determined (by the number of points) range. In both cases, the majority of the BPMs should already agree on the natural tune and any cleaning step can be undone, either separately in `X` and `Y` or int `both` planes.
    - -
    `Auto Clean` and `Undo` example.
    +
    + GIF showing the `Auto Clean` and `Undo` functionality +
    `Auto Clean` and `Undo` example.
    +

    - [ ]
    Clean wrong Measurements (where applicable) @@ -337,8 +355,10 @@ on how to optimize the analysis and only need to be applied where necessary. This plotting is also done in `python`, resulting in `matplotlib` windows to pop up and `plot.ampdet_dQ*d2J*.pdf` files to appear in the optics result directory.

    - -
    The amplitude detuning analysis window.
    +
    + Amplitude detuning analysis window +
    The amplitude detuning analysis window.
    +
    - [ ]
    With BBQ correction diff --git a/docs/measurements/procedures/general_checks.md b/docs/measurements/procedures/general_checks.md index fa2215dd..d9d0d5b3 100644 --- a/docs/measurements/procedures/general_checks.md +++ b/docs/measurements/procedures/general_checks.md @@ -5,6 +5,10 @@ Here are a few checks to perform before starting measurements. These are updated as much as possible for Run 3 values. +!!! tip "Multiturn Application" + Measurements are performed using the Multiturn application. + [See here](../../guis/multiturn/gui.md) for a full section about this GUI and how to use it. + - [ ]
    Make Sure Intensity Is below $10^{10}$ppb until Local Corrections Are In

    After local corrections, we can move to having 3 bunches (each below $10^{10}$ppb) evenly spaced along the ring.

    @@ -14,7 +18,7 @@ These are updated as much as possible for Run 3 values.

    - [ ]
    Mask the Appropriate BLMs -

    It is possible tp "mask" some of the BLMs, which means making sure they won't trigger any beam dump. They are essentially ignored in the interlocked system when masked. +

    It is possible to "mask" some of the BLMs, which means making sure they won't trigger any beam dump. They are essentially ignored in the interlocked system when masked.

    - [ ]
    Turn Off the Landau Octupoles @@ -40,6 +44,10 @@ These are updated as much as possible for Run 3 values.

    There should be a pre-made setting for this.

    +- [ ]
    Deactivate Injection Protection +

    Only if measuring at injection, ask the EIC to deactivate this setting. +

    + !!! note "Timing Tables" Normally, starting in Run 3 the timing tables are automatically loaded by the Multiturn application. It can't hurt to check that they are, though. @@ -89,7 +97,7 @@ Here are some general checks on should always keep in mind when performing measu ## General Corrections Caveats - [ ]
    Beware of the Corrections Signs - For a quick (but rough) reference see [this old note][polarity_acc_note] [this 2022 presentation][riccardo_lhc_polarity] by Riccardo. + For a quick (but rough) reference see [this old note][polarity_acc_note]{target=_blank} and [this 2022 presentation][riccardo_lhc_polarity]{target=_blank} by Riccardo. - [ ]
    Calculated Global Corrections

    The calculated global correction are really corrections and should be trimmed in with a positive sign.

    diff --git a/docs/measurements/procedures/kmod.md b/docs/measurements/procedures/kmod.md index 7d103b09..6be05288 100644 --- a/docs/measurements/procedures/kmod.md +++ b/docs/measurements/procedures/kmod.md @@ -1,16 +1,18 @@ # Measuring $\beta^{*}$ Using K-Modulation in the LHC -!!! note - Please keep in mind the [general checks](general_checks.md) for measurements. +!!! info "The Procedure in Short" -??? info "The Procedure in Short" - The important stuff. - This decides over luminosity and lives in the experiments. + We use K-modulation to determine the $\beta$-functions at the interaction points and, with better accuracy than classical measurements, at the BPMs closest to the IPs. + The quadrupole circuits closest to the IP are modulated and the consequent tune changes are measured. + See [this page][kmod_method] for details on the K-modulation method. -## Measurement +Please keep in mind the [general checks](general_checks.md) for measurements, and see the [K-Mod guide][kmod_app] for how to perform the tasks listed below. + +## Procedure - [ ]
    Adjust Working Point

    The tunes should be moved to a working point with a large tune separation, such as $Q_x = 0.28 / Q_y = 0.31$, to allow for maximum modulation amplitude. + Pay attention to potential resonance crossings.

    - [ ]
    Check Coupling @@ -18,68 +20,42 @@ Also check for any unwanted local coupling bumps around the modulated quadrupole.

    -- [ ] Check feedbacks +- [ ]
    Start the K-modulation GUI +

    See the [K-Mod pages][kmod_app]. +

    - - [ ]
    Turn on orbit feedback -

    In case of any (design) orbit excursion in the quadrupoles, enable orbit feedback to avoid a change of the CO around the ring. - Caveat: for the determination of the crossing angles, orbit feedback should be off. -

    +- [ ]
    Ensure the orbit feedback is ON +

    In case of any (design) orbit excursion in the quadrupoles, enable orbit feedback to avoid a change of the CO around the ring. + The status is visible in the top right corner of the GUI. +

    - - [ ]
    Turn off tune feedback +- [ ]
    Ensure the tune feedback is OFF

    Otherwise modulation and feedback would work against each other. + The status is visible in the top right corner of the GUI.

    - [ ]
    Run K-Modulation -

    Fire up the [K-Mod application][kmod_app]. - There two options are available: - - IP Modulation : Runs a modulation on both quadrupoles closest to the selected IP. - - Single circuit modulation : Runs a modulation on a selected quadrupole circuit (used for measuring the beta-functions in IR4, where BSRT is located). -

    -
    - - - [ ]
    Chose Modulation Amplitude -

    Choose a modulation current such that the change in tune is roughly 0.01. - This can either be done by looking up old shifts with similar optics or by increasing the amplitude until satisfactory tune change is observed. - Modulation frequency is chosen by the system, with higher modulation amplitude resulting in lower modulation frequency. -

    - - - [ ]
    Document Measurement -

    As no automatic logging of the modulation is implemented for now, parameters should be logged in the logbook. - Parameters to log are: `Starttime`, `Endtime`, `Modulation current`, `IP`, other comments such as $\beta^{*}$, status of the `OFB`, is significant tunejitter/-jump observed. -

    - -## Analysis - -- [ ]
    Extract Data from Timber -

    After the analysis, a window should open to allow for extraction of the data from `Timber`. - Alternatively, `Extract previous trim` can be used. - Saving in a separate directory with a descriptive name is recommended (e.g. `Kmod_IPX_beta_beforeCorrection_starttime`) and should be added to the modulation logbook entry. +

    See the [following page][kmod_run] for how to perform a modulation of the desired circuit. + Check from the modulation graph for the quality of the modulation and data.

    - [ ]
    Start the Analysis -

    Run the python codes on the extracted Timber data to get the $\beta$ you need. - As of now, only the Kmod analysis from `Beta-Beat.src` can be called from the K-Modulation GUI for the case of an analysis of an IP-Modulation. - Codes and some documentation may be found [for `Python2`][kmod_python2]{target=_blank} and [for `Python3`][kmod_python3]{target=_blank}. +

    Analysis is now launched directly from the `Pykmod` app. + See [this page][kmod_analysis] for details on how to analyze and export the data.

    -- [ ]
    Check Results -

    The results of the analysis should be located in the previously specified working directory and can be checked by eye using a text editor of choice. +- [ ]

    Import Results Into the Beta-Beat GUI +

    The results are useful to compute optics corrections. + See the [Beta-Beat GUI page][beta_beat_gui] for how to import the results.

    - - [ ]
    Use in Beta-Beat GUI for Correction -

    Using this [script][get_kmod_files_python2]{target=_blank}, the results can be brought in a form which is readable for the BBGUI and can then be used to calculate a correction. -

    - - - [ ]
    Publish Results -

    If results are satisfactory, both `Python2` and `Python3` should create a file called `lsa_results.tfs`, which can be uploaded using the LSA optics uploader for other users to access data. -

    - *[CO]: Closed Orbit *[BSRT]: Beam Synchrotron Radiation Telescope *[OFB]: Orbit Feed Back *[LSA]: LHC Software Architecture [kmod_app]: ../../guis/kmod/gui.md -[get_kmod_files_python2]: https://github.com/pylhc/Beta-Beat.src/blob/master/kmod/gui2beta/get_kmod_files.py -[kmod_python2]: https://github.com/pylhc/Beta-Beat.src/blob/master/kmod/gui2beta/gui2kmod.py -[kmod_python3]: https://github.com/pylhc/omc3/blob/master/omc3/run_kmod.py +[kmod_run]: ../../guis/kmod/modulating.md +[kmod_analysis]: ../../guis/kmod/analyzing.md +[kmod_method]: ../../measurements/physics/kmod.md +[beta_beat_gui]: ../../guis/betabeat/gui.md diff --git a/docs/measurements/procedures/rigid_waist_shift.md b/docs/measurements/procedures/rigid_waist_shift.md index cebe7e9b..c355af92 100644 --- a/docs/measurements/procedures/rigid_waist_shift.md +++ b/docs/measurements/procedures/rigid_waist_shift.md @@ -5,13 +5,13 @@ ??? info "The Procedure in Short" - This methods aims to find the MQSX correction settings that would minimize betatron coupling and its impact on beam size *at the IP*. + This methods aims to find the MQSX correction settings that would minimize betatron coupling and its impact on beam size _at the IP_. The method breaks the symmetry of the optics in the IR and forces local coupling RDTs to leak throughout the machine, which makes them measurable through the $|C^{-}|$. After global corrections are done and trimmed in the machine, one applies a rigid waist shift in a given IR and scans the colinearity knob for the value that minimizes the $|C^{-}|$. These settings, when taking away the rigid waist shift, will minimize local coupling and its impact at the IP. - Additional info can be found in Felix's 2021 IPAC paper[^SoubeletIPACLocalCouplingCorrection]. + Additional info can be found in Felix's 2021 IPAC paper[^SoubeletIPACLocalCouplingCorrection] and 2023 PRAB paper[^SoubeletPRABLocalCouplingCorrection]. ## Rigid Waist Shift & LSA Knobs @@ -20,7 +20,7 @@ Some details about the creation of these knobs and their addition in LSA can be ### Knob Setting Convention -Two different knobs are used for the waist shift that need to be trimmed in: +Two different knobs are used for the waist shift that need to be trimmed in: - The triplets knob, which generates the waist shift itself. - The independent quadrupoles knob (Q4 - Q10), which re-matches the optics. @@ -34,13 +34,13 @@ The knob setting is defined as follows, with regards to Beam1 (reverse for Beam2 ### The Knobs in LSA Since the triplet knob for a unit setting of +$1$ is the exact opposite magnet powering of the knob for a unit setting of -$1$, only a single triplet knob per IP has been added to LSA, which can then be trimmed with a factor of $\pm1$. -On the other hand, the re-matching quadrupole knobs are specific to a given direction of the shift, so two of them per IP (one per direction) were added to LSA, with the *pos* and *neg* suffixes. +On the other hand, the re-matching quadrupole knobs are specific to a given direction of the shift, so two of them per IP (one per direction) were added to LSA, with the _pos_ and _neg_ suffixes. These should always be trimmed with a factor of $1$. As a consequence, respect the following rules when applying the knobs below: - - When trimming the triplet knob with a factor of +$1$, use the *pos* re-matching quadrupoles knob. - - When trimming the triplet knob with a factor of -$1$, use the *neg* re-matching quadrupoles knob. +- When trimming the triplet knob with a factor of +$1$, use the _pos_ re-matching quadrupoles knob. +- When trimming the triplet knob with a factor of -$1$, use the _neg_ re-matching quadrupoles knob. ??? info "LSA Triplets Knobs" @@ -64,10 +64,10 @@ As a consequence, respect the following rules when applying the knobs below: ??? example "An Example" We wish to implement the waist shift at IP1, shifting the waist to the left of IP (for Beam1). - To do so we need to apply the *LHCBEAM/MD_ATS_2020-05_04_BX_RigidWaistShift_Triplet_IP1* with a factor of +$1$. + To do so we need to apply the _LHCBEAM/MD_ATS_2020-05_04_BX_RigidWaistShift_Triplet_IP1_ with a factor of +$1$. - Since we used a +$1$ factor on the triplet knob, the corresponding re-matching quadrupoles knobs to use are those with the *pos* suffix, and they should be trimmed with a factor +$1$. - The knobs to trim are then: *LHCBEAM/MD_ATS_2022_05_04_B1_RigidWaitsShift_IP1pos* and *LHCBEAM/MD_ATS_2022_05_04_B2_RigidWaitsShift_IP1pos*. + Since we used a +$1$ factor on the triplet knob, the corresponding re-matching quadrupoles knobs to use are those with the _pos_ suffix, and they should be trimmed with a factor +$1$. + The knobs to trim are then: _LHCBEAM/MD_ATS_2022_05_04_B1_RigidWaitsShift_IP1pos_ and _LHCBEAM/MD_ATS_2022_05_04_B2_RigidWaitsShift_IP1pos_. !!! warning "Value of the Waist Shift" The waist shift from the generated knobs should be of about 43 to 44cm in either direction. @@ -77,7 +77,7 @@ As a consequence, respect the following rules when applying the knobs below: ## Preliminary Setup - [ ]
    Do Global Corrections -

    This procedure needs global corrections to be trimmed in the machine first, so optics and *global coupling* should be taken care of beforehand. +

    This procedure needs global corrections to be trimmed in the machine first, so optics and _global coupling_ should be taken care of beforehand.

    - [ ]
    **Optional:** Scan the Colinearity Knob to Check Conditions @@ -158,7 +158,7 @@ Keep in mind that this does Beam1 and Beam2 at the same time, but different IPs [^SoubeletIPACLocalCouplingCorrection]: ??? abstract "Prospect for Interaction Region Local Coupling Correction in the LHC Run 3, `F. Soubelet, and T. Persson, and R. Tomás, and O. Apsimon, and C.P. Welsch`, [International Particle Accelerator Conference, 2021](https://accelconf.web.cern.ch/ipac2021/papers/mopab007.pdf){target=_blank}" ``` - @inproceedings{soubeletProspectInteractionRegion2021, + @inproceedings{soubeletProspectInteractionRegion2021, author={Soubelet, F. and Persson, T. and Tomás, R. and Apsimon, O. and Welsch, C.P.}, booktitle={Proceedings of the 12th International Particle Accelerator Conference}, title={Prospect for Interaction Region Local Coupling Correction in the LHC Run 3}, @@ -168,6 +168,25 @@ Keep in mind that this does Beam1 and Beam2 at the same time, but different IPs } ``` +[^SoubeletPRABLocalCouplingCorrection]: + ??? abstract "Rigid Waist Shift: A New Method for Local Coupling Corrections in the LHC Interaction Regions, `F. Soubelet, T. Persson, R. Tomás, O. Apsimon and C. Welsch`, [Phys. Rev. Accel. Beams 25, 051001, 2023](https://link.aps.org/doi/10.1103/PhysRevAccelBeams.26.051001){target=_blank}" + ``` + @article{Soubelet2023, + author = {Soubelet, Felix and Persson, Tobias and Tomás, Rogelio and Apsimon, Oznur and Welsch, Carsten P.}, + doi = {10.1103/PhysRevAccelBeams.26.051001}, + issue = {5}, + journal = {Phys. Rev. Accel. Beams}, + month = {May}, + numpages = {13}, + pages = {051001}, + publisher = {American Physical Society}, + title = {Rigid waist shift: A new method for local coupling corrections in the LHC interaction regions}, + url = {https://link.aps.org/doi/10.1103/PhysRevAccelBeams.26.051001}, + volume = {26}, + year = 2023 + } + ``` + *[rigid waist shift]: Shifting the waist of the beam from the IP point by un-balancing the powering of the left and right triplets in the IR. *[MQSX]: The skew quadrupole correctors located next to Q3 *[LSA]: LHC Software Architecture @@ -178,4 +197,4 @@ Keep in mind that this does Beam1 and Beam2 at the same time, but different IPs *[colinearity knob]: This is a powering setting of the MQSXs, which corresponds to a K1S value of ±1E-4 m^-2. [rws_gallery]: https://fsoubelet.github.io/PyhDToolkit/gallery/demo_lhc_rigid_waist_shift.html -[logbook_entry]: https://be-op-logbook.web.cern.ch/elogbook-server/GET/showEventInLogbook/3545713 \ No newline at end of file +[logbook_entry]: https://be-op-logbook.web.cern.ch/elogbook-server/GET/showEventInLogbook/3545713 diff --git a/docs/measurements/procedures/xing_scan.md b/docs/measurements/procedures/xing_scan.md index 486cfb5a..870bb3b3 100644 --- a/docs/measurements/procedures/xing_scan.md +++ b/docs/measurements/procedures/xing_scan.md @@ -4,4 +4,4 @@ Please keep in mind the [general checks](general_checks.md) for measurements. ??? info "The Procedure in Short" - Little bit about the purpose and concept. \ No newline at end of file + Little bit about the purpose and concept. diff --git a/docs/omc_team/ideas.md b/docs/omc_team/ideas.md index ed580587..f85d811d 100644 --- a/docs/omc_team/ideas.md +++ b/docs/omc_team/ideas.md @@ -1,60 +1,13 @@ # Future MD Ideas -## Run 3 MDs Ideas - -### Linear Optics Related - -* 3 New ballistic optics flavors: - * Ballistic with beta* de-squeeze at top energy to reach above 1Km beta in dipoles, to study quadrupolar errors in dipoles. This is specially important in view of HL-LHC D2 b2 errors. - * Telescopic for tune jitter measurements with enhanced arcs. - * Ballistic with large vertical dispersion. -* Half integer tune. -* 60 degrees arc cell phase advance for HE-LHC (or 1/3 HE-LHC), and for improving knowledge on LHC itself as phase advance samples errors differently and arc sextupoles are factor ~2 weaker (more linear machine): arc errors, MCS shifts + coupling, BPM aberrations (beam signal closer to pure sin). -* Experience HL-LHC-like injection optics with beta*=6m (pilots only). -* Look at 11 T flux jumps with TbT data, possibly using a new optics with enhanced beta functions. -* 2 possible experiments with TOTEM to understand the assymetry of the local dispersion in IR5: - * Measurements with flat orbit, >60 bunches. - * Measurements with ballistic optics. -* Non-90 degrees arc cell phase advance to ease correction of errors in the arcs (reduce the knob degeneracy of orbit bumps at sextupoles). -* Measure optics at smallest beta* for a long time, looking for an effect as in SKEKB where Final Focus quadrupole strength drifted by 0.01%. https://kds.kek.jp/event/39396/ -* Try Closed Orbit Distortion optics measurement as in SuperKEKB with 3-6 orbit correctors per plane and orbit fitting. - -### Coupling Related - -* Tilting triplets to correct local coupling to operate without MQSX. -* Switching off MCS and main sextupoles in one arc to evaluate possible (systematic) vertical or horizontal misalignment of dipoles by measuring coupling and beta-beating during the b3 decay. -In a previous MD there was a quadratic coupling increase due to the orbit bump in the arc (maybe the one without MS, tbc). -* Crazy MD for this, could be shifting the edge of some dipoles up to see change in coupling. -* Tilting a triplet quadrupole to check validity of the tilt measurement (with and/or without beam). - -### BPM related - -* Measure bad BPMs with low and high intensities to detect possible issues with the comparator (transistor). -Also swap connections between good and bad BPM to identified. -* Have one BPM unplugged to detect its noise until next technical stop. -* Momentum compaction factor from Qs versus Voltage. -* Snap-back with forced 3D oscillations (optics, chroma,...). -* Maybe not OMC: 24h pilot at top energy to use damped beam for BSRT resolution measurement. -* 0.5 um bunch from new injector chain?? Good for optics measurements, BSRT calibration etc. - -### K-mod related - -* K-Modulation with Xing angle and OFB off for Leon's Xing angle reconstruction. -* Arc K-modulation. -* K-modulation in IR4 during the energy ramp. -* Reduce to one the DCCTs per circuit with pilot in the machine and ATS optics to see the impact of 2 DCCTs. - Michele Martino also proposes increasing in 1ppm the noise of the DCCTs in one or all dipole PCs to see impact on tune jitter. - -### Non-Linear Optics Related - -* Commissioning?: Measure amplitude detuning coming from CMS solenoid by having the on and off measurements. -* IR non-linear corrector offsets measurement. -* Emittance growth from octupoles and chroma. -* Amplitude detuning measurement versus crossing angle with b6 corrector on, for 5 crossing angles to evaluate performance of the technique for b6 correction. -* Amplitude dependent optics: Dedicated settings at injection as PoP (Thomas & Barbara), alternative techniques in parallel (K-modulation with decohered beams and amplitude dependent segment-by-segment). -* IR2 non-linear correction -> Dedicated squeeze for IR2 to allow for good triplet characterization to shed light on b4. -* Amplitude detuning in ballistic optics. -* ADT for single kicks. -* b5 RDTs. -* Measurement and correction of a3 RDTs at injection for lifetime optimization (correcting with MSSX and MSS). -* Reduce RF voltage to decrease synchrotron tune to limit the emittance blow-up during excitation with driven and natural tunes close to each other. +!!! note "CodiMD" + The content of this page is hosted on CodiMD for easy editing. + But you need to visit [the original codimd page](https://codimd.web.cern.ch/s/bG7VxhdGM){target=_blank} + to be able to login and edit! + + diff --git a/docs/packages/about.md b/docs/packages/about.md index a0ad44ba..ea4bf4c1 100644 --- a/docs/packages/about.md +++ b/docs/packages/about.md @@ -1,18 +1,17 @@ # The OMC Python Packages -| Package | Description | Version | Documentation | Wiki | -| :------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------: | :--------------------------------------------------------------------: | -| [**OMC3**][omc3]{target=\_blank} | Frequency analysis, optics computation from turn-by-turn data, corrections calculations and results plotting | [![](https://img.shields.io/pypi/v/omc3.svg)][omc3_pypi]{target=\_blank} | [:fontawesome-solid-book:][omc3_doc]{target=\_blank} | [:fontawesome-solid-circle-question:](omc3/about.md) | -| [**TFS-Pandas**][tfspandas]{target=\_blank} | TFS files I/O functionality | [![](https://img.shields.io/pypi/v/tfs-pandas.svg)][tfs_pypi]{target=\_blank} | [:fontawesome-solid-book:][tfspandas_doc]{target=\_blank} | | -| [**Turn-by-Turn**][turnbyturn]{target=\_blank} | Particle accelerators turn-by-turn BPM measurements I/O functionality | [![](https://img.shields.io/pypi/v/turn_by_turn.svg)][tbt_pypi]{target=\_blank} | [:fontawesome-solid-book:][turnbyturn_doc]{target=\_blank} | | -| [**SDDS**][sdds]{target=\_blank} | SDDS files I/O functionality | [![](https://img.shields.io/pypi/v/sdds.svg)][sdds_pypi]{target=\_blank} | [:fontawesome-solid-book:][sdds_doc]{target=\_blank} | | -| [**PyLHC-Tools**][pylhc]{target=\_blank} | Useful OMC-related scripts | [![](https://img.shields.io/pypi/v/PyLHC.svg)][pylhc_pypi]{target=\_blank} | [:fontawesome-solid-book:][pylhc_doc]{target=\_blank} | [:fontawesome-solid-circle-question:](pylhc/about.md) | -| [**PyLHC-Submitter**][pylhc_submitter]{target=\_blank} | Wrapper for HTCondor job submission | [![](https://img.shields.io/pypi/v/pylhc-submitter.svg)][pylhc_submitter_pypi]{target=\_blank} | [:fontawesome-solid-book:][pylhc_submitter_doc]{target=\_blank} | [:fontawesome-solid-circle-question:](pylhcsubmitter/job_submitter.md) | -| [**Optics-Functions**][optics_functions]{target=\_blank} | Calculate various beam optics functions from TFS-Dataframes | [![](https://img.shields.io/pypi/v/optics-functions.svg)][optics_functions_pypi]{target=\_blank} | [:fontawesome-solid-book:][optics_functions_doc]{target=\_blank} | | -| [**Generic-Parser**][generic_parser]{target=\_blank} | Entrypoint argument parser functionality | [![](https://img.shields.io/pypi/v/generic-parser.svg)][generic_parser_pypi]{target=\_blank} | [:fontawesome-solid-book:][generic_parser_doc]{target=\_blank} | | -| [**Example Study Scripts**][mess]{target=\_blank} | Collection of example MAD-X studies | [![](https://img.shields.io/github/v/release/pylhc/MESS?color=orange&label=Release&logo=Github)][mess_releases]{target=\_blank} | | [:fontawesome-solid-circle-question:](mess/about.md) | -| [**Beta-Beat.src**][betabeatsrc]{target=\_blank} | Frequency analysis, optics computation from turn-by-turn data and corrections calculations | [![](https://img.shields.io/github/v/release/pylhc/Beta-Beat.src?color=orange&label=Release&logo=Github)][betabeatsrc_releases]{target=\_blank} | [:fontawesome-solid-book:][betabeatsrc_doc]{target=\_blank} | | - +| Package | Description | Version | Documentation | Wiki | +|-:--------------------------------------------------------|-:------------------------------------------------------------------------------------------------------------|-:-:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-:-:--------------------------------------------------------------|-:-:--------------------------------------------------------------------| +| [**OMC3**][omc3]{target=\_blank} | Frequency analysis, optics computation from turn-by-turn data, corrections calculations and results plotting | [![PyPI version for OMC3](https://img.shields.io/pypi/v/omc3.svg)][omc3_pypi]{target=\_blank} | [:fontawesome-solid-book:][omc3_doc]{target=\_blank} | [:fontawesome-solid-circle-question:](omc3/about.md) | +| [**TFS-Pandas**][tfspandas]{target=\_blank} | TFS files I/O functionality | [![PyPI version for TFS-Pandas](https://img.shields.io/pypi/v/tfs-pandas.svg)][tfs_pypi]{target=\_blank} | [:fontawesome-solid-book:][tfspandas_doc]{target=\_blank} | | +| [**Turn-by-Turn**][turnbyturn]{target=\_blank} | Particle accelerators turn-by-turn BPM measurements I/O functionality | [![PyPI version for Turn-by-Turn](https://img.shields.io/pypi/v/turn_by_turn.svg)][tbt_pypi]{target=\_blank} | [:fontawesome-solid-book:][turnbyturn_doc]{target=\_blank} | | +| [**SDDS**][sdds]{target=\_blank} | SDDS files I/O functionality | [![PyPI version for SDDS](https://img.shields.io/pypi/v/sdds.svg)][sdds_pypi]{target=\_blank} | [:fontawesome-solid-book:][sdds_doc]{target=\_blank} | | +| [**PyLHC-Tools**][pylhc]{target=\_blank} | Useful OMC-related scripts | [![PyPI version for PyLHC-Tools](https://img.shields.io/pypi/v/PyLHC.svg)][pylhc_pypi]{target=\_blank} | [:fontawesome-solid-book:][pylhc_doc]{target=\_blank} | [:fontawesome-solid-circle-question:](pylhc/about.md) | +| [**PyLHC-Submitter**][pylhc_submitter]{target=\_blank} | Wrapper for HTCondor job submission | [![PyPI version for PyLHC-Submitter](https://img.shields.io/pypi/v/pylhc-submitter.svg)][pylhc_submitter_pypi]{target=\_blank} | [:fontawesome-solid-book:][pylhc_submitter_doc]{target=\_blank} | [:fontawesome-solid-circle-question:](pylhcsubmitter/job_submitter.md) | +| [**Optics-Functions**][optics_functions]{target=\_blank} | Calculate various beam optics functions from TFS-Dataframes | [![PyPI version for Optics-Functions](https://img.shields.io/pypi/v/optics-functions.svg)][optics_functions_pypi]{target=\_blank} | [:fontawesome-solid-book:][optics_functions_doc]{target=\_blank} | | +| [**Generic-Parser**][generic_parser]{target=\_blank} | Entrypoint argument parser functionality | [![PyPI version for Generic-Parser](https://img.shields.io/pypi/v/generic-parser.svg)][generic_parser_pypi]{target=\_blank} | [:fontawesome-solid-book:][generic_parser_doc]{target=\_blank} | | +| [**Example Study Scripts**][mess]{target=\_blank} | Collection of example MAD-X studies | [![GitHub release for MESS](https://img.shields.io/github/v/release/pylhc/MESS?color=orange&label=Release&logo=Github)][mess_releases]{target=\_blank} | | [:fontawesome-solid-circle-question:](mess/about.md) | +| [**Beta-Beat.src**][betabeatsrc]{target=\_blank} | Frequency analysis, optics computation from turn-by-turn data and corrections calculations | [![GitHub release for Beta-Beat.src](https://img.shields.io/github/v/release/pylhc/Beta-Beat.src?color=orange&label=Release&logo=Github)][betabeatsrc_releases]{target=\_blank} | [:fontawesome-solid-book:][betabeatsrc_doc]{target=\_blank} | | ## The OMC Python Ecosystem @@ -34,20 +33,18 @@ The environment is located at `/afs/cern.ch/eng/sl/lintrack/omc_python3/` and ca - Point to the Python executable directly (`/afs/cern.ch/eng/sl/lintrack/omc_python3/bin/python`) to execute your programs. !!! warning "Modifying the Environment" - Please do not try to modify this environment. + You cannot modify this environment, [unless you are one of the maintainers](development/managing.md). Should you need specific packages, reach out to us or consider [setting up your own environment](development/howto_venv.md#creating-virtual-environments-with-acc-py) from our `Acc-Py` distribution. ??? question "Python 2 Environment" We do have a `miniconda2` installation in `lintrack` for legacy Python2 codes. This distribution is frozen and the use of Python 2 codes should be avoided as much as possible. - [accpy_docs]: https://wikis.cern.ch/display/ACCPY/Accelerating+Python+Home [betabeatsrc]: https://github.com/pylhc/Beta-Beat.src [betabeatsrc_doc]: https://pylhc.github.io/Beta-Beat.src [betabeatsrc_releases]: https://github.com/pylhc/Beta-Beat.src/releases - [tfspandas]: https://github.com/pylhc/tfs [tfspandas_doc]: https://pylhc.github.io/tfs [turnbyturn]: https://github.com/pylhc/turn_by_turn @@ -74,4 +71,4 @@ The environment is located at `/afs/cern.ch/eng/sl/lintrack/omc_python3/` and ca [pylhc_submitter_pypi]: https://pypi.org/project/pylhc-submitter/ [sdds_pypi]: https://pypi.org/project/sdds/ [tbt_pypi]: https://pypi.org/project/turn-by-turn/ -[tfs_pypi]: https://pypi.org/project/tfs-pandas/ \ No newline at end of file +[tfs_pypi]: https://pypi.org/project/tfs-pandas/ diff --git a/docs/packages/development/contributing.md b/docs/packages/development/contributing.md index 90fe7324..8bcf4544 100644 --- a/docs/packages/development/contributing.md +++ b/docs/packages/development/contributing.md @@ -5,18 +5,18 @@ We welcome contributions, but before you do, please read the following guideline ## Submission context -#### Got a question or problem? +### Got a question or problem? If you have questions on some of the packages' functionality, and the available documentation does not provide answers, you can submit them as new issues on GitHub. -If you spot missing parts in the documentation, feel free to report it in an issue and open a Pull Request that fixes it. +If you spot missing parts in the documentation, feel free to report it in an issue and open a Pull Request that fixes it. -#### Found a bug? +### Found a bug? If you found a bug in the source code, you can help us by submitting a bug report in a new issue on GitHub. If you wish to contribute a solution, you can submit a Pull Request with a fix. However, before doing so, please read the submission guidelines bellow. -#### Missing a feature? +### Missing a feature? You can request a new feature by opening an issue on GitHub. If you would like to implement a new feature, please submit an issue with a proposal first, to be sure that it is necessary and appropriate to the package, and to discuss implementation details. @@ -29,13 +29,13 @@ This will also allow us to better coordinate our efforts, prevent duplication of ## Submission guidelines -#### Submitting an issue +### Submitting an issue Before you submit an issue, please search the issue tracker, maybe an issue for your problem already exists and the discussion might inform you of fixes or workarounds readily available. If you are submitting a bug report, please also provide a minimal scenario to reproduce it. -#### Submitting a Pull Request (PR) +### Submitting a Pull Request (PR) First, search GitHub for an open or closed PR that relates to your submission. If you do not find a related issue or PR, or if your PR is the implementation for an issue you open, go ahead. @@ -51,7 +51,7 @@ If you do not find a related issue or PR, or if your PR is the implementation fo If new changes are suggested, make the required updates and push the changes again. Please do not require a review until all the quality checks pass. -#### Quality checks +### Quality checks - Unit and accuracy tests are run automatically through CI [Github Actions][gh_actions]{target=_blank}. A `README.md` file in the `.github/workflows` directory details our CI jobs. @@ -70,18 +70,18 @@ In case you want to contribute to a package's development, you should install it ```bash git clone https://github.com/pylhc/package_name -pip install --editable package_name +python -m pip install --editable package_name ``` ??? tip "Installing Extras" You can install extra dependencies (as defined in `setup.py`) suited to your use case with the following commands: ```bash - pip install --editable package_name[test] - pip install --editable package_name[test,doc] - pip install --editable package_name[all] + python -m pip install --editable package_name[test] + python -m pip install --editable package_name[test,doc] + python -m pip install --editable package_name[all] ``` - + For development purposes, we recommend using the `all` extra to be fully set up. ### Naming Conventions diff --git a/docs/packages/development/howto_release.md b/docs/packages/development/howto_release.md index 71218a3b..c1320bea 100644 --- a/docs/packages/development/howto_release.md +++ b/docs/packages/development/howto_release.md @@ -15,4 +15,4 @@ A `publish` workflow will be triggered, build source distribution and wheels and *[PyPI]: The Python Package Index [github_actions]: https://github.com/features/actions -[pypi_releases]: https://pypi.org/search/?q=pylhc \ No newline at end of file +[pypi_releases]: https://pypi.org/search/?q=pylhc diff --git a/docs/packages/development/howto_venv.md b/docs/packages/development/howto_venv.md index 5f512503..c3aca48c 100644 --- a/docs/packages/development/howto_venv.md +++ b/docs/packages/development/howto_venv.md @@ -31,6 +31,7 @@ The default distribution is recommended but installation is identical for other As of writing this walk-through, this corresponds to the `acc-py-2020.11-installer.sh` file. The installer itself is an executable to be called from the command line. Once the file is downloaded, run it at the command line (you might need to `chmod u+x` the file): + ```bash bash acc-py-2020.11-installer.sh ``` @@ -54,30 +55,35 @@ You are now done with the installation step. ## Creating Virtual Environments with Acc-Py To make the command line tools available in the current shell, `source` the `setup.sh` script in the installed `Acc-Py` distribution: + ```bash source dist_location/base/2020.11/setup.sh ``` -You should see a confirmation message output that reads: -``` +You should see a confirmation message output that reads: + +```bash => Acc-Py base 2020.11 is now active within this shell. ``` You now have access to the `acc-py` command line tool, which you can verify by running `acc-py -h` and checking that you get the help command output. The command to create a virtual environment is based on the built-in [venv][venv_module]{target=_blank} module and should feel familiar if you know `venv`. To create a virtual environment, run: + ```bash acc-py venv /path/to/environment/ ``` This will create a virtual environment at `/path/to/environment/`. To activate this environment, run: + ```bash source /path/to/environment/bin/activate ``` You can confirm you are running the appropriate Python with `which python`, which should point to `/path/to/environment/bin/python`. You can then install packages in this environment with: + ```bash python -m pip install ``` @@ -97,7 +103,7 @@ To use the environment's Python, one can either: - First `source /path/to/environment/bin/activate` then call `python`. - Call the full path to the python executable `/path/to/environment/bin/python` directly. -[cern_internal_websites]: ../../howto/teleworking/access.md#accessing-cern-internal-websites +[cern_internal_websites]: ../../resources/remote_access.md#accessing-cern-internal-websites *[GPN]: CERN General Public Network *[PyPi]: Default Python Package Index @@ -106,4 +112,4 @@ To use the environment's Python, one can either: [acc-py]: https://wikis.cern.ch/display/ACCPY/Accelerating+Python+Home [acc_py_standalone_doc]: https://wikis.cern.ch/display/ACCPY/Acc-Py+base#Acc-Pybase-Installingthebasedistributiononanothermachine [venv_module]: https://docs.python.org/3/library/venv.html -[pip_installs]: https://pip.pypa.io/en/stable/reference/pip_install/#examples \ No newline at end of file +[pip_installs]: https://pip.pypa.io/en/stable/reference/pip_install/#examples diff --git a/docs/packages/development/ide_setup.md b/docs/packages/development/ide_setup.md new file mode 100644 index 00000000..fe4b14f5 --- /dev/null +++ b/docs/packages/development/ide_setup.md @@ -0,0 +1,58 @@ +# IDE Setup for Python + +While a proper IDE is not strictly needed to develop python code, +its usage will make the development process easier and more efficient, allowing the programmer to interact with the code in ways not possible with a text editor. + + +## VSCode + +We recommend the usage of [VSCode][vscode_webpage]{target=_blank} for Python development, while other excellent IDEs exist, +the following VSCode features are of great value: + +- [Remote SSH connection][vscode_remote_ssh]{target=_blank}:
    + Use any machine with VSCode installed to connect to a remote machine and continue developing on it, + e.g. you can store your files on `afs` and connect to them through `lxplus`, working on them as if they were present locally. + Check the [CERN Knowledge Base][vscode_lxplus]{target=_blank} for more information. +- [Python support][vscode_python]{target=_blank}:
    + Make use of static type checking and auto-completion. Interact with the code via an easy-to-use debugger. +- [Debugging][vscode_debugging]{target=_blank}:
    + Enables you to stop your program at any point and interact with it as well as inspect variables and their values. +- [Interactive Python][vscode_interactive_python]{target=_blank}:
    + Use any script as if it were a jupyter notebook, allowing you to run code snippets in real time and inspect variables. +- [Integrated Testing][vscode_testing]{target=_blank}:
    + Use the `pytest` framework to easily write and run tests, which can be individually run or all at once directly from the editor. +- [Great Extendibility][vscode_marketplace]{target=_blank}:
    + Many extensions are available, making VSCode a great tool for many different use cases and programming languages (e.g. [LaTeX][vscode_latex]{target=_blank}, [Java](../../guis/usage/ide_install.md#vscode), + which means you do not have to learn a new environment for your different projects. +- Widespread use among the team:
    + Most developers of the OMC-Team use VSCode and are happy to help you with setting up and using it. + +### Recommended Extensions + +Main: + +- [Python][vscode_python_extension]{target=_blank}: [Documentation][vscode_python]{target=_blank} +- [Jupyter][vscode_jupyter]{target=_blank}: [Documentation][vscode_interactive_python]{target=_blank} +- [Remote SSH][vscode_remote_ssh_extension]{target=_blank}: [Documentation][vscode_remote_ssh]{target=_blank} and [lxplus SSH configuration][vscode_lxplus]{target=_blank .cern_login}. + +Additional: + +- [Ruff][vscode_ruff]{target=_blank}: A fast Python linter. +- [Github Pull Requests][vscode_github]{target=_blank}: Interact with Github pull requests directly from VSCode. +- [Markdown Table Formatter][vscode_markdown_tables]{target=_blank}: Format tables in markdown files. + +[vscode_lxplus]: https://cern.service-now.com/service-portal?id=kb_article&n=KB0008901 +[vscode_webpage]: https://code.visualstudio.com/ +[vscode_python]: https://code.visualstudio.com/docs/python/python-quick-start +[vscode_debugging]: https://code.visualstudio.com/docs/python/debugging +[vscode_interactive_python]: https://code.visualstudio.com/docs/python/jupyter-support-py +[vscode_remote_ssh]: https://code.visualstudio.com/docs/remote/ssh-tutorial +[vscode_testing]: https://code.visualstudio.com/docs/python/testing +[vscode_marketplace]: https://marketplace.visualstudio.com/vscode +[vscode_latex]: https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop +[vscode_jupyter]: https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter +[vscode_python_extension]: https://marketplace.visualstudio.com/items?itemName=ms-python.python +[vscode_ruff]: https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff +[vscode_github]: https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github +[vscode_markdown_tables]: https://marketplace.visualstudio.com/items?itemName=fcrespo82.markdown-table-formatter +[vscode_remote_ssh_extension]: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh \ No newline at end of file diff --git a/docs/packages/development/managing.md b/docs/packages/development/managing.md new file mode 100644 index 00000000..f5820d35 --- /dev/null +++ b/docs/packages/development/managing.md @@ -0,0 +1,151 @@ +# Managing the Repositories + +While many people contribute to our code-bases, this page is for the elect few who are responsible for maintaining them. +You will need access to the service accounts to make use of the information contained in this page. + +## Lintrack + +`lintrack` refers to the location of the codebase in the TN + +```bash +/afs/cern.ch/eng/sl/lintrack/ +``` + +as well as the service account handling the access to it. + +The service account was created as in the past direct access to these repositories lead to +accidental changes that affected all users. +Limiting access to the service account ensures an active decision to make modifications and thus avoids unwanted changes and binary or data loss, +which can be especially troublesome if only detected online during CCC measurements. + +You can log into the `lintrack` account with the following command: + +```bash +ssh lintrack@lxplus.cern.ch +``` + +You will then be greeted with a welcome message and some information about shortcuts we have set up for quick access and management of the repositories. + +!!! info "Access" + Due to CERN regulations, you cannot log into the `lintrack` account from outside the CERN network. + +### Repositories + +Local copies of the [github repositories][pylhc_github] are kept in `/afs/cern.ch/eng/sl/lintrack/omc_repos/`. +There is a shortcut available on the `lintrack` welcome screen to update all repositories. + +These repositories are used in the `python_edge` environment and might be modified online to test new features +or fix issues. + +!!! warning "Keeping them clean" + Changes to the repositories should be short lived and patched into the packages properly within a day or two and the repository reset to its original state. + In the past, changes made during shifts were often forgotten and after a while no one knew why the changes were made which version was the correct one to use. + +### Python Installations + +The python installations are located in `/afs/cern.ch/eng/sl/lintrack/omc_acc_py/`. +In this folder you can also find the `acc-py` installers as well as the `omc_requirements_*.txt` files to easily setup new environments. + +- `/afs/cern.ch/eng/sl/lintrack/omc_acc_py/base/` contains the base `acc-py` installations from which the environments are derived. +- In `/afs/cern.ch/eng/sl/lintrack/omc_acc_py/venv/` contains the environments. These are automatically picked up by the [BetaBeat GUI](../..//guis/betabeat/gui.md). + +The main environments are: + +- `omc_py3xx_releases`: The main production environment which is used for the CCC. All packages are installed via their official `pypi` release. +- `omc_py3xx_repos`: The development environment which is used for the testing of new packages. All packages are installed from the local `git` repositories. + +These two environments are also symlinked to `/afs/cern.ch/eng/sl/lintrack/omc_python3` and `/afs/cern.ch/eng/sl/lintrack/omc_python_edge` respectively. + +!!! info "TODO" + - If you want the newest version of a repository to be used in `python_edge` you need to pull the changes into the local repository manually (see also the `lintrack` welcome screen). + - Whenever there is a new release for one of the packages, it needs to be manually installed into the `omc_py3xx_releases` environment. + Shortcuts are available (see the `lintrack` welcome screen), but for single updates one can use `python -m pip install -U `. + - On new `acc-py` releases, a new base environment needs to be created and the `omc_py3xx_releases` and `omc_py3xx_repos` environments derived. + You can use the `omc_requirements_*.txt` files for this process. + To avoid issues, the former and new bases/environments can be kept in parallel for a while. + Don't forget to also update the symlinks. + +## Github + +The settings for the organization `pylhc` should be automatically available to you, if you have been given the right permissions (either `admin` or `code owner`). + +Our repositories use the [`.github`][pylhc_github_github] configuration repository to manage + +- Issue Templates +- Workflows +- Labels + +Of these, the workflow to [assign labels to all repositories][pylhc_labels_workflow] is special: +This workflow is triggered on pushes to the `master` branch of this repository and assigns +the [defined labels][pylhc_labels_json] to all repositories defined in the workflow. + +While the other workflows are usually triggered directly via workflow inheritance from the other repositories, e.g. via + +```yaml +jobs: + tests: + uses: pylhc/.github/.github/workflows/cron.yml@master +``` + +they automatically inherit the `GITHUB_TOKEN` of that repository and have access to that repositories data. +The labels-workflow does not have this access and is using a limited personal access token (PTA) instead, +which is saved as the `ISSUE_WRITE_TOKEN` secret. +This token is provided by the `pylhctokens` service account and needs to be renewed on a regular basis. + +!!! info "Update Github Actions!" + Many of the workflows are using pre-defined github actions.
    + Check them sometimes for updates and try to keep their versions up-to-date! + +### pylhctokens + +This service account was originally created to give workflows access to the repos, until github introduced the automatically generated `GITHUB_TOKEN`. +Nowadays we only use it to assign labels to all repositories. + +To log into the `pylhctokens` account you need password and 2FA authentication. + +### CODEOWNERS + +To avoid malicious or accidental changes to the repositories, the `master` branches are locked (Repo -> Settings -> Branch protection) +and reviews are required before pull requests can be merged. + +The approved reviewers are handled via the `approved-reviewers` group in the `pylhc` organization's teams +which are assigned as code owners to each repository. +For that purpose, each repository has a `CODEOWNERS` file, which can be found in the `.github` folder of the repository. + +For more details, see the [official documentation][github_codeowners]. + +## PyPI + +The access to [PyPI][pypi] is provided by the `pylhc` service account, for which you will need password and 2FA authentication. + +Publishing access is given to the github workflows via [API-Token][pypi_apitoken] (Settings -> Account Settings -> API Tokens) to all repositories of the `pylhc` organization. +This is done by using the [publish workflow][pylhc_publish] and passing the token as secret: + +- `PYPI_USERNAME` : `__token__` (literal string) +- `PYPI_PASSWORD` : the token value, including the pypi- prefix + +which are usually inherited from each of the repos publishing workflows. + +## Zenodo + +There is no special account for [Zenodo][zenodo] access. +Zenodo should be able to be reached with your normal account, preferrably your `github`, +which, if linked correctly, will allow Zenodo to also reach the `pylhc`-Organization repositories. + +To add a new repository to Zenodo, you need to make sure that the `.zenodo.json` file is correct (examples can be found in our repositories). +**Before making your first release**, you need to go into the [Zenodo github settings][zenodo_github] (down-arrow on your user on the top right) and follow the instructions there: + +- Flip the switch to `On` +- Create a release on `github` -> The page for your repo should now be visible on Zenodo! +- Add the `badge` to your `README.md` + +[pypi]: https://pypi.org +[zenodo]: https://zenodo.org +[zenodo_github]: https://zenodo.org/account/settings/github/ +[pylhc_github]: https://github.com/pylhc +[pylhc_github_github]: https://github.com/pylhc/.github +[pylhc_publish]: https://github.com/pylhc/.github/blob/master/.github/workflows/publish.yml +[pypi_apitoken]: https://pypi.org/help/#apitoken +[pylhc_labels_workflow]: https://github.com/pylhc/.github/blob/master/.github/workflows/assign_labels_to_all_repos.yml +[pylhc_labels_json]: https://github.com/pylhc/.github/blob/master/labels/labels.json +[github_codeowners]: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners \ No newline at end of file diff --git a/docs/packages/irnl/about.md b/docs/packages/irnl/about.md index 44058aa8..8d146e8f 100644 --- a/docs/packages/irnl/about.md +++ b/docs/packages/irnl/about.md @@ -2,7 +2,6 @@ [This package][repo] performs local correction of the Resonance Driving Terms (RDTs) in the Insertion Regions (IRs) based on the principle described in [^OBruning] with the addition of correcting feed-down and using feed-down to correct lower order RDTs. Details can be found in [^JDilly]. - ## Documentation - [Autogenerated docs][documentation] via ``sphinx``. @@ -20,10 +19,8 @@ After installing, codes can be run with either `python -m irnl-rdt-correction -- [repo]: https://github.com/pylhc/irnl_rdt_correction [documentation]: https://pylhc.github.io/irnl_rdt_correction/ - - [^OBruning]: - ??? abstract "Dynamic aperture studies for the LHC separation dipoles, `O. Bruning et al. `, [https://cds.cern.ch/record/742967](https://cds.cern.ch/record/742967){target=_blank}" + ??? abstract "Dynamic aperture studies for the LHC separation dipoles, `O. Bruning et al.`, [https://cds.cern.ch/record/742967](https://cds.cern.ch/record/742967){target=_blank}" ``` @techreport{Brüning:742967, author = "Brüning, Oliver Sim and Fartoukh, Stéphane David and diff --git a/docs/packages/mess/about.md b/docs/packages/mess/about.md index df9a4928..56c379bf 100644 --- a/docs/packages/mess/about.md +++ b/docs/packages/mess/about.md @@ -5,20 +5,20 @@ !!! todo Examples of are missing. Maybe just copy-paste of the `README.md` files in the repository. -### Getting Started +## Getting Started The scripts can be browsed via github or the full repository can be obtained either via `git clone https://github.com/pylhc/MESS.git` or downloading the zipped repository. -### Prerequisites +## Prerequisites To run the scripts, [MAD-X][madx] is required. If not otherwise stated, all scripts have been tested using MAD-X > 5.05.02. -### Documentation +## Documentation - Each script directory contains a ``README``, outlining the basic functionality and notes on possible pitfalls. - Excessive use of comments in the MAD-X scripts itself is encouraged. -### Maintainability +## Maintainability - The main scripts should be named ``job.madx`` and placed in an accordingly named directory in the directory tree. - Supporting files should be uploaded in the script directory. Links to external afs directories should be avoided as files might be modified there or removed. @@ -40,7 +40,7 @@ To run the scripts, [MAD-X][madx] is required. If not otherwise stated, all scri ## Authors -* **pyLHC/OMC-Team** - *Working Group* - [pyLHC][omc_team] +- **pyLHC/OMC-Team** - *Working Group* - [pyLHC][omc_team] ## License @@ -49,4 +49,4 @@ This project is licensed under the MIT License - see the [LICENSE][license] file [repo]: https://github.com/pylhc/MESS [madx]: https://mad.web.cern.ch/mad/ [omc_team]: https://github.com/orgs/pylhc/teams/omc-team -[license]: https://github.com/pylhc/MESS/blob/master/LICENSE \ No newline at end of file +[license]: https://github.com/pylhc/MESS/blob/master/LICENSE diff --git a/docs/packages/omc3/about.md b/docs/packages/omc3/about.md index ff584889..85cdeab4 100644 --- a/docs/packages/omc3/about.md +++ b/docs/packages/omc3/about.md @@ -9,13 +9,15 @@ The `omc3` repository is the new version of our codes, refactored and rewritten ## Installing -Installation is easily done via pip: +Installation is easily done via `pip`: + ```bash python -m pip install omc3 ``` Additionally, some features require access to the CERN Technical Network and require CERN-specific dependencies. Those are installable from the CERN `Acc-Py` index through the `cern` extra, and can be installed from the CERN network or by providing the `index-url`: + ```bash python -m pip install --index-url http://acc-py-repo.cern.ch:8081/repository/vr-py-releases/simple --trusted-host acc-py-repo.cern.ch "omc3[cern]" ``` diff --git a/docs/packages/omc3/analysis.md b/docs/packages/omc3/analysis.md index 8083998e..0ccabef4 100644 --- a/docs/packages/omc3/analysis.md +++ b/docs/packages/omc3/analysis.md @@ -20,7 +20,7 @@ The table below shows a general analysis workflow from BPM turn-by-turn measurem In this page, we will go through the essential steps in preparing and performing an analysis, by going from start to finish with a simple example. In this walk-through, we will cover the use of the different entrypoints available to perform necessary steps. -!!! example +!!! example For our walk-through example, we will start from data obtained in `MAD-X` with the `TRACK` command for the 1023 turns in the LHC machine, with a scenario adapted from the 2018 configuration. Changes from the nominal scenario in your simulation could be including errors tables, orbit bumps, speculative magnet errors, additional elements etc. It is also easy for the reader to follow along if starting from measurements files. @@ -29,16 +29,16 @@ In this walk-through, we will cover the use of the different entrypoints availab Here is the `MAD-X` script that will generate the example data used in this walk-through. It sets up a simple LHC configuration using files from `afs`, performs tracking and outputs a file named `trackone`. The script can be copy-pasted with a click in the top right of its box. - + For anyone without access to `afs`, you can find these files in our [MESS][mess] repository, or can simply use one of your own. ```fortran option, warn, info; option, echo=false, warn=false; - + ! ----- Set up Lattice and Define the Optics ----- ! call, file="/afs/cern.ch/eng/lhc/optics/runII/2018/lhc_as-built.seq"; ! needs AFS access call, file="/afs/cern.ch/eng/lhc/optics/runII/2018/PROTON/opticsfile.22"; ! needs AFS access - + ! ----- Re-Cycle Sequence as in the Model ----- ! seqedit, sequence=lhcb1; flatten; @@ -49,10 +49,10 @@ In this walk-through, we will cover the use of the different entrypoints availab beam, sequence=lhcb1, particle=proton, bv=1, energy=6500, npart=1e10, ex=5.4115e-10, ey=5.4115e-10; beam, sequence=lhcb2, particle=proton, bv=-1, energy=6500, npart=1e10, ex=5.4115e-10, ey=5.4115e-10; use, sequence=lhcb1; - + ! ----- Introduce Some Coupling ----- ! CMRS.b1_sq = 0.001; - + ! ----- Match Tunes and Chromaticities ----- ! match, chrom=true; global, sequence=lhcb1, q1=62.31, q2=60.32, dq1=2.0, dq2=2.0; @@ -62,13 +62,13 @@ In this walk-through, we will cover the use of the different entrypoints availab vary, name="dqpy.b1_sq", step=1e-07; lmdif, calls=100, tolerance=1e-21; endmatch; - + ! ----- Slice Lattice for Tracking ----- ! - slicefactor = 4; + slicefactor = 4; call, file="/afs/cern.ch/eng/lhc/optics/runII/2018/toolkit/myslice.madx"; ! needs AFS access use, sequence=lhcb1; makethin, sequence=lhcb1, style=teapot, makedipedge=false; - + ! ----- Define Observation Points and Perform Tracking ----- ! ! These points are the BPMs from the model's twiss.dat file use, sequence=lhcb1; @@ -650,6 +650,7 @@ The formats supported by the converter are: For our example, let us say that when setting up tracking we have asked `MAD-X` to output the data into a file called `trackone` (this is actually the default name). Using the converter to make a compatible `SDDS` file then goes as: + ```bash python -m omc3.tbt_converter \ --files trackone \ @@ -679,10 +680,10 @@ For this, `omc3` provides the `model_creator` entrypoint, which allows you to ru The out-of-the-box supported machines for model creation are `lhc`, `ps` and `psbooster`, machines we work on. While the `skekb`, `JPARC`, `petra` and `iota` have accelerator classes, no model creator has been implemented for them yet. It is possible to extend this list for your machine by defining an appropriate `Accelerator` class as well as a model creator. - See [this guide][new_machine_guide] for implementation steps. -In our example, we would like to compare our data to the nominal model of the 2018 LHC. +In our example, we would like to compare our data to the nominal model of the 2018 LHC. Using the script to create a nominal model of the 2018 LHCB1, with the machine configuration and opticsfile used in our example, goes as: + ```bash python -m omc3.model_creator \ --accel lhc \ @@ -700,30 +701,32 @@ Refer to the [model creator's API documentation][model_creator] for the list of The model creation runs a `MAD-X` scenario and outputs the relevant twiss results to the desired directory. Running `ls lhc_model/` yields: + ```bash -b2_errors.tfs error_deffs.txt macros twiss_elements.dat -b2_settings.madx job.create_model.madx twiss.dat +b2_errors.tfs error_deffs.txt macros twiss_elements.dat +b2_settings.madx job.create_model.madx twiss.dat ``` !!! question "What is a Model?" As one can see, a "model" is essentially one or more TFS files with optics functions at BPMs (`twiss.dat`) and elements (`twiss_elements.dat`), other files being here for the user to understand or reproduce the result. Had we created a driven model, then an additional `twiss_ac.dat` or `twiss_adt.dat` file would have been created, with optics functions at BPMs while driving the beam. - One can create their own models without the `model_creator` should they want to, as it only acts as a convenience wrapper. + One can create their own models without the `model_creator` should they want to, as it only acts as a convenience wrapper. A `driven model` is the same as above, with also a `TWISS` taking into account the exciting effect of an AC dipole or ADT onto the optics. - Creating this is easiest done with the `model_creator`, but can also be done individually with the a script installing the appropriate element into your sequence. + Creating this is easiest done with the `model_creator`, but can also be done individually with the a script installing the appropriate element into your sequence. ## Frequency Analysis Once measurement or simulation is in the appropriate format, the first step as seen in the table above consists in a harmonic analysis of the data. To do so, `omc3` provides the `hole_in_one` entrypoint, which will perform frequency analysis of the data when provided with the `--harpy` flag. -The script provides options involved in both data cleaning and parameter tweaking for the harmonic analysis, which is useful when you have relevant information about your measurements. +The script provides options involved in both data cleaning and parameter tweaking for the harmonic analysis, which is useful when you have relevant information about your measurements. To use these, refer to the `Harpy Kwargs` section of the [hole_in_one API documentation][hole_in_one]. In our example we will leave most of these to their default values to keep the analysis simple, but ask from `harpy` to output all computed results. We will input `lhc` for the `--tbt_datatype` flag, but if you skipped the use of the `tbt_converter` you should input the type of your machine there. Running the frequency analysis then goes as: + ```bash python -m omc3.hole_in_one --harpy \ --files trackone.sdds \ @@ -748,16 +751,17 @@ The filenames are determined by appending the appropriate suffixes to the entry !!! info "Bad BPMs" If given `bpm_summary` for the `--to_write` flag (which is the case by default), `harpy` will output the `.bad_bpms_[xy]` files. BPMs are determined as bad or not depending on several options from the cleaning phase. - While these are given sensible defaults, one might need to tweak them manually depending on their measurement. + While these are given sensible defaults, one might need to tweak them manually depending on their measurement. Additionally, known bad BPMs can be given with the `--bad_bpms` flag. In the output files, various properties are given in column form for each observation point. Running `ls harpy_output/` yields the following result: + ```bash -trackone.sdds.ampsx trackone.sdds.freqsx -trackone.sdds.ampsy trackone.sdds.freqsy -trackone.sdds.bad_bpms_x trackone.sdds.linx -trackone.sdds.bad_bpms_y trackone.sdds.liny +trackone.sdds.ampsx trackone.sdds.freqsx +trackone.sdds.ampsy trackone.sdds.freqsy +trackone.sdds.bad_bpms_x trackone.sdds.linx +trackone.sdds.bad_bpms_y trackone.sdds.liny ``` !!! tip "Plotting the Spectra" @@ -779,7 +783,7 @@ trackone.sdds.bad_bpms_y trackone.sdds.liny for bpm in ampsx.columns: if bpm in freqsx.columns: # safety check but no reason it wouldn't be there - plt.plot(freqsx[bpm], ampsx[bpm], ".-") + plt.plot(freqsx[bpm], ampsx[bpm], ".-") # plt.stem(freqsx[bpm], ampsx[bpm]) # would be more accurate but might stress your system plt.setp(plt.gca(), xlabel=r"$Q_x$", ylabel="Amplitude", title="Horizontal Spectrum", xlim=(0, 0.5)) @@ -788,7 +792,7 @@ trackone.sdds.bad_bpms_y trackone.sdds.liny The `*.lin[xy]` files contain various data (in columns) computed for each BPM (in rows) as some summary information. Some column names are explicit: `BPM_RES` contains the determined BPM resolution, `CO` the closed orbit value at said BPM and `PK2PK` is the peak-to-peak value of oscillations registered by the given BPM. `TUNE[XY]`, `AMP[XY]` and `MU[XY]` are the detected tune, the amplitude of the tune line and the phase of the tune line for said BPM, respectively. - + The other columns describe the phase (`PHASE`), amplitude ratio (`AMP`) and frequency (`FREQ`) of the line identified by the number in the column name, where underscores represent a minus sign. Therefore, in the `.linx` file `FREQ01`, `AMP01` and `PHASE01` are respectively the frequency of the main vertical tune line in the horizontal spectrum, the ratio of this line's amplitude to that of the main horizontal line and the phase of this line. The equivalent columns in the `.liny` file are `FREQ10`, `AMP10` and `PHASE10`. @@ -803,6 +807,7 @@ To do so, `omc3` provides the `hole_in_one` entrypoint, to be used this time wit In our example we will ask to use the `three_bpm_method` when reconstructing beta functions from phase advances, as the default `n_bpm_method` requires providing an error definition file which our simulation did not implement. Calling the entrypoint to perform optics analysis goes as: + ```bash python -m omc3.hole_in_one --optics \ --accel lhc \ @@ -826,13 +831,14 @@ To use these, refer to the `Optics Kwargs` section of the [hole_in_one API docum In the output files, various properties are given in column form for each observation point. Running `ls measured_optics/` yields the following result: + ```bash -beta_amplitude_x.tfs kick_x.tfs phase_y.tfs -beta_amplitude_y.tfs kick_y.tfs special_phase_x.tfs -beta_phase_x.tfs measure_optics.log special_phase_y.tfs -beta_phase_y.tfs orbit_x.tfs total_phase_x.tfs -interaction_point_x.tfs orbit_y.tfs total_phase_y.tfs -interaction_point_y.tfs phase_x.tfs +beta_amplitude_x.tfs kick_x.tfs phase_y.tfs +beta_amplitude_y.tfs kick_y.tfs special_phase_x.tfs +beta_phase_x.tfs measure_optics.log special_phase_y.tfs +beta_phase_y.tfs orbit_x.tfs total_phase_x.tfs +interaction_point_x.tfs orbit_y.tfs total_phase_y.tfs +interaction_point_y.tfs phase_x.tfs ``` --- @@ -841,7 +847,7 @@ interaction_point_y.tfs phase_x.tfs The harmonic analysis and optics analysis don't necessarily have to be separated steps. It is possible to run the `hole_in_one` entrypoint with both `--harpy` and `--optics` flags, even though the command might become cumbersome. The associated flags and options do not change, although only one `outputdir` should be given. - + Our example done in one step would be: ```bash python -m omc3.hole_in_one --harpy --optics \ @@ -862,11 +868,15 @@ interaction_point_y.tfs phase_x.tfs In this case, the output files from `harpy` are automatically handled and put into a subfolder named `lin_files` inside of the specified `outputdir`. The rest is done and output as seen above. +## Amplitude Detuning Analysis + +From the optics output files, in particular the `kick_[xy].tfs` files, one can perform amplitude detuning analysis. +The detailed steps to run this from the GUI are described in [the amplitude detuning analysis procedure](../../measurements/procedures/ampdet.md#analysis). + [mess]: https://github.com/pylhc/MESS [sdds]: https://ops.aps.anl.gov/SDDSIntroTalk/slides.html [tbt_converter]: https://pylhc.github.io/omc3/entrypoints/other.html#tbt-converter [plot_spectrum]: https://pylhc.github.io/omc3/entrypoints/plotting.html#plot-spectrum [normal_forms]: https://cds.cern.ch/record/333077/files/p93.pdf [hole_in_one]: https://pylhc.github.io/omc3/entrypoints/analysis.html#omc3.hole_in_one.hole_in_one_entrypoint -[new_machine_guide]: know_how.md#how-to-create-files-for-your-file-accelerator [model_creator]: https://pylhc.github.io/omc3/entrypoints/other.html#model-creator diff --git a/docs/packages/omc3/getting_started.md b/docs/packages/omc3/getting_started.md index c90a613c..a794dba4 100644 --- a/docs/packages/omc3/getting_started.md +++ b/docs/packages/omc3/getting_started.md @@ -3,24 +3,24 @@ ## Quick start The `omc3` package is `Python 3.7+` compatible, but not yet deployed to PyPI. -The best way to install is though pip and VCS: +The best way to install is though python -m pip and VCS: ```bash git clone https://github.com/pylhc/omc3 -pip install /path/to/omc3 +python -m pip install /path/to/omc3 ``` Or simply from the online master branch, which is stable: ```bash -pip install git+https://github.com/pylhc/omc3.git +python -m pip install git+https://github.com/pylhc/omc3.git ``` After installing, codes can be run with either `python -m omc3.SCRIPT --FLAG ARGUMENT` or calling path to the `.py` file directly. ## Functionality -#### Main Scripts +### Main Scripts Main scripts to be executed lie in the `/omc3` module directly. These include: @@ -31,7 +31,7 @@ Main scripts to be executed lie in the `/omc3` module directly. These include: - `tbt_converter.py` to convert different turn by turn datatypes to sdds, and add noise. - `amplitude_detuning_analysis.py` to perform amp. det. analysis on optics data with tune correction. -#### Plotting Scripts +### Plotting Scripts Plotting scripts for analysis outputs can be found in the `/omc3/plotting` submodule: @@ -41,7 +41,7 @@ Plotting scripts for analysis outputs can be found in the `/omc3/plotting` submo - `plot_optics_measurements.py` to generate plots from files generated by optics_measurements. - `plot_tfs.py` all purpose tfs-file plotter. -#### Other Scripts +### Other Scripts Other general utility scripts are in `/omc3/scripts` module: @@ -49,4 +49,4 @@ Other general utility scripts are in `/omc3/scripts` module: - `write_madx_macros.py` to generate `MAD-X` tracking macros with observation points from a twiss file. - `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. -A typical analysis workflow with `omc3` is described in the [next page](analysis.md). \ No newline at end of file +A typical analysis workflow with `omc3` is described in the [next page](analysis.md). diff --git a/docs/packages/omc3/know_how.md b/docs/packages/omc3/know_how.md deleted file mode 100644 index c1e18094..00000000 --- a/docs/packages/omc3/know_how.md +++ /dev/null @@ -1,10 +0,0 @@ -## How to create files for your file accelerator - -TODO: write a little howto about what should be written for a user wanting to add their own accelerator. - -## Drive vs Harpy - -TODO: gather here the differences between the two (factors, normalization etc). - -!!! note - Knowledge about `omc3` details and ways to do things. Should include info on all functionality, plus answers to things we mention in meetings or Mattermost. diff --git a/docs/packages/pylhc/about.md b/docs/packages/pylhc/about.md index 86cac24e..a5aa2f59 100644 --- a/docs/packages/pylhc/about.md +++ b/docs/packages/pylhc/about.md @@ -27,6 +27,7 @@ After installing, codes can be run with either `python -m pylhc.SCRIPT --FLAG AR Note: similarly to `omc3`, some of the scripts access functionality only available on the CERN Technical Network. To use those, you should make sure to install the relevant extra dependencies with: + ```bash python -m pip install --index-url http://acc-py-repo.cern.ch:8081/repository/vr-py-releases/simple --trusted-host acc-py-repo.cern.ch "pylhc[cern]"`. ``` diff --git a/docs/packages/pylhc/bpm_calibration.md b/docs/packages/pylhc/bpm_calibration.md index 5f351bd4..472e1225 100644 --- a/docs/packages/pylhc/bpm_calibration.md +++ b/docs/packages/pylhc/bpm_calibration.md @@ -3,7 +3,8 @@ The `bpm_calibration` module of `PyLHC` can be used to compute [BPM calibration factors][bpm_calibration]. Only one entrypoints exists for both methods, the argument `method` can be used to select it, and defaults to `beta`. Using the script to make compute calibration factors through $\beta$-functions for instance from IP1 and IP5 goes as: -```bash + +```bash python -m pylhc.bpm_calibration \ --input \ --output \ diff --git a/docs/packages/pylhc/bsrt.md b/docs/packages/pylhc/bsrt.md index 286de943..588a9fe1 100644 --- a/docs/packages/pylhc/bsrt.md +++ b/docs/packages/pylhc/bsrt.md @@ -16,11 +16,11 @@ The analysis script runs through the following steps: ## Logger -Script used during Run II to log detailed BSRT data and save it for later analysis. -Data from the BSRT for each timestep is put in a `dictionary` and append to a `list`. -The `list` is then saved to disk through pickling. +Script used during Run II to log detailed BSRT data and save it for later analysis. +Data from the BSRT for each timestep is put in a `dictionary` and append to a `list`. +The `list` is then saved to disk through pickling. Proper testing requires communication with ``FESA``s class, possible only from the Technical Network. *[BSRT]: Beam Synchrotron Radiation Telescope -[documentation]: https://pylhc.github.io/PyLHC/entrypoints/bsrt_analysis.html \ No newline at end of file +[documentation]: https://pylhc.github.io/PyLHC/entrypoints/bsrt_analysis.html diff --git a/docs/packages/pylhc/forced_da.md b/docs/packages/pylhc/forced_da.md index 2273f516..f186f5e5 100644 --- a/docs/packages/pylhc/forced_da.md +++ b/docs/packages/pylhc/forced_da.md @@ -62,4 +62,4 @@ Arguments: Default: ``{}`` [documentation]: https://pylhc.github.io/PyLHC/entrypoints/forced_da_analysis.html -[CarlierForcedDA2019]: https://journals.aps.org/prab/pdf/10.1103/PhysRevAccelBeams.22.031002 \ No newline at end of file +[CarlierForcedDA2019]: https://journals.aps.org/prab/pdf/10.1103/PhysRevAccelBeams.22.031002 diff --git a/docs/packages/pylhc/kickgroups.md b/docs/packages/pylhc/kickgroups.md index 7452971b..27037e21 100644 --- a/docs/packages/pylhc/kickgroups.md +++ b/docs/packages/pylhc/kickgroups.md @@ -1,6 +1,5 @@ # Display kickgroups - !!! todo Description of a typical use-case, with easy examples for first-timers. @@ -8,7 +7,6 @@ Loads available kick-groups in a folder and displays relevant information. +*[kick-groups]: list of beam excitations performed that represent either the same machine state or are paired for ease of analysis. [documentation]: https://pylhc.github.io/PyLHC/index.html - -*[kick-groups]: list of beam excitations performed that represent either the same machine state or are paired for ease of analysis \ No newline at end of file diff --git a/docs/packages/pylhc/machine_settings_info.md b/docs/packages/pylhc/machine_settings_info.md index 639a5d1d..446de321 100644 --- a/docs/packages/pylhc/machine_settings_info.md +++ b/docs/packages/pylhc/machine_settings_info.md @@ -2,8 +2,7 @@ [See the docs][documentation] for a detailed code description. -Prints an overview over the machine settings at a provided given time, or the current settings if -no time is given. +Prints an overview over the machine settings at a provided given time, or the current settings if no time is given. Can be run from command line, parameters as given in `machine_settings_info.main`. @@ -32,7 +31,6 @@ optional arguments: (automatically done if no output path is given). ``` - !!! tip "Usage Examples" Displaying basic summary information (beam process, fill, optics etc.), right now: ```bash @@ -49,4 +47,4 @@ optional arguments: python -m pylhc.machine_settings_info --knobs default --time "2022-10-19 17:00:00.0" --output_dir . ``` -[documentation]: https://pylhc.github.io/PyLHC/entrypoints/machine_info.html \ No newline at end of file +[documentation]: https://pylhc.github.io/PyLHC/entrypoints/machine_info.html diff --git a/docs/packages/pylhcsubmitter/about.md b/docs/packages/pylhcsubmitter/about.md index 752dcb00..363fd6b1 100644 --- a/docs/packages/pylhcsubmitter/about.md +++ b/docs/packages/pylhcsubmitter/about.md @@ -19,12 +19,14 @@ - `Linux` through `PyPI`. - `Linux` and `macOS` through `conda-forge`. -Installation is easily done via pip: +Installation is easily done via `pip`: + ```bash python -m pip install pylhc-submitter ``` One can also install in a conda environment via the conda-forge channel with: + ```bash conda install -c conda-forge pylhc_submitter ``` @@ -38,4 +40,4 @@ After installing, codes can be run with either - by calling the main function in a Python script. [repo]: https://github.com/pylhc/submitter -[documentation]: https://pylhc.github.io/submitter/ \ No newline at end of file +[documentation]: https://pylhc.github.io/submitter/ diff --git a/docs/packages/pylhcsubmitter/autosix.md b/docs/packages/pylhcsubmitter/autosix.md index 51899227..163a6e1c 100644 --- a/docs/packages/pylhcsubmitter/autosix.md +++ b/docs/packages/pylhcsubmitter/autosix.md @@ -60,7 +60,7 @@ In theory, any kind of mask is possible, given the correct `executable` is provi twiss; sixtrack, cavall, radius=0.017; ``` - + Python masks using `cpymad` can do the same task with: ```python from cpymad.madx import Madx @@ -109,4 +109,4 @@ It will pick up where it left as written in the **stages\_completed.txt** file. It is used for the basic polar plotting in the `post_process` stage, but provides more customization features if called manually. Details on its use can be found at the `PyLHC Submitter` API documentation. -[documentation]: https://pylhc.github.io/submitter/entrypoints/submitter.html#autosix \ No newline at end of file +[documentation]: https://pylhc.github.io/submitter/entrypoints/submitter.html#autosix diff --git a/docs/packages/pylhcsubmitter/job_submitter.md b/docs/packages/pylhcsubmitter/job_submitter.md index 52d5323e..a9e9c6ed 100644 --- a/docs/packages/pylhcsubmitter/job_submitter.md +++ b/docs/packages/pylhcsubmitter/job_submitter.md @@ -67,7 +67,7 @@ Parameters in the template script (see below) are indicated in the `%(PARAMETER) ??? success "Recommended Method" Starting studies from Python is the recommended method, especially with a high number of parameters. - As we will see later on, other methods methods require all parameter values to be written down while the pythonic way allows for an easier and clearer definition of the parameter space. + As we will see later on, other methods methods require all parameter values to be written down while the pythonic way allows for an easier and clearer definition of the parameter space. The parametrizing of simulations and submission to `HTCondor` through Python is as simple as calling the `main` function of the submitter with the desired parameters. See below: @@ -190,7 +190,7 @@ After submitting our tune sweep studies, we can check the status of our jobs via The output should look something like this:
    - + Jobs in the condor queue
    condor_q: Shows the jobs in the condor queue.
    diff --git a/docs/resources/computing.md b/docs/resources/computing.md index 4cdea512..bd9fbfad 100644 --- a/docs/resources/computing.md +++ b/docs/resources/computing.md @@ -1,6 +1,6 @@ # Computing Resources for ABP and OMC Members -This page combines information and links to computing resources for OMC members. +This page combines information and links to computing resources for OMC members. ## The Dev & Optics Servers @@ -43,7 +43,7 @@ The servers are hooked on to the Technical Network and can only be ssh into from ## HTCondor CERN provides a batch service based on [HTCondor][htcondor]{target=_blank}. -Computing jobs that run on individual nodes with up to 32 CPU cores per node can be submitted to the CERN batch service. +Computing jobs that run on individual nodes with up to 32 CPU cores per node can be submitted to the CERN batch service. A good documentation can be found on the [batch docs website][cern_htcondor_docs]{target=_blank}. The OMC team maintains a python package, [pylhc_submitter](../packages/pylhcsubmitter/about.md), that can be used to submit jobs to the `HTCondor` batch service. diff --git a/docs/resources/faqs.md b/docs/resources/faqs.md index 8eefee6f..ae266c3c 100644 --- a/docs/resources/faqs.md +++ b/docs/resources/faqs.md @@ -1,39 +1,12 @@ # Frequently Asked Questions -!!! info +!!! info We are gradually including here different pieces of useful information, possibly from questions answered in meetings or on Mattermost, which don't really fit anywhere else as their whole page. -## Beta-Beat.src Caveats - -### Meaning of Beta-Beat.src Output Files - -The naming of output files in Beta-Beat.src analysis can be very unintuitive. -Namely, one will see similar output files for a quantity which go as `get_*.out`, `get_*_free.out` and `get_*_free2.out`, where `*` is the calculated quantity (betas, phase, etc.). -These each correspond to a variation of the calculated quantity, explained below. - -When doing our measurements, we use AC-Dipole driven excitations of the beam for a better signal-to-noise ratio in data acquisition. -However, as the AC-Dipole has an effect on the beam optics functions the reconstructed optics from these measurements are the driven optics, not those of the accelerator itself. -One can compensate for this deviation in different ways, which is why there are several output files for each optics quantity computed. - -!!! example "Meaning of Different Output Files" - | Nomenclature | Meaning | - | :---------------- | :------------------------------------------------------------------------------------------------------------- | - | `get_*.out` | The optics functions **without** compensation, from the driven excitation data. | - | `get_*_free.out` | The optics functions compensated **analytically** using an equation[^MiyamotoMeasurementCouplingRDTsACDipole]. | - | `get_*_free2.out` | The optics functions compensated **the other way**, see bellow. | - - In the case of the `get_*_free2.out` files, the compensation is done differently depending on the computed quantity. - For some quantities (for instance for $\beta$ from phase) this uses the model values, for others (for instance the coupling RDTs $f_{1001}$ and $f_{1010}$) it is a rescaling in which the model values are used *indirectly*. - -The method used to output the `get_*_free2.out` files is sometimes more robust as it does not rely on the existence of certain BPMs in the output (which could be missing after cleaning), and in some edge cases is more accurate[^HoydalsvikSubPerMilCouplingLHC]. - -!!! tip "Do Compare Outputs" - For debugging purposes, if the final result looks unbelievable, it might be of advantage to check the uncompensated output to rule out (or confirm) a failure in the recalibration method. - ## MAD-X Pitfalls `MAD-X` can sometimes be a bit tricky to work with. -This section is intended to put together some common pitfalls encountered when creating a MAD-X script. +This section is intended to put together some common pitfalls encountered when creating a MAD-X script. !!! warning "MAD-X Errors" As a reminder, `MAD-X` ignores all the code that does not work. @@ -57,7 +30,7 @@ There is no such caveat for tracking with beam 1, which is why there is no "beam === "Beam 1" Tracking for Beam 1 does not have any caveat: - + - Load the `lhc.seq` sequence file - Create your beam for the `lhcb1` sequence with the `bv=1` flag - Slice the `lhcb1` sequence and track @@ -68,7 +41,7 @@ There is no such caveat for tracking with beam 1, which is why there is no "beam - Load the `lhcb4.seq` sequence file - Create your beam for the `lhcb2` sequence with the `bv=1` flag - Slice the `lhcb2` sequence and track - + !!! tip "What about model creation?" If analysing the tracking data with either `Beta-Beat.src` or `omc3`, one will need a model. The model **has** to have been made with the regular `lhc.seq` file, `lhcb2` sequence, and a beam with `bv=-1`. @@ -85,49 +58,14 @@ This is due to the fact that `pjlsa` will look for the beamprocess at the given - Do not extract knobs if you are only after the summary information (this is now default behaviour) - Only ask for the knobs you need (e.g. `--knobs name1 name1`), or just default ones (e.g. `--knobs default`) if you're unsure - Give a time range that is as small as possible using the `--start-time` and `--time` flags. This way a small trim history will be queried by `pjlsa`. For instance: - + ```bash python -m pylhc.machine_settings_info \ --knobs name1 name2 \ # with real names ;) --start-time "2022-10-19 17:00:00.0" \ --time "2022-10-19 17:30:00.0" ``` - - Be aware though that if no trim for the knobs are in the defined time range, no values will be returned at all. + Be aware though that if no trim for the knobs are in the defined time range, no values will be returned at all. -[^MiyamotoMeasurementCouplingRDTsACDipole]: - ??? abstract "Measurement of Coupling Resonance Driving Terms with the AC Dipole", `R. Miyamoto`, [BNL--94350-2010-IR, 1013520](https://www.bnl.gov/isd/documents/74582.pdf){target=_blank}" - ``` - @report{MiyamotoMeasurementCouplingRDTsACDipole, - title = {Measurement of {{Coupling Resonance Driving Terms}} with the {{AC Dipole}}}, - author = {Miyamoto, R.}, - year = 2010, - month = 10, - number = {BNL--94350-2010-IR, 1013520}, - doi = {10.2172/1013520}, - url = {https://www.bnl.gov/isd/documents/74582.pdf}, - langid = {english} - } - ``` - -[^HoydalsvikSubPerMilCouplingLHC]: - ??? abstract "Reaching the Sub Per Mil Level Coupling Corrections in the LHC", `E. Høydalsvik and T. Persson`, [IPAC 2021](https://accelconf.web.cern.ch/ipac2021/papers/thpab001.pdf){target=_blank}" - ``` - @inproceedings{IPAC:Hoydalsvik:SubPerMilCouplingLHC, - title = {Reaching the {{Sub Per Mil Level Coupling Corrections}} in the {{LHC}}}, - author = {Høydalsvik, Eirik and Persson, Tobias}, - booktitle = {Proceedings of the 12th {{International Particle Accelerator Conference}}}, - publisher = {{JACoW Publishing, Geneva, Switzerland}}, - volume = {IPAC2021}, - doi = {10.18429/JACOW-IPAC2021-THPAB001}, - isbn = {978-3-95450-214-1}, - url = {https://accelconf.web.cern.ch/ipac2021/papers/thpab001.pdf}, - date = 2021, - langid = {english} - } - ``` - - - -[madx_doc]: http://madx.web.cern.ch/madx/releases/last-rel/madxuguide.pdf \ No newline at end of file +[madx_doc]: http://madx.web.cern.ch/madx/releases/last-rel/madxuguide.pdf diff --git a/docs/howto/setup/git.md b/docs/resources/git_setup.md similarity index 97% rename from docs/howto/setup/git.md rename to docs/resources/git_setup.md index 3311103b..f691dfc9 100644 --- a/docs/howto/setup/git.md +++ b/docs/resources/git_setup.md @@ -38,7 +38,7 @@ _Steps to be done on AFS:_ ??? nodeco "5. Run: `find . -type d -exec fs sa {} ACCOUNTNAME rlidw \;`" Run **within** the repository or replace `.` with the repository name!
    - Replace `ACCOUNTNAME` with the name of your Service Account. + Replace `ACCOUNTNAME` with the name of your Service Account. This will give read/write access to this repository to the service account. Just giving these rights to the top-folder will not work, as it does not propagate to subfolders automatically. @@ -65,7 +65,7 @@ _Steps to be done on your [Gitlab][cern_gitlab]{target=_blank} repository:_ For obvious reasons, **DO NOT WRITE THE PASSWORD IN CLEAR TEXT INTO THE YAML**. !!! danger "Security Risk!" - **MAKE SURE AT LEAST THE `SERVICE_ACCOUNT_PASSWORD ` VARIABLE IS SET TO `Masked` !!!** + **MAKE SURE AT LEAST THE `SERVICE_ACCOUNT_PASSWORD` VARIABLE IS SET TO `Masked` !!!** ??? nodeco "8. Add a new stage to your `.gitlab-ci.yml` file, or create a new one." ```yaml @@ -97,17 +97,17 @@ _Steps to be done on your [Gitlab][cern_gitlab]{target=_blank} repository:_ ??? note "More Info on the YAML" The `.yml` was copied and adapted from the [acc-models-lhc repository][acc_models_repo]{target=_blank} with some changes. In general, a Docker image is loaded, `openssh` is installed and a Kerberos token is created. - With this token it is now possible to `ssh` to lxplus as the service account, go into the desired directory and checkout the repository. + With this token it is now possible to `ssh` to lxplus as the service account, go into the desired directory and checkout the repository. `git checkout master` is only performed in case someone changed the branch on AFS (which should not happen, do not touch). - **Image**: The image `gitlab-registry.cern.ch/linuxsupport/cc7-base` used is the default Cern Centos 7 docker image, provided by [Linux @ CERN][cern_linux]{target=_blank}. This is used, because it has Kerberos already set up and configured. The [acc-models yaml][acc_models_yml]{target=_blank} was using [their own docker image][acc_models_docker], of which the only additional functionality we need is `openssh`, hence it is installed manually instead. - **echo lxplus ssh-rsa** line: This line adds the public key of the lxplus server to the ssh `known_hosts` file, so it connects to lxplus without user interaction about this topic (do not touch). - - **echo -e Host** line: Here the ssh `config` is adapted to use Kerberos as authetication method to any server (do not touch). - - **only master**: Only the commits to `master` trigger the CI. Omit this part if you want the repo to be pulled on every commit, or change it to limit upon which commits this happens (as is done in the [acc-models yml][acc_models_yml]{target=_blank}). + - **echo -e Host** line: Here the ssh `config` is adapted to use Kerberos as authetication method to any server (do not touch). + - **only master**: Only the commits to `master` trigger the CI. Omit this part if you want the repo to be pulled on every commit, or change it to limit upon which commits this happens (as is done in the [acc-models yml][acc_models_yml]{target=_blank}). -### Done! +### Done Whenever you are pushing now any commits to the `master` branch, the CI/CD will automatically pull the latest commit into the AFS directory. @@ -121,7 +121,6 @@ Whenever you are pushing now any commits to the `master` branch, the CI/CD will *[lxplus]: Linux Public Login User Service [sshuttle]: https://sshuttle.readthedocs.io/en/stable/ - [new_account]: https://account.cern.ch/account/Management/NewAccount.aspx [afs_services]: https://resources.web.cern.ch/resources/Manage/AFS/Default.aspx [github]: https://github.com/ @@ -129,4 +128,4 @@ Whenever you are pushing now any commits to the `master` branch, the CI/CD will [cern_linux]: https://linux.web.cern.ch/dockerimages/ [acc_models_repo]: https://gitlab.cern.ch/acc-models/acc-models-lhc/ [acc_models_yml]: https://gitlab.cern.ch/acc-models/acc-models-lhc/-/blob/2018/.gitlab-ci.yml -[acc_models_docker]: https://gitlab.cern.ch/acc-models/acc-models-www/-/blob/master/_docker/Dockerfile_cern_cc7_base \ No newline at end of file +[acc_models_docker]: https://gitlab.cern.ch/acc-models/acc-models-www/-/blob/master/_docker/Dockerfile_cern_cc7_base diff --git a/docs/resources/links.md b/docs/resources/links.md index 689e9c91..40ef41f4 100644 --- a/docs/resources/links.md +++ b/docs/resources/links.md @@ -38,7 +38,6 @@ The releases can also be explored on the [CAS][cas_main]{target=_blank .cern_internal} webpage. - !!! warning All of these are only accessible from CERN Network . @@ -53,7 +52,7 @@ The releases can also be explored on the [CAS][cas_main]{target=_blank .cern_int ```bash jws https://bewww.cern.ch/ap/deployments-dev/applications/cern/lhc/lhc-app-beta-beating/PRO/BetaBeating-Control-3t.jnlp ``` - + === "Beta-Beat-OMC3" _PRO_ @@ -117,7 +116,7 @@ The releases can also be explored on the [CAS][cas_main]{target=_blank .cern_int * [Setup HTCondor for local use][htcondor_local]{target=_blank} * [More HTCondor hints in the Python wrapper][htcondor_python]{target=_blank} -## CERN +## CERN ### Webtools diff --git a/docs/resources/presentations.md b/docs/resources/presentations.md index 95487feb..7f3d0b8b 100644 --- a/docs/resources/presentations.md +++ b/docs/resources/presentations.md @@ -3,13 +3,13 @@ This page contains a collection of important presentations that have been by different members of the OMC-Team over the years. In general (e.g. if a presentation is not listed here) CERN-internal presentation can be found with a bit of searching on indico: - * [OMC Team Indico][omc_indico]{target=_blank} * [BE-ABP-LNO Indico][lno_indico]{target=_blank} * [BE-Seminars Indico][be_seminars_indico]{target=_blank} External presentations and seminars are collected on EOS and can be reached either directly or via [CERNBOX][cernbox_seminars]{target=_blank .cern_login}: -``` + +```bash /eos/project-o/omc/seminars ``` @@ -20,71 +20,64 @@ External presentations and seminars are collected on EOS and can be reached eith **Always cite your sources!** - ## Introduction Seminars -### 2021 +### 2021 Seminars ??? Abstract "*Increasing efficiency and stability of LHC/HL-LHC operation by corrections of high-order nonlinearities* `J. Dilly`" **Date:** 21.09.2021 **Location:** Accelerator and Technology Seminar, Helmholtz-Zentrum Berlin - + **Data:** Slides: `presentation.pdf` in [CERNBOX][jdilly2021HZB]{target=_blank .cern_login} ``` /eos/project-o/omc/seminars/2021-09-21.jdilly.increasing_efficiency_and_stability_of_lhc_hllhc_operation ``` - + ??? Abstract "*Corrections of high-order nonlinearities in the LHC and HL-LHC* `J. Dilly`" **Date:** 17.03.2021 **Location:** DPG Spring Meetings - + **Data:** Slides: `presentation.pdf` in [CERNBOX][jdilly2021DPG]{target=_blank .cern_login} ``` /eos/project/o/omc/seminars/2021-03-17.jdilly.DPG_spring.corrections_of_high-order_nonlinearities_in_the_LHC_and_HL-LHC ``` - -### 2020 + +### 2020 Seminars ??? Abstract "*LHC optics measurements and corrections: A local observable for linear imperfections in circular accelerators* `A. Wegscheider`" **Date:** 29.04.2020 **Location:** Gentner Day, CERN - + **Data:** Slides: `gentner_andreas.pdf` in [CERNBOX][awegsche2020Gentner]{target=_blank .cern_login} ``` /eos/project-o/omc/seminars/2020-04-29.awegsche.gentner.omc_and_lobster ``` -### 2019 +### 2019 Seminars ??? Abstract "*Accelerator Physics and the LHC* `E. H. Maclean`" **Date:** 25.07.2019 - **Location:** HASCO, Göttingen - + **Location:** HASCO, Göttingen + **Data:** [Slides][emaclean2019HASCOSlides]{target=_blank} from the [Seminar][emaclean2019HASCO]{target=_blank} ``` /eos/project-o/omc/seminars/2019-07-25.emaclean.acclerator_physics_and_the_lhc ``` - ## BE-Seminars -### 2020 +### 2020 BE Seminars ??? Abstract "*Highlights from beam-based studies of nonlinear optics in the LHC and implications for HL-LHC* `E. H. Maclean`" **Date:** 31.01.2020 **Location:** CERN - - **Data:** [Slides][emaclean2020BESeminarSlides]{target=_blank} from the [Seminar][emaclean2020BESeminar]{target=_blank} - - -## Important OMC Presentations - + **Data:** [Slides][emaclean2020BESeminarSlides]{target=_blank} from the [Seminar][emaclean2020BESeminar]{target=_blank} [omc_indico]: https://indico.cern.ch/category/5986/ [lno_indico]: https://indico.cern.ch/category/13266/ diff --git a/docs/resources/publications.md b/docs/resources/publications.md index 57f372fe..bee75292 100644 --- a/docs/resources/publications.md +++ b/docs/resources/publications.md @@ -3,7 +3,6 @@ This page compiles various published papers, reports, and MD notes from OMC team members. - ???+ info "Adding New Entries" To add new entries, please use an `abstract` admonition: @@ -19,9 +18,9 @@ This page compiles various published papers, reports, and MD notes from OMC team ## Journal Publications -### 2024 +### 2024 Papers -### 2023 +### 2023 Papers ??? abstract "First Operational Dodecapole Correction in the LHC, `J. Dilly et al.`, [Phys. Rev. Accel. Beams 26, 121001, 2023](https://link.aps.org/doi/10.1103/PhysRevAccelBeams.26.121001){target=_blank}" ``` @@ -58,7 +57,7 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` -### 2022 +### 2022 Papers ??? abstract "Prospects for Beam-Based Study of Dodecapole Nonlinearities in the CERN High-Luminosity Large Hadron Collider, `E. H. Maclean, F.S. Carlier, J. Dilly, M. Le Garrec, M. Giovannozzi, and R. Tomás`, [Eur. Phys. J. Plus (2022) 137:1249](https://link.springer.com/article/10.1140/epjp/s13360-022-03367-2){target=_blank}" ``` @@ -94,7 +93,7 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` -### 2021 +### 2021 Papers ??? abstract "Supervised Learning-Based Reconstruction of Magnet Errors in Circular Accelerators", `E. Fol, R. Tomás and G. Franchetti`, [Eur. Phys. J. Plus (2021) 136:365](https://link.springer.com/article/10.1140/epjp/s13360-021-01348-5){target=_blank}" ``` @@ -112,7 +111,7 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` -### 2020 +### 2020 Papers ??? abstract "Detection of Faulty Beam Position Monitors Using Unsupervised Learning, `E. Fol, R. Tomás, J. Coello de Portugal, and G. Franchetti`, [Phys. Rev. Accel. Beams 23, 102805, 2020](https://journals.aps.org/prab/abstract/10.1103/PhysRevAccelBeams.23.102805){target=_blank}" ``` @@ -311,7 +310,8 @@ This page compiles various published papers, reports, and MD notes from OMC team url = {https://link.aps.org/doi/10.1103/PhysRevAccelBeams.23.011001} } ``` -### 2019 + +### 2019 Papers ??? abstract "HE-LHC: The High-Energy Large Hadron Collider, `A. Abada et al.`, [Eur. Phys. J. Spec. Top. **228**, 2019](https://doi.org/10.1140/epjst/e2019-900088-6){target=_blank}" ``` @@ -441,7 +441,7 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` -### 2018 +### 2018 Papers ??? abstract "Towards Future Circular Colliders, `R. Tomas, M. Benedikt, M. Hofer, J. Keintzel, and F. Zimmermann`, [SISSA Medialab **321**, 2018](https://pos.sissa.it/321/268){target=_blank}" ``` @@ -582,7 +582,7 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` -### 2017 +### 2017 Papers ??? abstract "Local Correction of Quadrupole Errors at LHC Interaction Regions Using Action and Phase Jump Analysis on Turn-By-Turn Beam Position Data, `J. Cardona, A. García Bonilla, and R. Tomás`, [Phys. Rev. Accel. Beams **20**, 2017](https://link.aps.org/doi/10.1103/PhysRevAccelBeams.20.111004){target=_blank}" ``` @@ -740,7 +740,7 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` -### 2016 +### 2016 Papers ??? abstract "High Luminosity LHC: Challenges and Plans, `G. Arduini et al.`, [J. Inst. **11**, 2016](http://stacks.iop.org/1748-0221/11/i=12/a=C12081){target=_blank}" ``` @@ -933,7 +933,7 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` -### 2015 +### 2015 Papers ??? abstract "First Measurement and Correction of Nonlinear Errors in the Experimental Insertions of the CERN Large Hadron Collider, `E. Maclean, R. Tomás, M. Giovannozzi, and T. Persson`, [Phys.Rev. ST Accel.Beams **18**, 2015](https://doi.org/10.1103/PhysRevSTAB.18.121002){target=_blank}" ``` @@ -986,7 +986,7 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` -### 2014 +### 2014 Papers ??? abstract "Mitigation of Ground Motion Effects in Linear Accelerators via Feed-Forward Control, `J. Pfingstner et al.`, [Phys. Rev. ST Accel. Beams **17**, 2014](https://link.aps.org/doi/10.1103/PhysRevSTAB.17.122801){target=_blank}" ``` @@ -1208,7 +1208,7 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` -### 2013 +### 2013 Papers ??? abstract "Application of Independent Component Analysis to AC Dipole Based Optics Measurement and Correction at the Relativistic Heavy Ion Collider, `X. Shen et al.`, [Phys. Rev. ST Accel. Beams **16**, 2013](https://link.aps.org/doi/10.1103/PhysRevSTAB.16.111001){target=_blank}" ``` @@ -1276,7 +1276,7 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` -### 2012 +### 2012 Papers ??? abstract "A Large Hadron Electron Collider at CERN Report on the Physics and Design Concepts for Machine and Detector, `J. Fernandez et al.`, [J. Phys. G: Nucl. Part. Phys. **39**, 2012](https://doi.org/10.1088\%2F0954-3899\%2F39\%2F7\%2F075001){target=_blank}" ``` @@ -1332,7 +1332,7 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` -### 2011 +### 2011 Papers ??? abstract "Response of Colliding Beam-Beam System to Harmonic Excitation Due to Crab-Cavity Rf Phase Modulation, `K. Ohmi et al.`, [Phys. Rev. ST Accel. Beams **14**, 2011](https://link.aps.org/doi/10.1103/PhysRevSTAB.14.111003){target=_blank}" ``` @@ -1368,7 +1368,7 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` -### 2010 +### 2010 Papers ??? abstract "LHC Optics Model, Measurements and Corrections, `R. Tomás et al.`, 2010, URL: [https://cds.cern.ch/record/1269904](https://cds.cern.ch/record/1269904){target=_blank}" ``` @@ -1433,7 +1433,7 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` -### 2009 +### 2009 Papers ??? abstract "Beam Dynamics Aspects of Crab Cavities in the CERN Large Hadron Collider, `Y. Sun et al.`, [Phys. Rev. ST Accel. Beams **12**, 2009](https://link.aps.org/doi/10.1103/PhysRevSTAB.12.101002){target=_blank}" ``` @@ -1483,7 +1483,7 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` -### 2007 +### 2007 Papers ??? abstract "Emittance Sharing and Exchange Driven by Linear Betatron Coupling in Circular Accelerators, `A. Franchi, E. Métral, and R. Tomás`, [Phys. Rev. ST Accel. Beams **10**, 2007](https://journals.aps.org/prab/abstract/10.1103/PhysRevSTAB.10.064003){target=_blank}" ``` @@ -1536,7 +1536,7 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` -### 2006 +### 2006 Papers ??? abstract "Nonlinear Optimization of Beam Lines, `R. Tomás`, [Phys. Rev. ST Accel. Beams **9**, 2006](https://link.aps.org/doi/10.1103/PhysRevSTAB.9.081001){target=_blank}" ``` @@ -1554,7 +1554,7 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` -### 2005 +### 2005 Papers ??? abstract "Measurement of Global and Local Resonance Terms, `R. Tomás et al.`, [Phys. Rev. ST Accel. Beams **8**, 2005](https://link.aps.org/doi/10.1103/PhysRevSTAB.8.024001){target=_blank}" ``` @@ -1607,7 +1607,7 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` -### 2004 +### 2004 Papers ??? abstract "Decoherence of a Longitudinally Kicked Beam With Chromaticity, `G. Rumolo, and R. Tomás`, [Nucl. Instrum. Methods Phys. Res **528**, 2004](http://www.sciencedirect.com/science/article/pii/S0168900204009830){target=_blank}" ``` @@ -1644,7 +1644,7 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` -### 2002 +### 2002 Papers ??? abstract "Normal Form of Particle Motion Under the Influence of an AC Dipole, `R. Tomás`, [Phys. Rev. ST Accel. Beams **5**, 2002](https://link.aps.org/doi/10.1103/PhysRevSTAB.5.054001){target=_blank}" ``` @@ -1686,16 +1686,14 @@ This page compiles various published papers, reports, and MD notes from OMC team url = "https://cds.cern.ch/record/2290899", } ``` + ## MD Notes ### Run III -#### 2024 - -#### 2023 - -#### 2022 +#### 2024 Notes +#### 2023 Notes ??? abstract "MD6864 --- Decapole Studies at Injection, `M. Le Garrec et al.`, 2023, URL: [CERN-ACC-NOTE-2023-0018](https://cds.cern.ch/record/2879070){target=_blank}" ``` @@ -1711,6 +1709,8 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` +#### 2022 Notes + ??? abstract "Report From LHC MD 6863: Amplitude Detuning Corrections From Feed-Down, `J. Dilly, M. Garrec, E. Maclean, L. van Riesen-Haupt, and R. Tomas`, 2023, [CERN-ACC-NOTE-2023-0028](https://cds.cern.ch/record/2913600){target=_blank}" ``` @techreport{DillyReportLHCMD2023, @@ -1726,13 +1726,11 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` -#### 2021 - +#### 2021 Notes ### Run II -#### 2018 - +#### 2018 Notes ??? abstract "Report From LHC MD 3312: Replicating HL-LHC DA, `J. Dilly et al.`, 2022, URL: [CERN-ACC-NOTE-2022-0021](https://cds.cern.ch/record/2824571){target=_blank}" ``` @@ -1810,7 +1808,7 @@ This page compiles various published papers, reports, and MD notes from OMC team } ``` -#### 2017 +#### 2017 Notes ??? abstract "MD 2563: Optics Measurement and Corrections with Half Integer Tune, `A. Wegscheider et al.`, [CERN-ACC-NOTE-2018-0055](https://cds.cern.ch/record/2632258){target=_blank}" ``` diff --git a/docs/howto/teleworking/access.md b/docs/resources/remote_access.md similarity index 96% rename from docs/howto/teleworking/access.md rename to docs/resources/remote_access.md index 50ba5543..cafbef49 100644 --- a/docs/howto/teleworking/access.md +++ b/docs/resources/remote_access.md @@ -12,7 +12,7 @@ ssh -D 8090 username@lxtunnel.cern.ch The above command opens a tunnel at port `8090` which can be accessed via browser through `localhost:8090`. -## Accessing Journal Papers etc. +## Accessing Journal Papers Lots of journals and resources can be accessed via the `CERN ezproxy` by prepending the viewing url with `https://ezproxy.cern.ch/login?url=`. See this [website][ezproxy_website]{target=_blank} for a list. diff --git a/docs/howto/setup/shared_filesystems.md b/docs/resources/shared_filesystems.md similarity index 59% rename from docs/howto/setup/shared_filesystems.md rename to docs/resources/shared_filesystems.md index 607cdad5..593037ca 100644 --- a/docs/howto/setup/shared_filesystems.md +++ b/docs/resources/shared_filesystems.md @@ -14,7 +14,7 @@ The CERN Service Portal has [a guide for that][eos_csp]. To be able to run the GUI or CBNG seamlessly from computers which are not in the technical network, it might be useful to mount `/user`, `/nfs` and `/eos` via `sshfs` using the following recipe: -1. Create mountpoints and symbolic links (only once) +### Create mountpoints and symbolic links (only once) ```bash mkdir -p ~/mnt/user && ln -nfs ~/mnt/user /user @@ -22,15 +22,21 @@ mkdir ~/mnt/nfs && ln -nfs ~/mnt/nfs /nfs mkdir ~/mnt/eos && ln -nfs ~/mnt/eos /eos ``` -2. Mount network resources (repeat after timeouts and restarts) +### Mount network resources (repeat after timeouts and restarts) ```bash -sshfs username@cs-ccr-dev3.cern.ch:/user/ ~/mnt/user -sshfs username@cs-ccr-dev3.cern.ch:/nfs/ ~/mnt/nfs -sshfs username@lxplus.cern.ch:/eos/ ~/mnt/eos +sshfs -o follow_symlinks username@cs-ccr-dev3.cern.ch:/user/ ~/mnt/user +sshfs -o follow_symlinks username@cs-ccr-dev3.cern.ch:/nfs/ ~/mnt/nfs +sshfs -o follow_symlinks username@lxplus.cern.ch:/eos/ ~/mnt/eos ``` -3. If outside of the GPN, jump through `lxplus` to mount `dev3`-folders: +??? info "Follow Symlinks" + When mounting to a different location than `/nfs` or `/user` **locally**, one has to set the `follow_symlinks` option + so that symlinks e.g. pointing to a folder somewhere in `/nfs/` (which locally does not exist) are followed correctly, i.e. to the path on the remote machine. + This is not needed when mounting to `/nfs` or `/user` as the symlinks would point to these locations anyway, + but that comes with its own problems, as the mount needs to be done as **root** in these cases and might not be valid for other users. + +### If outside of the GPN, jump through `lxplus` to mount `dev3`-folders ```bash sshfs username@cs-ccr-dev3.cern.ch:/user/ ~/mnt/user -o ssh_command='ssh -t username@lxplus.cern.ch ssh' @@ -52,4 +58,4 @@ sshfs username@cs-ccr-dev3.cern.ch:/nfs/ ~/mnt/nfs -o ssh_command='ssh -t userna *[WSL]: Windows Subsytem Linux [eos_csp]: https://cern.service-now.com/service-portal-old/article.do?n=KB0003846 -[gist_wsl]: https://gist.github.com/JoschD/194b3f6c6fcc408684a481fd4a2ff4e5 \ No newline at end of file +[gist_wsl]: https://gist.github.com/JoschD/194b3f6c6fcc408684a481fd4a2ff4e5 diff --git a/docs/resources/templates.md b/docs/resources/templates.md index caba6d65..86047c03 100644 --- a/docs/resources/templates.md +++ b/docs/resources/templates.md @@ -21,7 +21,6 @@ This is a template for CERN presentations following the official CERN design gui - ### OMC Beamer (Unofficial) [Overleaf Template][OMCTemplateLatex]{target=_blank} @@ -64,7 +63,7 @@ This is a template for CERN Accelerator and Technology Sector (ATS) notes. [Overleaf Template][CernReportTemplate]{target=_blank} -This is a template for authors who are preparing their contribution for one of CERN's official publications (CERN Yellow Report series, CERN Proceedings series, etc.). +This is a template for authors who are preparing their contribution for one of CERN's official publications (CERN Yellow Report series, CERN Proceedings series, etc.). @@ -74,7 +73,6 @@ This is a template for authors who are preparing their contribution for one of C ## PhD Forms - ### PhD Description LaTeX (Unofficial) [Overleaf Template][PhdDescriptionTemplateLatex]{target=_blank} @@ -87,7 +85,6 @@ A LaTeX template for the PhD description, based on the [official CERN HR templat - ### PhD Progress Report LaTeX (Unofficial) [Overleaf Template][PhdProgressTemplateLatex]{target=_blank} @@ -100,12 +97,10 @@ A LaTeX template for the PhD progress reports, similar to the description templa - - [CernATSNoteTemplate]: https://www.overleaf.com/latex/templates/cern-ats-note/yzjmgkrvtsqg [CernReportTemplate]: https://www.overleaf.com/latex/templates/cern-yellow-report-template/kwztmyrgqbbk -[CernBeamerTemplate]: https://www.overleaf.com/latex/templates/cern-presentation-title/mgnwzmtgtvkw -[CernDesignDownloads]: https://design-guidelines.web.cern.ch/downloads +[CernBeamerTemplate]: https://www.overleaf.com/latex/templates/cern-presentation-title/mgnwzmtgtvkw +[CernDesignDownloads]: https://design-guidelines.web.cern.ch/downloads [HiLumiTemplates]: https://espace.cern.ch/HiLumi/HLLHC%20Templates/Forms/AllItems.aspx [PhdDescriptionTemplateCERN2018]: https://admin-eguide.web.cern.ch/en/content/thesis-description-template diff --git a/docs/howto/wiki/editing.md b/docs/resources/wiki.md similarity index 97% rename from docs/howto/wiki/editing.md rename to docs/resources/wiki.md index 98022daa..bcd94e2d 100644 --- a/docs/howto/wiki/editing.md +++ b/docs/resources/wiki.md @@ -30,7 +30,7 @@ Get a local copy of this repository, set up a `Python3.6+` environment and insta ```bash git clone https://github.com/pylhc/pylhc.github.io -pip install mkdocs mkdocs-material mkdocs-minify-plugin +python -m pip install mkdocs mkdocs-material mkdocs-minify-plugin ``` Create a branch (from master) and make your changes. @@ -83,11 +83,11 @@ To create: - _italic_ text, surround the text with `_text_`. -- an internal [link](../../howto/wiki/editing.md#general-text-formatting), use `[link](../../howto/wiki/editing.md#general-text-formatting)` - > Note that all links are relative to the current document! +- an internal [link](#general-text-formatting), use `[link](../../resources/wiki.md#general-text-formatting)` + > Note that all links are relative to the current document! The `#`-labels are created by headers automatically and can be omitted, in case you want to link to the page itself. -- an external [link][bestwiki]{target=_blank}, use `[link][bestwiki]{target=_blank}`.
    +- an external [link][bestwiki]{target=_blank}, use `[link][bestwiki]{target=_blank}`. >Note that at the bottom of the file, an ID named `bestwiki` should be created, together with the hyperlink to the webpage, like so: @@ -106,7 +106,7 @@ To create: ``` - small hints to a difficult word, which appear on mouse over, add at the bottom of the file: - + ```markdown *[difficult word]: helpful explanation ``` @@ -114,7 +114,7 @@ To create: - an inline math environment, surround the equation with `$a^2 + b^2 = c^2$`. - a block math environment, use: - + ```markdown $$ a^2 + b^2 = c^2 diff --git a/mkdocs.yml b/mkdocs.yml index cce42c6c..c4b3f223 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,6 +1,3 @@ -# Copyright (c) 2020 Felix Soubelet - - # Project information site_name: OMC Documentation site_description: >- @@ -33,10 +30,25 @@ theme: - navigation.tabs - navigation.instant - content.action.edit # editing button on the pages is opt-in since v9 + - content.code.copy # copy button for code blocks palette: - scheme: preference - primary: indigo - accent: amber + + # Palette toggle for light mode + - scheme: default + primary: indigo + accent: amber + toggle: + icon: material/brightness-7 + name: Switch to dark mode + + # Palette toggle for dark mode + - scheme: slate + primary: cern + accent: amber + toggle: + icon: material/brightness-4 + name: Switch to light mode + font: text: Roboto code: Roboto Mono @@ -67,7 +79,7 @@ markdown_extensions: - pymdownx.inlinehilite - pymdownx.magiclink - pymdownx.keys: - key_map: {"okbtn": "OK", "cancelbtn": "Cancel", "mousewheel": "Mouse Wheel"} + key_map: {"okbtn": "OK", "cancelbtn": "Cancel", "mousewheel": "⚙ Mouse Wheel"} - pymdownx.mark - pymdownx.snippets: check_paths: true @@ -79,6 +91,9 @@ markdown_extensions: custom_checkbox: true clickable_checkbox: true - pymdownx.tilde + - pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg # Customization extra: @@ -119,7 +134,6 @@ nav: - About omc3: packages/omc3/about.md - Getting Started: packages/omc3/getting_started.md - Analysis: packages/omc3/analysis.md - - Know-How: packages/omc3/know_how.md - ↪ On Github: https://github.com/pylhc/omc3 - PyLHC: - About: packages/pylhc/about.md @@ -148,31 +162,48 @@ nav: - ↪ generic-parser: https://github.com/pylhc/generic_parser - Python Development: - Contributing: packages/development/contributing.md - - Virtual Environments: packages/development/howto_venv.md - Releases: packages/development/howto_release.md + - IDE Setup: packages/development/ide_setup.md + - Virtual Environments: packages/development/howto_venv.md + - Managing: packages/development/managing.md - GUIs: - The OMC GUIs: guis/about.md - Beta-Beat GUI: - About: guis/betabeat/gui.md + - Defaults: guis/betabeat/defaults.md - Beam Selection: guis/betabeat/beam_selection.md + - Common Components: guis/betabeat/common_components.md + - Settings: guis/betabeat/settings.md + - Model Creation: guis/betabeat/model_creation.md - BPM Panel: guis/betabeat/bpm_panel.md - Analysis Panel: guis/betabeat/analysis_panel.md - Optics Panel: guis/betabeat/optics_panel.md - Correction Panel: guis/betabeat/correction_panel.md - - The omc3 branch: guis/betabeat/omc3.md - - Kmod GUI: + - Amplitude Detuning: guis/betabeat/ampdet.md + - BetaBeat.src: guis/betabeat/betabeatsource.md + - Segment-by-Segment GUI: + - About: guis/segment_by_segment/gui.md + - K-Modulation GUI: - About: guis/kmod/gui.md - - Loading a Model: guis/kmod/load_model.md - - Full IP Trim: guis/kmod/full_ip_trim.md - - Magnet Modulation: guis/kmod/individual_modulation.md - - Analyzing Trim Data: guis/kmod/trim_analysis.md - - Using Auto Trim: guis/kmod/autotrim.md + - Performing a Modulation: guis/kmod/modulating.md + - Analyzing Modulations: guis/kmod/analyzing.md + - Chromaticity GUI: + - About: guis/chroma/gui.md + - RDT Feeddown GUI: + - About: guis/rdt_feeddown/gui.md + - Input Tab: guis/rdt_feeddown/input.md + - Validation Tab: guis/rdt_feeddown/validation.md + - Correction Tab: guis/rdt_feeddown/correction.md - Multiturn GUI: - About: guis/multiturn/gui.md - - Developing the GUIs: - - IDE Setup: guis/developing/ide_install.md - - Releases: guis/developing/releases.md - - KMod GUI hints: guis/developing/kmod_special.md + - Safety Checks: guis/multiturn/safety.md + - Beam Excitation: guis/multiturn/excitation.md + - Scheduled Excitations: guis/multiturn/scheduler.md + - Usage and Development: + - Guidelines: guis/usage/guidelines.md + - IDE Setup: guis/usage/ide_install.md + - Remote: guis/usage/remote.md + - Releases: guis/usage/releases.md - Measurements & Corrections: - Info: measurements/about.md - Physics and Methods: @@ -180,6 +211,7 @@ nav: - Error Propagation: measurements/physics/error_propagation.md - BPM-Calibration: measurements/physics/bpm_calibration.md - BPM-Filtering: measurements/physics/bpm_filtering.md + - Harmonic Analysis: measurements/physics/harpy.md - Coupling: measurements/physics/coupling.md - K-Mod: measurements/physics/kmod.md - Linear IR Optics: measurements/physics/ir_linear_optics.md @@ -192,27 +224,23 @@ nav: - Rigid Waist Shift: measurements/procedures/rigid_waist_shift.md - Amplitude Detuning: measurements/procedures/ampdet.md - Crossing Angle Scan: measurements/procedures/xing_scan.md - - How To's: - - Info: howto/about.md - - General Setup: - - Git: howto/setup/git.md - - GUIs: howto/setup/guis.md - - Shared Filesystems: howto/setup/shared_filesystems.md - - ↪ Virtual CentOS Machine: https://abpcomputing.web.cern.ch/guides/openstackCS8/ - - Teleworking: - - Remote Access: howto/teleworking/access.md - - ↪ Tricks from IT: https://codimd.web.cern.ch/vjC8BHbTS7etHwJve-K2Uw - - Wiki Pages: - - Editing this Wiki: howto/wiki/editing.md - - ↪ CERN Docs: https://how-to.docs.cern.ch/ - - Other Relevant How To's: - - ↪ ABPComputing: https://abpcomputing.web.cern.ch/ - - ↪ BBLumi: http://bblumi.web.cern.ch/utilities_tricks/ - Resources: - Useful Links: resources/links.md - - Computing: resources/computing.md + - Computing: + - Git: resources/git_setup.md + - Resources: resources/computing.md + - Remote Access: resources/remote_access.md + - Shared Filesystems: resources/shared_filesystems.md + - ↪ TW tricks from IT: https://codimd.web.cern.ch/vjC8BHbTS7etHwJve-K2Uw + - How To's: + - Editing this Wiki: resources/wiki.md + - ↪ CERN Docs: https://how-to.docs.cern.ch/ + - ↪ Virtual CentOS Machine: https://abpcomputing.web.cern.ch/guides/openstackCS8/ + - ↪ ABPComputing: https://abpcomputing.web.cern.ch/ + - ↪ BBLumi: http://bblumi.web.cern.ch/utilities_tricks/ - Publications: resources/publications.md - Presentations: resources/presentations.md + - Templates: resources/templates.md - Logbook: &logbook - About: logbook/about.md - AD: @@ -238,6 +266,5 @@ nav: - 2023: logbook/SPS/2023_sps.md - 2024: logbook/SPS/2024_sps.md - 2025: logbook/SPS/2025_sps.md - - Templates: resources/templates.md - FAQ: resources/faqs.md - Logbook: *logbook diff --git a/requirements.txt b/requirements.txt index ab04df1a..a269c98d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ -mkdocs -mkdocs-material -mkdocs-minify-plugin \ No newline at end of file +mkdocs>=1.0,<2.0 +mkdocs-material>=9.0,<10.0 +mkdocs-minify-plugin<1.0 \ No newline at end of file diff --git a/scripts/bib2md.py b/scripts/bib2md.py index 0e981c6a..04d91a3f 100644 --- a/scripts/bib2md.py +++ b/scripts/bib2md.py @@ -10,16 +10,20 @@ Requires: titlecase """ + +from __future__ import annotations + +import re from pathlib import Path from typing import Iterable -import re + from titlecase import titlecase # Some tuning parameters: -ADMONITION = 'abstract' # Admonition type -EXCLUDE_KEYS = ["file", "urldate", "abstract", "langid"] # these are removed from bib-entry -MAX_AUTHORS = 5 # before writing "et al" -TO_REPLACE = { # to be replaced in the title. First part (key) is case-insensitive regex +ADMONITION: str = "abstract" # Admonition type +EXCLUDE_KEYS: list[str] = ["file", "urldate", "abstract", "langid"] # these are removed from bib-entry +MAX_AUTHORS: int = 5 # before writing "et al" +TO_REPLACE: dict[str, str] = { # to be replaced in the title. First part (key) is case-insensitive regex "lhc": "LHC", "cern": "CERN", "fcc": "FCC", @@ -27,8 +31,8 @@ "fcc-hh": "FCC-hh", "fcc-he": "FCC-he", "he-lhc": "HE-LHC", - 'hllhc': "HLLHC", - 'hl-lhc': "HL-LHC", + "hllhc": "HLLHC", + "hl-lhc": "HL-LHC", " ac ": " AC ", "ac-dipole": "AC-Dipole", " acdipole ": "ACDipole", @@ -36,16 +40,16 @@ " kek ": " KEK ", " atf ": " ATF ", " atf2 ": " ATF2 ", - " clic ": " CLIC " + " clic ": " CLIC ", } # Patterns of bib-file: -type_citekey_pattern = "^\s*@(?P.+){(?P.+),\s*$" -key_value_pattern = "^\s*(?P.*)\s*=\s*{(?P.*)},?\s*$" +type_citekey_pattern: str = r"^\s*@(?P.+){(?P.+),\s*$" +key_value_pattern: str = r"^\s*(?P.*)\s*=\s*{(?P.*)},?\s*$" -def main(bibfile: Path, citekeys: Iterable[str] = None, add_year: bool = False): +def main(bibfile: Path, citekeys: Iterable[str] | None = None, add_year: bool = False) -> None: """Prints markdown-admonitions for given bibfile and citekeys. If no citekeys are given, it prints all. """ @@ -54,12 +58,12 @@ def main(bibfile: Path, citekeys: Iterable[str] = None, add_year: bool = False): def read_bibfile(bibfile: Path) -> dict: - """ Reads the bib-file and converts it's content to a dictionary. + """Reads the bib-file and converts it's content to a dictionary. The entries are sorted by citekey and additional two entries `entrytype` (e.g. article, report etc.) and `rawtext` (the bib-raw text) - are created. + are created. """ - with open(bibfile, 'r') as f: + with open(bibfile, "r") as f: full_content = f.readlines() collection = dict() @@ -74,30 +78,32 @@ def read_bibfile(bibfile: Path) -> dict: match = re.match(type_citekey, line) if match: - citekey = match.group('citekey') + citekey = match.group("citekey") collection[citekey] = dict() - collection[citekey]['entrytype'] = match.group('type') - collection[citekey]['rawtext'] = line + collection[citekey]["entrytype"] = match.group("type") + collection[citekey]["rawtext"] = line continue match = re.match(key_value, line) if match: - key_ = match.group('key').strip() + key_ = match.group("key").strip() if key_ in EXCLUDE_KEYS: continue - collection[citekey][key_] = match.group('value').replace("{", "").replace("}", "") + collection[citekey][key_] = match.group("value").replace("{", "").replace("}", "") if line.strip() == "}": - collection[citekey]['rawtext'] = collection[citekey]['rawtext'].rstrip('\n').rstrip(",") + "\n" - collection[citekey]['rawtext'] += line + collection[citekey]["rawtext"] = ( + collection[citekey]["rawtext"].rstrip("\n").rstrip(",") + "\n" + ) + collection[citekey]["rawtext"] += line return collection -def print_markdown(collection: dict, citekeys: Iterable[str] = None, add_year: bool = False): - """ Prints the markdown entries of the collection-dict of given citekeys. +def print_markdown(collection: dict, citekeys: Iterable[str] | None = None, add_year: bool = False): + """Prints the markdown entries of the collection-dict of given citekeys. If citekeys is None, all are printed. - `add_year` adds a year header, whenever the year changes between entries. """ + `add_year` adds a year header, whenever the year changes between entries.""" if citekeys is None: citekeys = collection.keys() @@ -106,33 +112,33 @@ def print_markdown(collection: dict, citekeys: Iterable[str] = None, add_year: b entry = collection[citekey] rawtext = entry["rawtext"].replace("\n", "\n ").strip() - doi = entry.get('doi') + doi = entry.get("doi") # replace citekey with doi-name, if it's of 13.231223/doi.name.323 format - if doi and len(doi.split('/')) == 2: - rawtext = rawtext.replace(citekey, doi.split('/')[-1]) + if doi and len(doi.split("/")) == 2: + rawtext = rawtext.replace(citekey, doi.split("/")[-1]) indented = " " + rawtext # add year header if requested - year = entry.get('year') + year = entry.get("year") if add_year and year and year != last_year: last_year = year print() - print(f'### {year}') + print(f"### {year}") # Print the markdown admonition print() print(f'??? {ADMONITION} "{_format_description(entry)}"') - print(' ```') + print(" ```") print(indented) print(" ```") def _format_description(entry): authors = entry.get("author", entry.get("editor", "")) - author_str = '' + author_str = "" if authors: - author_str = f'`{_format_authors(authors)}`' + author_str = f"`{_format_authors(authors)}`" title_str = titlecase(entry.get("title")) @@ -141,16 +147,16 @@ def _format_description(entry): title_str = title_str.replace("\\", "") other_str = _format_other(entry) - full_str = '' + full_str = "" if author_str and title_str: - full_str = f'{title_str}, {author_str}' + full_str = f"{title_str}, {author_str}" elif author_str: full_str = author_str elif title_str: full_str = title_str if full_str and other_str: - full_str = f'{full_str}, {other_str}' + full_str = f"{full_str}, {other_str}" else: full_str = other_str @@ -168,37 +174,37 @@ def _format_authors(raw): return authors[0] if len(authors) <= MAX_AUTHORS: - return f'{", ".join(authors[:-1])}, and {authors[-1]}' + return f"{', '.join(authors[:-1])}, and {authors[-1]}" - return f'{authors[0]} et al.' + return f"{authors[0]} et al." -def _switch_names(formal_name): +def _switch_names(formal_name: str) -> str: parts = formal_name.split(", ") if len(parts) == 2: return f"{parts[1][0]}. {parts[0]}" return formal_name -def _format_other(entry): - journal = entry.get('journal', entry.get('publisher', '')) - volume = entry.get('volume') +def _format_other(entry: dict): + journal = entry.get("journal", entry.get("publisher", "")) + volume = entry.get("volume") if volume: - journal = f'{journal} **{volume}**' + journal = f"{journal} **{volume}**" - year = entry.get('year', entry.get('date', ' ')[:4]).strip() + year = entry.get("year", entry.get("date", " ")[:4]).strip() if journal and year: - journal = f'{journal}, {year}' + journal = f"{journal}, {year}" else: journal = year - url = entry.get('url', '') + url = entry.get("url", "") if (journal != year) and url: - return f'[{journal}]({url}){{target=_blank}}' + return f"[{journal}]({url}){{target=_blank}}" if url: - link = entry.get('reportNumber', entry.get("number", url)) - url = f'[{link}]({url}){{target=_blank}}' + link = entry.get("reportNumber", entry.get("number", url)) + url = f"[{link}]({url}){{target=_blank}}" if journal and url: return f"{journal}, {url}" @@ -209,5 +215,5 @@ def _format_other(entry): return journal -if __name__ == '__main__': - main(bibfile=Path("path/to/bibfile"), citekeys=["cite_keys", "to_use"], add_year=True) \ No newline at end of file +if __name__ == "__main__": + main(bibfile=Path("path/to/bibfile"), citekeys=["cite_keys", "to_use"], add_year=True) diff --git a/scripts/parse_md_table.py b/scripts/parse_md_table.py index dbb28555..a72fc8e6 100644 --- a/scripts/parse_md_table.py +++ b/scripts/parse_md_table.py @@ -1,39 +1,42 @@ +from __future__ import annotations + from collections.abc import Sequence from pathlib import Path import pandas as pd + def parse_file(file_path: Path) -> pd.DataFrame: - """ Parses a markdown file, containing a shift-table, into a pandas dataframe. + """Parses a markdown file, containing a shift-table, into a pandas dataframe. Args: - file_path (Path): Path to the markdown file. + file_path (Path): Path to the markdown file. Returns: - pd.DataFrame: DataFrame containing the shift table. + pd.DataFrame: DataFrame containing the shift table. """ header, data = get_table_parts(file_path.read_text().split("\n")) df = pd.DataFrame( columns=parse_line(header[0]), - data=[parse_line(line) for line in data], + data=[parse_line(line) for line in data], ) return df -def parse_line(line: str): +def parse_line(line: str) -> list[str]: """Convert a single line of a table into a list of parts. Args: - line (str): Line of the table. + line (str): Line of the table. Returns: - List[str]: List of the table row entries. + list[str]: List of the table row entries. """ return [part.strip() for part in line.split("|")][1:-1] -def get_table_parts(content: Sequence[str]): - """ Splits a markdown table into header and data. """ +def get_table_parts(content: Sequence[str]) -> tuple[list[str], list[str]]: + """Splits a markdown table into header and data.""" header = [] data = [] header_finished = False @@ -46,7 +49,7 @@ def get_table_parts(content: Sequence[str]): continue else: break - + if ":---" in line: header_finished = True continue @@ -57,5 +60,3 @@ def get_table_parts(content: Sequence[str]): data.append(line) return header, data - - diff --git a/scripts/shift_calculations.py b/scripts/shift_calculations.py index ad90e925..aafbce5f 100644 --- a/scripts/shift_calculations.py +++ b/scripts/shift_calculations.py @@ -1,6 +1,9 @@ -""" Script to calculate the shifts from the first markdown table in a given file. +"""Script to calculate the shifts from the first markdown table in a given file. This data can then be plotted with `plot_results`, e.g. for the end-of-year report. """ + +from __future__ import annotations + import re from datetime import datetime, timedelta from pathlib import Path @@ -10,33 +13,31 @@ from matplotlib.figure import Figure from parse_md_table import parse_file - # Check dates ------------------------------------------------------------------ -COLUMN_START = "Start Date" -COLUMN_END = "End Date" -COLUMN_SHIFTS = "Shifts" -COLUMN_TYPE = "Type" - -WORK = "W" -WORK_NIGHT = "WN" -HOLIDAY = "H" -HOLIDAY_NIGHT = "HN" -ALL_SHIFTS = (WORK, WORK_NIGHT, HOLIDAY, HOLIDAY_NIGHT) - -SHIFT_NAMING = { +COLUMN_START: str = "Start Date" +COLUMN_END: str = "End Date" +COLUMN_SHIFTS: str = "Shifts" +COLUMN_TYPE: str = "Type" + +WORK: str = "W" +WORK_NIGHT: str = "WN" +HOLIDAY: str = "H" +HOLIDAY_NIGHT: str = "HN" +ALL_SHIFTS: tuple[str] = (WORK, WORK_NIGHT, HOLIDAY, HOLIDAY_NIGHT) # type: ignore + +SHIFT_NAMING: dict[str, str] = { WORK: "Mo - Fr (Day)", WORK_NIGHT: "Mo - Fr (Night)", HOLIDAY: "Holiday/Weekend (Day)", HOLIDAY_NIGHT: "Holiday/Weekend (Night)", } -WORK_START_TIME = {"hour": 8, "minute": 30, "second": 0} -WORK_END_TIME = {"hour": 17, "minute": 30, "second": 0} -SHIFT_LENGTH = 8 # in hours +WORK_START_TIME: dict[str, int] = {"hour": 8, "minute": 30, "second": 0} +WORK_END_TIME: dict[str, int] = {"hour": 17, "minute": 30, "second": 0} +SHIFT_LENGTH: int = 8 # in hours +DATE_FORMAT: str = r"%Y-%m-%d %H:%M" -DATE_FORMAT = "%Y-%m-%d %H:%M" - -CERN_HOLIDAYS = [ +CERN_HOLIDAYS: list[datetime] = [ # https://home.cern/official-holidays/ datetime(2025, 1, 1), datetime(2025, 4, 18), @@ -76,7 +77,7 @@ datetime(2022, 5, 27), datetime(2022, 6, 6), datetime(2022, 9, 8), - #https://home.cern/official-holidays/2021 + # https://home.cern/official-holidays/2021 datetime(2021, 1, 1), datetime(2021, 4, 2), datetime(2021, 4, 5), @@ -92,12 +93,12 @@ def str_to_dt(date_str: str) -> datetime: def same_day(d1: datetime, d2: datetime) -> bool: - """ True if the dates are on the same day. """ + """True if the dates are on the same day.""" return (d1.year == d2.year) and (d1.month == d2.month) and (d1.day == d2.day) def is_holiday(date: datetime) -> bool: - """ True is date is on a known holiday. """ + """True is date is on a known holiday.""" return any(same_day(date, h) for h in CERN_HOLIDAYS) @@ -105,19 +106,19 @@ def calculate_shift_parts(start_time: datetime, end_time: datetime) -> dict[str, """Split the given shift into work hours, holidays/weekends day or night shifts. Args: - start_time (datetime): Start time of the shift - end_time (datetime): End time of the shift + start_time (datetime): Start time of the shift. + end_time (datetime): End time of the shift. Raises: - ValueError: In case start_time is later than end_time + ValueError: In case start_time is later than end_time. Returns: - Dict[str, timedelta]: Dictionary of the time deltas. + Dict[str, timedelta]: Dictionary of the time deltas. """ if start_time > end_time: raise ValueError(f"Start time {start_time} is after end time {end_time}") - + time_split = {shift: timedelta() for shift in ALL_SHIFTS} current_time = start_time @@ -126,11 +127,19 @@ def calculate_shift_parts(start_time: datetime, end_time: datetime) -> dict[str, day_shift, night_shift = WORK, WORK_NIGHT else: day_shift, night_shift = HOLIDAY, HOLIDAY_NIGHT - + # hours on this day day_end = (current_time + timedelta(days=1)).replace(hour=0, minute=0, second=0) - work_start = current_time.replace(**WORK_START_TIME) - work_end = current_time.replace(**WORK_END_TIME) + work_start = current_time.replace( + hour=WORK_START_TIME["hour"], + minute=WORK_START_TIME["minute"], + second=WORK_START_TIME["second"], + ) + work_end = current_time.replace( + hour=WORK_END_TIME["hour"], + minute=WORK_END_TIME["minute"], + second=WORK_END_TIME["second"], + ) if current_time < work_start: # difference to work starting time (or shift) @@ -147,7 +156,7 @@ def calculate_shift_parts(start_time: datetime, end_time: datetime) -> dict[str, time_split[day_shift] += min(work_end, end_time) - current_time current_time = work_end - return time_split + return time_split def time_delta_to_hours(time_delta: timedelta) -> float: @@ -162,6 +171,7 @@ def time_delta_to_shifts(time_delta: timedelta) -> float: EPS = 1e-6 + def test_timedelta_conversion(): assert abs(time_delta_to_hours(timedelta(hours=1)) - 1) < EPS assert abs(time_delta_to_hours(timedelta(hours=2, minutes=30)) - 2.5) < EPS @@ -171,8 +181,7 @@ def test_timedelta_conversion(): def test_working_hours_friday(): parts = calculate_shift_parts( - start_time=datetime(2023, 10, 27, 16, 0), - end_time=datetime(2023, 10, 28, 4, 0) + start_time=datetime(2023, 10, 27, 16, 0), end_time=datetime(2023, 10, 28, 4, 0) ) assert abs(time_delta_to_hours(parts[WORK]) - 1.5) < EPS assert abs(time_delta_to_hours(parts[WORK_NIGHT]) - 6.5) < EPS @@ -182,8 +191,7 @@ def test_working_hours_friday(): def test_working_hours_monday_wednesday(): parts = calculate_shift_parts( - start_time=datetime(2023, 10, 23, 7, 0), - end_time=datetime(2023, 10, 25, 16, 0) + start_time=datetime(2023, 10, 23, 7, 0), end_time=datetime(2023, 10, 25, 16, 0) ) assert abs(time_delta_to_hours(parts[WORK]) - 25.5) < EPS assert abs(time_delta_to_hours(parts[WORK_NIGHT]) - 31.5) < EPS @@ -193,8 +201,7 @@ def test_working_hours_monday_wednesday(): def test_working_hours_single_day(): parts = calculate_shift_parts( - start_time=datetime(2023, 10, 23, 9, 0), - end_time=datetime(2023, 10, 23, 16, 0) + start_time=datetime(2023, 10, 23, 9, 0), end_time=datetime(2023, 10, 23, 16, 0) ) assert abs(time_delta_to_hours(parts[WORK]) - 7) < EPS assert abs(time_delta_to_hours(parts[WORK_NIGHT]) - 0) < EPS @@ -204,15 +211,16 @@ def test_working_hours_single_day(): # Main -------------------------------------------------------------------------- -def calculate_shifts(file_path: str | Path, shift_type: str = None) -> dict[str, timedelta]: + +def calculate_shifts(file_path: str | Path, shift_type: str | None = None) -> dict[str, timedelta]: """Calculate the shifts from Start/End Date columns of the first markdown table in a given file. Args: file_path (str | Path): Path to the markdown file. - shift_type (str, optional): Regex to filter shift type. + shift_type (str, optional): Regex to filter shift type. Returns: - Dict[str, timedelta]: Dictionary of the total time deltas separated by + Dict[str, timedelta]: Dictionary of the total time deltas separated by the type of hours (working hours, night hours, holidays or weekends). """ file_path = Path(file_path) @@ -237,14 +245,16 @@ def calculate_shifts(file_path: str | Path, shift_type: str = None) -> dict[str for key, value in shift_split.items(): parts[key] += value - print(f"\nShifts from '{COLUMN_START}'/'{COLUMN_END}' columns in File {file_path.name}") + print(f"\nShifts from '{COLUMN_START}'/'{COLUMN_END}' columns in File {file_path.name}") for shift, name in SHIFT_NAMING.items(): - print(f"{name}: {time_delta_to_shifts(parts[shift]):.1f} ({time_delta_to_hours(parts[shift]):.1f}h)") + print( + f"{name}: {time_delta_to_shifts(parts[shift]):.1f} ({time_delta_to_hours(parts[shift]):.1f}h)" + ) return parts -def manual_shifts(file_path: str | Path, shift_type: str = None) -> dict[str, float]: +def manual_shifts(file_path: str | Path, shift_type: str | None = None) -> dict[str, float]: """Calculate the shifts from Shifts column of the first markdown table in a given file. Args: @@ -252,7 +262,7 @@ def manual_shifts(file_path: str | Path, shift_type: str = None) -> dict[str, fl shift_type (str): Regex to filter shift-type. Returns: - Dict[str, timedelta]: Dictionary of the total time deltas separated by + Dict[str, timedelta]: Dictionary of the total time deltas separated by the type of hours (working hours, night hours, holidays or weekends). """ file_path = Path(file_path) @@ -270,35 +280,39 @@ def manual_shifts(file_path: str | Path, shift_type: str = None) -> dict[str, fl if not entry[COLUMN_SHIFTS]: continue - shift_split = re.findall(fr"([\d.]+)([WH]N?)", entry[COLUMN_SHIFTS]) + shift_split = re.findall(r"([\d.]+)([WH]N?)", entry[COLUMN_SHIFTS]) for value, key in shift_split: parts[key] += float(value) - print(f"\nShifts from '{COLUMN_SHIFTS}' column in File {file_path.name}") + print(f"\nShifts from '{COLUMN_SHIFTS}' column in File {file_path.name}") for shift, name in SHIFT_NAMING.items(): print(f"{name}: {parts[shift]}") return parts -def plot_results(parts, title: str = "", output_path: str | Path = None) -> Figure: +def plot_results(parts, title: str = "", output_path: str | Path | None = None) -> Figure: """Plot the results of a calculation. Args: - parts (Dict[str, timedelta]): Dictionary of the total time deltas separated by + parts (Dict[str, timedelta]): Dictionary of the total time deltas separated by the type of hours (working hours, outside working hours, holidays or weekends). output_path (str | Path): Path to the output file. """ fig, ax = plt.subplots() - data = [time_delta_to_shifts(value) if isinstance(value, timedelta) else value for value in parts.values()] + data = [ + time_delta_to_shifts(value) if isinstance(value, timedelta) else value + for value in parts.values() + ] labels = [f"{SHIFT_NAMING[k]}: {v:.1f}" for k, v in zip(parts.keys(), data)] colors = [f"C{i}" for i, k in enumerate(parts.keys())] # fix colors - explode = [0.1 * (s == WORK) for s in parts.keys()] # explode working hours + explode = [0.1 * (s == WORK) for s in parts.keys()] # explode working hours # filter shift-entries that were not present def filter_by_data(array): return [a for a, d in zip(array, data) if d] + labels = filter_by_data(labels) colors = filter_by_data(colors) explode = filter_by_data(explode) @@ -306,17 +320,19 @@ def filter_by_data(array): # plot ax.pie( - data, labels=labels, colors=colors, - autopct='%1.1f%%', - explode=explode, + data, + labels=labels, + colors=colors, + autopct="%1.1f%%", + explode=explode, shadow=True, # startangle=90, # rotate if needed # counterclock=False, # go the other way around ) - title += f"\nTotal Shifts: {sum(data):.1f}" + title += f"\nTotal Shifts: {sum(data):.1f}" ax.set_title(title) - ax.axis('equal') + ax.axis("equal") fig.tight_layout() if output_path: fig.savefig(output_path) @@ -325,8 +341,11 @@ def filter_by_data(array): def plot_all_machines_in_year( - year: int, additional: dict[str, float], calculate: bool = False, output_path: str | Path = None - ) -> Figure: + year: int, + additional: dict[str, float], + calculate: bool = False, + output_path: str | Path | None = None, +) -> Figure: """Do a pychart for all machines of a specific year. Args: @@ -338,20 +357,25 @@ def plot_all_machines_in_year( Returns: Figure: Figure of the plot. """ - color_map = {name: f"C{ii}" for ii, name in enumerate(["lhc", "sps", "ps", "psb", "leir", "ad", "superkekb"])} + color_map = { + name: f"C{ii}" for ii, name in enumerate(["lhc", "sps", "ps", "psb", "leir", "ad", "superkekb"]) + } data_map: dict[str, float] = {} for file_path in logbook_dir.glob(f"**/{year:4d}_*.md"): machine = file_path.stem.split("_")[1] if calculate: shift = calculate_shifts(file_path) - else: + else: shift = manual_shifts(file_path) - times = [time_delta_to_shifts(value) if isinstance(value, timedelta) else value for value in shift.values()] + times = [ + time_delta_to_shifts(value) if isinstance(value, timedelta) else value + for value in shift.values() + ] data_map[machine] = sum(times) for name, value in additional.items(): - if name in data_map: + if name in data_map: data_map[name] += value else: data_map[name] = value @@ -360,26 +384,27 @@ def plot_all_machines_in_year( data = [d for d in data_map.values() if d] colors = [color_map[name] for name, d in data_map.items() if d] labels = [f"{name.upper()}: {d:.1f}" for name, d in data_map.items() if d] - + # plot fig, ax = plt.subplots() ax.pie( - data, labels=labels, colors=colors, - autopct='%1.1f%%', + data, + labels=labels, + colors=colors, + autopct="%1.1f%%", shadow=True, # startangle=90, # rotate if needed # counterclock=False, # go the other way around ) - title = f"Total OMC Shifts in {year:d}: {sum(data):.1f}" + title = f"Total OMC Shifts in {year:d}: {sum(data):.1f}" ax.set_title(title) - ax.axis('equal') + ax.axis("equal") fig.tight_layout() if output_path: fig.savefig(output_path) return fig - if __name__ == "__main__": @@ -389,36 +414,37 @@ def plot_all_machines_in_year( test_working_hours_single_day() test_working_hours_monday_wednesday() - # Examples -------------------------------------------------- mpl.rcParams["figure.figsize"] = 7.68, 4.8 - + repo_dir = Path(__file__).parent.parent logbook_dir = repo_dir / "docs" / "logbook" - + # 2022 --------------------------------------------------------------------- # shift_m = manual_shifts(logbook_dir / "2022_lhc.md") # plot_results(shift_m, title="OMC Shifts LHC 2022", output_path="lhc_2022_shifts.pdf") - + # 2023 --------------------------------------------------------------------- - # shift_c = calculate_shifts(logbook_dir / "LHC" / "2023_lhc.md") + # shift_c = calculate_shifts(logbook_dir / "LHC" / "2023_lhc.md") # plot_results(shift_c, title="OMC Shifts LHC 2023 (from Start/End)") - - # shift_c = calculate_shifts(logbook_dir / "2023_ps.md") + + # shift_c = calculate_shifts(logbook_dir / "2023_ps.md") # plot_results(shift_c, title="OMC Shifts PS 2023 (from Start/End)") shift_m = manual_shifts(logbook_dir / "LHC" / "2023_lhc.md") plot_results(shift_m, title="OMC Shifts LHC 2023", output_path="lhc_2023_shifts.pdf") shift_m = manual_shifts(logbook_dir / "LHC" / "2023_lhc.md", shift_type="Commissioning") - plot_results(shift_m, title="OMC Shifts LHC 2023 (Commissioning)", output_path="lhc_2023_shifts_commish.pdf") - + plot_results( + shift_m, title="OMC Shifts LHC 2023 (Commissioning)", output_path="lhc_2023_shifts_commish.pdf" + ) + # shift_m = manual_shifts(logbook_dir / "2023_ps.md") # plot_results(shift_m, title="OMC Shifts PS 2023", output_path="ps_2023_shifts.pdf") - + # shift_m = manual_shifts(logbook_dir / "2023_psb.md") # plot_results(shift_m, title="OMC Shifts PSBooster 2023", output_path="psb_2023_shifts.pdf") @@ -431,16 +457,16 @@ def plot_all_machines_in_year( # shift_m = manual_shifts(logbook_dir / "LHC" /"2024_lhc.md", shift_type="Commissioning") # plot_results(shift_m, title="OMC Shifts LHC 2024 (Commissioning)", output_path="lhc_2024_shifts_commish.pdf") - + # shift_m = manual_shifts(logbook_dir / "2024_lhc.md", shift_type="MD") # plot_results(shift_m, title="OMC Shifts LHC 2024 (MDs)", output_path="lhc_2024_shifts_md.pdf") - + # shift_m = manual_shifts(logbook_dir / "2024_ps.md") # plot_results(shift_m, title="OMC Shifts PS 2024", output_path="ps_2024_shifts.pdf") - + # shift_m = manual_shifts(logbook_dir / "2024_psb.md") # plot_results(shift_m, title="OMC Shifts PSBooster 2024", output_path="psb_2024_shifts.pdf") - + # shift_m = manual_shifts(logbook_dir / "2024_sps.md") # plot_results(shift_m, title="OMC Shifts SPS 2024", output_path="sps_2024_shifts.pdf") @@ -450,28 +476,27 @@ def plot_all_machines_in_year( shift_m = manual_shifts(logbook_dir / "LHC" / "2025_lhc.md") plot_results(shift_m, title="OMC Shifts LHC 2025", output_path="lhc_2025_shifts.pdf") - + # shift_m = calculate_shifts(logbook_dir / "LHC" /"2025_lhc.md") # plot_results(shift_m, title="OMC Shifts LHC 2025", output_path="lhc_2025_shifts_calc.pdf") # shift_m = manual_shifts(logbook_dir / "2024_lhc.md", shift_type="Commissioning") # plot_results(shift_m, title="OMC Shifts LHC 2024 (Commissioning)", output_path="lhc_2024_shifts_commish.pdf") - + # shift_m = manual_shifts(logbook_dir / "2024_lhc.md", shift_type="MD") # plot_results(shift_m, title="OMC Shifts LHC 2024 (MDs)", output_path="lhc_2024_shifts_md.pdf") - + # shift_m = manual_shifts(logbook_dir / "2024_ps.md") # plot_results(shift_m, title="OMC Shifts PS 2024", output_path="ps_2024_shifts.pdf") - + # shift_m = manual_shifts(logbook_dir / "2024_psb.md") # plot_results(shift_m, title="OMC Shifts PSBooster 2024", output_path="psb_2024_shifts.pdf") - + # shift_m = manual_shifts(logbook_dir / "2024_sps.md") # plot_results(shift_m, title="OMC Shifts SPS 2024", output_path="sps_2024_shifts.pdf") - + # plot_all_machines_in_year(2023, additional={}, output_path="machines_2023.pdf") # plot_all_machines_in_year(2024, {"leir": 9, "superkekb": 4}, output_path="machines_2024.pdf") plt.show() -