.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_paper/01_preprocessing.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_paper_01_preprocessing.py: Part 2: Preprocessing ===================== Drop bad subjects and preprocess the data .. GENERATED FROM PYTHON SOURCE LINES 7-11 .. code-block:: default import preprocessing_info as prep_info import os .. GENERATED FROM PYTHON SOURCE LINES 12-13 Define data paths .. GENERATED FROM PYTHON SOURCE LINES 13-30 .. code-block:: default # Local folder where the data have been downloaded cwd = os.getcwd() data_root = os.path.join(cwd, 'transfreq_data') if not os.path.exists(data_root): raise Exception('Cannot find data in {}. Please check.'.format(data_root)) # Local folder where to store the output of the analysis data_path = os.path.join(cwd, 'transfreq_data_preproc') datatype = 'eeg' task = 'Rest' suffix = 'eeg' if os.path.exists(data_path): raise Exception('Folder {} already exists. Please check'.format( data_path)) .. GENERATED FROM PYTHON SOURCE LINES 31-32 Subjects included in analysis .. GENERATED FROM PYTHON SOURCE LINES 32-43 .. code-block:: default subj_per_session = {'01': ['001', '002', '003', '004', '006', '007', '008', '009', '010', '011', '012', '013', '014', '015', '016', '017', '019', '020', '021', '023', '024', '025', '026', '027', '028', '030', '031', '032', '033', '034', '035', '037', '038', '039', '040', '041', '042', '043', '044', '045', '046', '047', '048', '049', '050'], '02': ['001', '002', '004', '006', '007', '008', '009', '010', '011', '012', '013', '014', '015', '016', '017', '018', '019', '020', '021', '023', '024', '025', '026', '027']} .. GENERATED FROM PYTHON SOURCE LINES 44-45 Preprocess data .. GENERATED FROM PYTHON SOURCE LINES 45-49 .. code-block:: default for session in subj_per_session.keys(): for subject in subj_per_session[session]: prep_info.preprocessing(data_root, datatype, subject, session, task, suffix, data_path) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.000 seconds) .. _sphx_glr_download_auto_paper_01_preprocessing.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 01_preprocessing.py <01_preprocessing.py>` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 01_preprocessing.ipynb <01_preprocessing.ipynb>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_