syncopy.plotting._plot_spectral._compute_pltArr(self, nFreq, N, nTime, complexConversion, pltDtype, avg1='channel', avg2=None, trial='all', channel='all', freq='all', taper='all')[source]

Local helper that extracts/averages data from SpectralData object

  • self (SpectralData object) – Syncopy SpectralData object that is being processed by the respective singlepanelplot() or multipanelplot() class methods defined in this module.

  • nFreq (int) – Number of frequencies of interest

  • N (int) – Size of free dimension post averaging. Depending on avg1 and avg2 can be either nChan, nTap or 1

  • nTime (int) – Number of time-points of interest. If object does not contain time-frequency data, nTime has to be 1

  • complexConversion (callable) – Automatically set by _prep_spectral_plots() to (potentially) convert complex Fourier coefficients to float.

  • pltDtype (str or numpy.dtype) – Automatically set by _prep_spectral_plots(): numeric type of (potentially converted) complex Fourier coefficients.

  • avg1 (str or None) – First dimension for averaging. If None, no mean-value is computed. Otherwise, avg1 can be either “channel” or “taper”.

  • avg2 (str or None) – Second dimension for averaging. If None, no mean-value is computed. Otherwise, avg2 can be either “channel” or “taper”.

  • trial (str or list) – Either list of trial indices or “all”; set by _prep_spectral_plots()

  • channel (str or numpy.ndarray) – Either array of channel specifiers or “all”; set by _prep_spectral_plots()

  • freq (str or numpy.ndarray) – Either array of frequency specifiers or “all”; set by _prep_spectral_plots()

  • taper (str or numpy.ndarray) – Either array of taper specifiers or “all”; set by _prep_spectral_plots()


pltArr – Extracted/averaged data ready for plotting; if the SpectralData input object contains time-frequency data, pltArr is a three-dimensional array of shape (nFreq, nTime, N), otherwise pltArr is two-dimensional with shape (nFreq, N) for N > 1, or a one-dimensional (nFreq,) array if N = 1.

Return type

1D, 2D or 3D numpy.ndarray


This is an auxiliary method that is intended purely for internal use. Please refer to the user-exposed methods singlepanelplot() and/or multipanelplot() to actually generate plots of Syncopy data objects.