at.physics.harmonic_analysis#

Simplified version of harpy from Jaime Coello Maria de Portugal - Martinez Vazquez Github: pylhc/harpy

Functions

get_spectrum_harmonic(cent[, method, ...])

Frequency analysis of beam motion

get_main_harmonic(cents[, method, hann, ...])

Computes tunes, amplitudes and pahses from harmonic analysis

get_tunes_harmonic(cents[, method, hann, ...])

Computes tunes from harmonic analysis

get_main_harmonic(cents, method='interp_fft', hann=False, fmin=0, fmax=1, maxiter=10, pad_length=None)[source]#

Computes tunes, amplitudes and pahses from harmonic analysis

Parameters:
  • cents (ndarray) – Centroid motions of the particle

  • method (str) – 'interp_fft' or 'fft'. Default: 'interp_fft'

  • fmin (float) – Lower bound for tune search

  • fmax (float) – Upper bound for tune search

  • maxiter (float) – Maximum number of iterations for the search

  • hann (bool) – Turn on Hanning window. Default: False. Ignored for interpolated FFT

  • pad_length – Zero pad the input signal. Rounded to the higher power of 2 Ignored for interpolated FFT

Returns:
  • tunes (ndarray) – numpy array of length len(cents), max of the

  • spectrum within [fmin fmax]

  • amplitude (ndarray) – (len(cents), ) array of amplitudes corresponding to the tune

  • phase (ndarray) – (len(cents), ) array of phases corresponding to the tune

get_spectrum_harmonic(cent, method='interp_fft', num_harmonics=20, hann=False, fmin=0, fmax=1, maxiter=10, pad_length=None)[source]#

Frequency analysis of beam motion

Parameters:
  • cent (ndarray) – Centroid motions of the particle

  • method (str) – 'interp_fft' or 'interp_fft'. Default: 'interp_fft'

  • num_harmonics (int) – Number of harmonics to search for with interp_fft

  • fmin (float) – Lower bound for spectrum search with interp_fft

  • fmax (float) – Upper bound for spectrum search with interp_fft

  • maxiter (float) – Multiplies num_harmonics to define the max. number of iteration for the search

  • hann (bool) – Turn on Hanning window. Default: False. Ignored for interpolated FFT

  • signal. (pad_length Zero pad the input) – Rounded to the higher power of 2 Ignored for interpolated FFT

Returns:
  • frequency (ndarray) – (num_harmonics,) array of frequencies

  • amplitude (ndarray) – (num_harmonics,) array of amplitudes

  • phase (ndarray) – (num_harmonics,) array of phases

get_tunes_harmonic(cents, method='interp_fft', hann=False, fmin=0, fmax=1, maxiter=10, pad_length=None, **kwargs)[source]#

Computes tunes from harmonic analysis

Parameters:
  • cents (ndarray) – Centroid motions of the particle

  • method (str) – 'interp_fft' or 'fft'. Default: 'interp_fft'

  • fmin (float) – Lower bound for tune search

  • fmax (float) – Upper bound for tune search

  • maxiter (float) – Maximum number of iterations for the search

  • hann (bool) – Turn on Hanning window. Default: False. Ignored for interpolated FFT

  • pad_length – Zero pad the input signal. Rounded to the higher power of 2 Ignored for interpolated FFT

Returns:
  • tunes (ndarray) – numpy array of length len(cents), max of the

  • spectrum within [fmin fmax]