.. 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_NeoAll_examples_plot_NeoAll_ex5.py: ====================================================== Neo All - example 5 - Channel Groups / Index ====================================================== This example show how to use the channel indexes in the NeoAll class. In NeoAll, channel indexes are defined for each tetrode and each electrode **if the signal directory path is given at init**. Otherwise channel indexes are created based on the probe file. .. code-block:: python from neoStructures import * import pandas as pd import matplotlib.pyplot as plt from os.path import isdir, join Import the data and create the NeoAll instance .. code-block:: python data_dir = join('pySpikeAnalysis', 'sample_data') if isdir('pySpikeAnalysis') else join('..', '..', 'pySpikeAnalysis', 'sample_data') spykingcircus_dir = r'SpykingCircus_results' probe_filename = r'000_AA.prb' results_filename = r'spykingcircusres' artefact_csv_filepath = join(data_dir, r'artefact_free_periods.csv') neoAll = NeoAll(join(data_dir, spykingcircus_dir), results_filename, join(data_dir, probe_filename), save_fig=0) See information about NeoAll .. code-block:: python print(neoAll) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none NeoAll Instance with 54 units. 1 Neo segment per unit. Each segment contains 1 Neo spiketrain 10 channel indexes Let's look at the different channel indexes : .. code-block:: python print(neoAll.channel_indexes) .. rst-class:: sphx-glr-script-out Out: .. code-block:: none [, , , , , , , , , ] We can see that the first groups or ChannelIndex correpond to individual tetrodes and that the last groups We can see that the first groups or ChannelIndex correpond to individual tetrodes and that the last groups correpond to the entire electrode (i.e. group of 2 or 3 tetrodes) We can use the channel indexes for plotting the firing rate evolution of multiple units in the same figure. Channel indexes define groups of channel. By default, a channel index is defined for each tetrode. Let's plot the firing rate evolution of all units of the tetrode 2 of electrode cp (ChannelIndex number 4, thus index 3) : .. code-block:: python neoAll.plot_spikerate_evolution_group(grp_index=3) .. image:: /auto_examples/NeoAll_examples/images/sphx_glr_plot_NeoAll_ex5_001.png :class: sphx-glr-single-img **Total running time of the script:** ( 0 minutes 3.032 seconds) .. _sphx_glr_download_auto_examples_NeoAll_examples_plot_NeoAll_ex5.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: plot_NeoAll_ex5.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: plot_NeoAll_ex5.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_