mne.grand_average#
- mne.grand_average(all_inst, interpolate_bads=True, drop_bads=True)[source]#
Make grand average of a list of Evoked, AverageTFR, or Spectrum data.
For
mne.Evokeddata, the function interpolates bad channels based on theinterpolate_badsparameter. Ifinterpolate_badsis True, the grand average file will contain good channels and the bad channels interpolated from the good MEG/EEG channels. Formne.time_frequency.AverageTFRandmne.time_frequency.Spectrumdata, the function takes the subset of channels not marked as bad in any of the instances.The
grand_average.naveattribute will be equal to the number of datasets used to calculate the grand average.Note
A grand average evoked should not be used for source localization.
- Parameters:
- all_inst
listofEvoked,AverageTFRorSpectrum The datasets.
Changed in version 1.10.0: Added support for
Spectrumobjects.- interpolate_badsbool
If True, bad MEG and EEG channels are interpolated. Ignored for
AverageTFRandSpectrumdata.- drop_badsbool
If True, drop all bad channels marked as bad in any data set. If neither
interpolate_badsnordrop_badsisTrue, in the output file, every channel marked as bad in at least one of the input files will be marked as bad, but no interpolation or dropping will be performed.
- all_inst
- Returns:
- grand_average
Evoked|AverageTFR|Spectrum The grand average data. Same type as input.
- grand_average
Notes
Aggregating multitaper TFR datasets with a taper dimension such as for complex or phase data is not supported.
New in v0.11.0.