Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Get Peak to Peak from SDDS files #375

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Conversation

JoschD
Copy link
Member

@JoschD JoschD commented May 8, 2022

After we had some problems yesterday with the pk2pk values in multiturn, I thought that might be helpful.
Strangely, I am not getting exactly the values from the logbook, e.g.

from pathlib import Path

from omc3.scripts.check_peak_to_peak import peak_to_peak
from omc3.utils.logging_tools import get_logger, DEBUG

LOG = get_logger(__name__, level_console=DEBUG)


if __name__ == '__main__':
    base = Path('/user/slops/data/LHC_DATA/OP_DATA/FILL_DATA/7391/BPM')
    files = ['Beam2@BunchTurn@2018_10_30@12_54_03_710.sdds',  'Beam2@BunchTurn@2018_10_30@13_01_28_539.sdds', 'Beam2@BunchTurn@2018_10_30@13_03_01_002.sdds']
    peak_to_peak(files=[base/f for f in files])
Peak-to-Peak values for Beam2@BunchTurn@2018_10_30@12_54_03_710, Bunch  5:    X: 0.7277 mm    Y: 0.7457 mm
Peak-to-Peak values for Beam2@BunchTurn@2018_10_30@13_01_28_539, Bunch  5:    X: 1.6512 mm    Y: 1.7183 mm
Peak-to-Peak values for Beam2@BunchTurn@2018_10_30@13_03_01_002, Bunch  5:    X: 1.6527 mm    Y: 1.7056 mm
2018-10-30 12:54:03.710   - 5.0% 5.0% - 0.7265mm 0.7496mm 
2018-10-30 13:01:28.539  - 45.0% 35.0% - 1.635mm 1.6981mm 
2018-10-30 13:03:01.002  - 45.0% 35.0% - 1.6351mm 1.6748mm 

https://be-op-logbook.web.cern.ch/elogbook-server/GET/showEventInLogbook/3196358

Ideas are welcome!
I am actually not sure, if such a script is needed in omc3 as it's probably one of those that everyone already has lying around anyway. Thank god I didn't write it from scratch.

@JoschD JoschD added the Feature label May 8, 2022
@JoschD JoschD requested review from fsoubelet and mihofer May 8, 2022 12:04
@JoschD JoschD self-assigned this May 8, 2022
_log_pk2pk(pk2pk, name, bunch, opt.input_unit, opt.unit)

if tbt_data.nbunches > 1:
tbt_data_av = generate_average_tbtdata(tbt_data)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does Multiturn generate an average of the bunches too? If not, this could be why you observe a difference.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only generate an average if there is more than one bunch in the file. and then also additionally to the per bunch pk2pk. And for the tested files, there is only a single bunch. So no idea what the difference is

@fsoubelet
Copy link
Member

Otherwise, this is nice. Maybe we add a simple measurement as a test for this script?

@JoschD
Copy link
Member Author

JoschD commented May 8, 2022

missing

  • test
  • include into docs
  • add --bpms flag, to allow for 'all', 'lhc', 'lhcnonats', and a given list of bpms

@JoschD JoschD marked this pull request as draft March 16, 2023 08:26
@codeclimate
Copy link

codeclimate bot commented Sep 13, 2023

Code Climate has analyzed commit 9f13f2d and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 3.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 84.9% (-0.8% change).

View more on Code Climate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants