pylhc / omc3

Python 3 codes for beam optics measurements and corrections in circular particle accelerators

Home Page:https://pylhc.github.io/omc3/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature Request]: Output the complex frequency spectrum for harpy

Mael-Le-Garrec opened this issue · comments

Feature Description

Only the real part of the frequency spectrum is written to the lin files when doing a frequency analysis.

For example, the columns AMP05 and AMP0_5, for the lines 5Qy and -5Qy have the same amplitude.
This makes differentiating between RDTs contributing to those two lines impossible.

Possible Implementation

I haven't checked the code, I do not know how feasible this is.

@Mael-Le-Garrec do you mean in the lin-files? You have AMP, PHASE and FREQ

if you want phases for all lines, it should be

tfs.write(f"{output_path_without_suffix}{FILE_AMPS_EXT.format(plane=plane.lower())}", spectra["COEFFS"].apply(np.angle).T)

in

def _write_spectrum(output_path_without_suffix, plane, spectra):

To check: maybe you need to divide by 2 pi and maybe you need to sync the phases to the first BPM, see

def _sync_phase(lin_frame, plane):