Skip to content

Commit

Permalink
added phases to output spectra files, untested
Browse files Browse the repository at this point in the history
  • Loading branch information
fscarlier committed Aug 17, 2023
1 parent 1cd4378 commit f5ddf68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions omc3/harpy/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""
# Output Fileextensions --------------------------------------------------------

FILE_PHASES_EXT = ".phases{plane}"
FILE_AMPS_EXT = ".amps{plane}"
FILE_FREQS_EXT = ".freqs{plane}"
FILE_LIN_EXT = ".lin{plane}"
Expand Down
3 changes: 2 additions & 1 deletion omc3/harpy/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from omc3.definitions import formats
from omc3.definitions.constants import PLANES, PLANE_TO_NUM as P2N
from omc3.harpy import clean, frequency, kicker
from omc3.harpy.constants import (FILE_AMPS_EXT, FILE_FREQS_EXT, FILE_LIN_EXT,
from omc3.harpy.constants import (FILE_PHASES_EXT, FILE_AMPS_EXT, FILE_FREQS_EXT, FILE_LIN_EXT,
COL_NAME, COL_TUNE, COL_AMP, COL_MU,
COL_NATTUNE, COL_NATAMP, COL_PHASE, COL_ERR)
from omc3.utils import logging_tools
Expand Down Expand Up @@ -173,6 +173,7 @@ def _write_bad_bpms(output_path_without_suffix, plane, bad_bpms_with_reasons):

def _write_spectrum(output_path_without_suffix, plane, spectra):
tfs.write(f"{output_path_without_suffix}{FILE_AMPS_EXT.format(plane=plane.lower())}", spectra["COEFFS"].abs().T)
tfs.write(f"{output_path_without_suffix}{FILE_PHASES_EXT.format(plane=plane.lower())}", spectra["PHASES"].angle().T)
tfs.write(f"{output_path_without_suffix}{FILE_FREQS_EXT.format(plane=plane.lower())}", spectra["FREQS"].T)


Expand Down

0 comments on commit f5ddf68

Please sign in to comment.