.. 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_examples_NeoEpoch_examples_create_neo_epoch.py: ===================== Neo Epoch - ex_0 ===================== This example shows how to create NeoEpoch .. code-block:: python from neoStructures import NeoAll, NeoEpoch import numpy as np Replace the next variables with your paths .. code-block:: python spykingcircus_dirpath = r'C:\Users\deudon\Desktop\SpikeSorting\_Data\002RM_day4_pointes\spykingcircus_results' results_filename = r'20150325-103311-001_0' event_filepath = r'C:\Users\deudon\Desktop\SpikeSorting\_Data\002RM_day4_pointes\Events\eventFile_part.csv' signal_dirpath = r'C:\Users\deudon\Desktop\SpikeSorting\_Data\002RM_day4_pointes\signal\monopolaire_5kHz_d4_post_crise' probe_filepath = r'C:\Users\deudon\Desktop\SpikeSorting\_Data\002RM_day4_pointes\spykingcircus_paramfiles\002_RM.prb' figure_dirpath = r'C:\Users\deudon\Desktop\SpikeSorting\_Data\002RM_day4_pointes\fig' artefact_csv_filepath = r'C:\Users\deudon\Desktop\SpikeSorting\_Data\002RM\Artefact_EDF_reconstruction_d1.csv' Epoching parameters .. code-block:: python csv_delimiter = ';' t_pre, t_post = 1, 1 t_max, srate = -1, 30000 epoch_t_start = np.array([-0.500, -0.250, -0.050, 0.050, 0.250]) epoch_duration = np.array([0.250, 0.200, 0.100, 0.200, 0.250]) epoch_names = ['Pre-IED baseline', 'Pre-IED', 'IED', 'Slow wave', 'Post-IED'] First create a NeoAll instance .. code-block:: python neo_all = NeoAll(spykingcircus_dirpath, results_filename, probe_filepath, signal_dirpath=signal_dirpath, event_filepath=event_filepath, fig_dirpath=figure_dirpath, save_fig=1) And create the NeoEpoch instance .. code-block:: python neo_epoch = NeoEpoch(neo_all, event_filepath=event_filepath, time_pre=0.2, time_post=0.2) print(neo_epoch) You can save it with the save method : .. code-block:: python neo_epoch.save(r'C:\Users\deudon\Desktop\SpikeSorting\_Scripts\_Python\pySpikeAnalysis\pySpikeAnalysis\sample_data') **Total running time of the script:** ( 0 minutes 0.000 seconds) .. _sphx_glr_download_auto_examples_NeoEpoch_examples_create_neo_epoch.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: create_neo_epoch.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: create_neo_epoch.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_