{
  "nbformat_minor": 0, 
  "nbformat": 4, 
  "cells": [
    {
      "execution_count": null, 
      "cell_type": "code", 
      "source": [
        "%matplotlib inline"
      ], 
      "outputs": [], 
      "metadata": {
        "collapsed": false
      }
    }, 
    {
      "source": [
        "\n=============================================\nInterpolate bad channels for MEG/EEG channels\n=============================================\n\nThis example shows how to interpolate bad MEG/EEG channels\n\n    - Using spherical splines as described in [1]_ for EEG data.\n    - Using field interpolation for MEG data.\n\nThe bad channels will still be marked as bad. Only the data in those channels\nis removed.\n\nReferences\n----------\n.. [1] Perrin, F., Pernier, J., Bertrand, O. and Echallier, JF. (1989)\n       Spherical splines for scalp potential and current density mapping.\n       Electroencephalography and Clinical Neurophysiology, Feb; 72(2):184-7.\n\n"
      ], 
      "cell_type": "markdown", 
      "metadata": {}
    }, 
    {
      "execution_count": null, 
      "cell_type": "code", 
      "source": [
        "# Authors: Denis A. Engemann <denis.engemann@gmail.com>\n#          Mainak Jas <mainak.jas@telecom-paristech.fr>\n#\n# License: BSD (3-clause)\n\nimport mne\nfrom mne.datasets import sample\n\nprint(__doc__)\n\ndata_path = sample.data_path()\n\nfname = data_path + '/MEG/sample/sample_audvis-ave.fif'\nevoked = mne.read_evokeds(fname, condition='Left Auditory',\n                          baseline=(None, 0))\n\n# plot with bads\nevoked.plot(exclude=[])\n\n# compute interpolation (also works with Raw and Epochs objects)\nevoked.interpolate_bads(reset_bads=False)\n\n# plot interpolated (previous bads)\nevoked.plot(exclude=[])"
      ], 
      "outputs": [], 
      "metadata": {
        "collapsed": false
      }
    }
  ], 
  "metadata": {
    "kernelspec": {
      "display_name": "Python 2", 
      "name": "python2", 
      "language": "python"
    }, 
    "language_info": {
      "mimetype": "text/x-python", 
      "nbconvert_exporter": "python", 
      "name": "python", 
      "file_extension": ".py", 
      "version": "2.7.13", 
      "pygments_lexer": "ipython2", 
      "codemirror_mode": {
        "version": 2, 
        "name": "ipython"
      }
    }
  }
}