{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n\n# Estimate data SNR using an inverse\n\nThis estimates the SNR as a function of time for a set of data\nusing a minimum-norm inverse operator.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# Author: Eric Larson \n#\n# License: BSD-3-Clause\n# Copyright the MNE-Python contributors." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from mne import read_evokeds\nfrom mne.datasets.sample import data_path\nfrom mne.minimum_norm import read_inverse_operator\nfrom mne.viz import plot_snr_estimate\n\nprint(__doc__)\n\ndata_dir = data_path() / \"MEG\" / \"sample\"\nfname_inv = data_dir / \"sample_audvis-meg-oct-6-meg-inv.fif\"\nfname_evoked = data_dir / \"sample_audvis-ave.fif\"\n\ninv = read_inverse_operator(fname_inv)\nevoked = read_evokeds(fname_evoked, baseline=(None, 0))[0]\n\nplot_snr_estimate(evoked, inv)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.2" } }, "nbformat": 4, "nbformat_minor": 0 }