class_docstr: Cross-spectral density.
  
  Given a list of time series, the CSD matrix denotes for each pair of time
  series, the cross-spectral density. This matrix is symmetric and internally
  stored as a vector.
  
  This object can store multiple CSD matrices: one for each frequency.
  Use ``.get_data(freq)`` to obtain an CSD matrix as an ndarray.
  
  Parameters
  ----------
  data : ndarray, shape ((n_channels**2 + n_channels) // 2, n_frequencies)
      For each frequency, the cross-spectral density matrix in vector format.
  ch_names : list of str
      List of string names for each channel.
  frequencies : float | list of float | list of list of float
      Frequency or frequencies for which the CSD matrix was calculated. When
      averaging across frequencies (see the :func:`CrossSpectralDensity.mean`
      function), this will be a list of lists that contains for each
      frequency bin, the frequencies that were averaged. Frequencies should
      always be sorted.
  n_fft : int
      The number of FFT points or samples that have been used in the
      computation of this CSD.
  tmin : float | None
      Start of the time window for which CSD was calculated in seconds. Can
      be ``None`` (the default) to indicate no timing information is
      available.
  tmax : float | None
      End of the time window for which CSD was calculated in seconds. Can be
      ``None`` (the default) to indicate no timing information is available.
  projs : list of Projection | None
      List of projectors to apply to timeseries data when using this CSD
      object to compute a DICS beamformer. Defaults to ``None``, which means
      no projectors will be applied.
  
  See Also
  --------
  csd_fourier
  csd_multitaper
  csd_morlet
  csd_array_fourier
  csd_array_multitaper
  csd_array_morlet
class_docstr_tok: ["Cross-spectral","density",".","Given","a","list","of","time","series",",","the","CSD","matrix","denotes","for","each","pair","of","time","series",",","the","cross-spectral","density",".","This","matrix","is","symmetric","and","internally","stored","as","a","vector",".","This","object","can","store","multiple","CSD","matrices",":","one","for","each","frequency",".","Use","``",".get_data","(","freq",")","``","to","obtain","an","CSD","matrix","as","an","ndarray",".","Parameters","--","--","--","--","--","data",":","ndarray",",","shape","(","(","n_channels","*","*","2","+","n_channels",")","\/\/","2",",","n_frequencies",")","For","each","frequency",",","the","cross-spectral","density","matrix","in","vector","format",".","ch_names",":","list","of","str","List","of","string","names","for","each","channel",".","frequencies",":","float","|","list","of","float","|","list","of","list","of","float","Frequency","or","frequencies","for","which","the","CSD","matrix","was","calculated",".","When","averaging","across","frequencies","(","see","the",":","func",":","`","CrossSpectralDensity.mean","`","function",")",",","this","will","be","a","list","of","lists","that","contains","for","each","frequency","bin",",","the","frequencies","that","were","averaged",".","Frequencies","should","always","be","sorted",".","n_fft",":","int","The","number","of","FFT","points","or","samples","that","have","been","used","in","the","computation","of","this","CSD",".","tmin",":","float","|","None","Start","of","the","time","window","for","which","CSD","was","calculated","in","seconds",".","Can","be","``","None","``","(","the","default",")","to","indicate","no","timing","information","is","available",".","tmax",":","float","|","None","End","of","the","time","window","for","which","CSD","was","calculated","in","seconds",".","Can","be","``","None","``","(","the","default",")","to","indicate","no","timing","information","is","available",".","projs",":","list","of","Projection","|","None","List","of","projectors","to","apply","to","timeseries","data","when","using","this","CSD","object","to","compute","a","DICS","beamformer",".","Defaults","to","``","None","``",",","which","means","no","projectors","will","be","applied",".","See","Also","--","--","--","--","csd_fourier","csd_multitaper","csd_morlet","csd_array_fourier","csd_array_multitaper","csd_array_morlet"]
docstr: Get the CSD matrix for a given frequency as NumPy array.
  
  If there is only one matrix defined in the CSD object, calling this
  method without any parameters will return it. If multiple matrices are
  defined, use either the ``frequency`` or ``index`` parameter to select
  one.
  
  Parameters
  ----------
  frequency : float | None
      Return the CSD matrix for a specific frequency. Only available when
      no averaging across frequencies has been done.
  index : int | None
      Return the CSD matrix for the frequency or frequency-bin with the
      given index.
  as_cov : bool
      Whether to return the data as a numpy array (`False`, the default),
      or pack it in a :class:`mne.Covariance` object (`True`).
  
      .. versionadded:: 0.20
  
  Returns
  -------
  csd : ndarray, shape (n_channels, n_channels) | instance of Covariance
      The CSD matrix corresponding to the requested frequency.
  
  See Also
  --------
  pick_frequency
docstr_tok: ["Get","the","CSD","matrix","for","a","given","frequency","as","NumPy","array",".","If","there","is","only","one","matrix","defined","in","the","CSD","object",",","calling","this","method","without","any","parameters","will","return","it",".","If","multiple","matrices","are","defined",",","use","either","the","``","frequency","``","or","``","index","``","parameter","to","select","one",".","Parameters","--","--","--","--","--","frequency",":","float","|","None","Return","the","CSD","matrix","for","a","specific","frequency",".","Only","available","when","no","averaging","across","frequencies","has","been","done",".","index",":","int","|","None","Return","the","CSD","matrix","for","the","frequency","or","frequency-bin","with","the","given","index",".","as_cov",":","bool","Whether","to","return","the","data","as","a","numpy","array","(","`","False","`",",","the","default",")",",","or","pack","it","in","a",":","class",":","`","mne.Covariance","`","object","(","`","True","`",")",".","..","versionadded",":",":","0.20","Returns","--","--","--","-","csd",":","ndarray",",","shape","(","n_channels",",","n_channels",")","|","instance","of","Covariance","The","CSD","matrix","corresponding","to","the","requested","frequency",".","See","Also","--","--","--","--","pick_frequency"]
code: def get_data(self, frequency=None, index=None, as_cov=False):
      """Get the CSD matrix for a given frequency as NumPy array.
  
      If there is only one matrix defined in the CSD object, calling this
      method without any parameters will return it. If multiple matrices are
      defined, use either the ``frequency`` or ``index`` parameter to select
      one.
  
      Parameters
      ----------
      frequency : float | None
          Return the CSD matrix for a specific frequency. Only available when
          no averaging across frequencies has been done.
      index : int | None
          Return the CSD matrix for the frequency or frequency-bin with the
          given index.
      as_cov : bool
          Whether to return the data as a numpy array (`False`, the default),
          or pack it in a :class:`mne.Covariance` object (`True`).
  
          .. versionadded:: 0.20
  
      Returns
      -------
      csd : ndarray, shape (n_channels, n_channels) | instance of Covariance
          The CSD matrix corresponding to the requested frequency.
  
      See Also
      --------
      pick_frequency
      """
      if frequency is None and index is None:
          if self._data.shape[1] > 1:
              raise ValueError(
                  "Specify either the frequency or index of "
                  "the frequency bin for which to obtain the "
                  "CSD matrix."
              )
          index = 0
      elif frequency is not None:
          if index is not None:
              raise ValueError(
                  "Cannot specify both a frequency and index."
              )
          index = self._get_frequency_index(frequency)
  
      data = _vector_to_sym_mat(self._data[:, index])
      if as_cov:
          # Pack the data into a Covariance object
          from ..cov import Covariance  # to avoid circular import
  
          return Covariance(
              data,
              self.ch_names,
              bads=[],
              projs=self.projs,
              nfree=self.n_fft,
          )
      else:
          return data
  
imports: import copy
  import numbers
  import numpy
  from scipy.fft import rfftfreq
  from .._fiff.pick import _picks_to_idx, pick_channels
  from ..parallel import parallel_func
  from ..time_frequency.multitaper import _compute_mt_params, _csd_from_mt, _mt_spectra, _psd_from_mt_adaptive
  from ..utils import ProgressBar, _check_fname, _import_h5io_funcs, _validate_type, copy_function_doc_to_method_doc, logger, verbose, warn
  from ..viz.misc import plot_csd
  from .tfr import EpochsTFR, _cwt_array, _get_nfft, morlet
label_desc: Use image node_id 10 for calling the CrossSpectralDensity obj's underlying member method code with example usage: obj.get_data(frequency, index, as_cov) and returns: Covariance, data