.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "tutorials/widgets/plot_3_waveforms_gallery.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_tutorials_widgets_plot_3_waveforms_gallery.py: Waveforms Widgets Gallery ========================= Here is a gallery of all the available widgets using a pair of RecordingExtractor-SortingExtractor objects. .. GENERATED FROM PYTHON SOURCE LINES 7-15 .. code-block:: Python import matplotlib.pyplot as plt import spikeinterface as si import spikeinterface.extractors as se import spikeinterface.postprocessing as spost import spikeinterface.widgets as sw .. GENERATED FROM PYTHON SOURCE LINES 16-18 First, let's download a simulated dataset from the repo 'https://gin.g-node.org/NeuralEnsemble/ephy_testing_data' .. GENERATED FROM PYTHON SOURCE LINES 18-24 .. code-block:: Python local_path = si.download_dataset(remote_path="mearec/mearec_test_10s.h5") recording, sorting = se.read_mearec(local_path) print(recording) print(sorting) .. rst-class:: sphx-glr-script-out .. code-block:: none MEArecRecordingExtractor: 32 channels - 32.0kHz - 1 segments - 320,000 samples - 10.00s float32 dtype - 39.06 MiB file_path: /home/docs/spikeinterface_datasets/ephy_testing_data/mearec/mearec_test_10s.h5 MEArecSortingExtractor: 10 units - 1 segments - 32.0kHz file_path: /home/docs/spikeinterface_datasets/ephy_testing_data/mearec/mearec_test_10s.h5 .. GENERATED FROM PYTHON SOURCE LINES 25-30 Extract spike waveforms ----------------------- For convenience, metrics are computed on the SortingAnalyzer object that gathers recording/sorting and the extracted waveforms in a single object .. GENERATED FROM PYTHON SOURCE LINES 30-40 .. code-block:: Python analyzer = si.create_sorting_analyzer(sorting=sorting, recording=recording, format="memory") # core extensions analyzer.compute(["random_spikes", "waveforms", "templates", "noise_levels"]) # more extensions analyzer.compute(["spike_amplitudes", "unit_locations", "spike_locations", "template_metrics"]) .. rst-class:: sphx-glr-script-out .. code-block:: none /home/docs/checkouts/readthedocs.org/user_builds/spikeinterface/checkouts/3072/src/spikeinterface/core/job_tools.py:103: UserWarning: `n_jobs` is not set so parallel processing is disabled! To speed up computations, it is recommended to set n_jobs either globally (with the `spikeinterface.set_global_job_kwargs()` function) or locally (with the `n_jobs` argument). Use `spikeinterface.set_global_job_kwargs?` for more information about job_kwargs. warnings.warn( estimate_sparsity: 0%| | 0/10 [00:00 .. GENERATED FROM PYTHON SOURCE LINES 49-51 plot_unit_templates() ~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 51-57 .. code-block:: Python unit_ids = sorting.unit_ids sw.plot_unit_templates(analyzer, unit_ids=unit_ids, ncols=5, figsize=(16, 8)) .. image-sg:: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_002.png :alt: template #0, template #1, template #2, template #3, template #4, template #5, template #6, template #7, template #8, template #9 :srcset: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 58-60 plot_amplitudes() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 60-64 .. code-block:: Python sw.plot_amplitudes(analyzer, plot_histograms=True, figsize=(12, 8)) .. image-sg:: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_003.png :alt: plot 3 waveforms gallery :srcset: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_003.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 65-67 plot_unit_locations() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 67-71 .. code-block:: Python sw.plot_unit_locations(analyzer, figsize=(4, 8)) .. image-sg:: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_004.png :alt: plot 3 waveforms gallery :srcset: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_004.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 72-76 plot_unit_waveform_density_map() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is your best friend to check for overmerge .. GENERATED FROM PYTHON SOURCE LINES 76-81 .. code-block:: Python unit_ids = sorting.unit_ids[:4] sw.plot_unit_waveforms_density_map(analyzer, unit_ids=unit_ids, figsize=(14, 8)) .. image-sg:: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_005.png :alt: plot 3 waveforms gallery :srcset: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_005.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 82-84 plot_amplitudes_distribution() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 84-87 .. code-block:: Python sw.plot_all_amplitudes_distributions(analyzer, figsize=(10, 10)) .. image-sg:: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_006.png :alt: plot 3 waveforms gallery :srcset: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_006.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 88-90 plot_units_depths() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 90-94 .. code-block:: Python sw.plot_unit_depths(analyzer, figsize=(10, 10)) .. image-sg:: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_007.png :alt: plot 3 waveforms gallery :srcset: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_007.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 95-97 plot_unit_probe_map() ~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 97-103 .. code-block:: Python unit_ids = sorting.unit_ids[:4] sw.plot_unit_probe_map(analyzer, unit_ids=unit_ids, figsize=(20, 8)) plt.show() .. image-sg:: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_008.png :alt: #0, #1, #2, #3 :srcset: /tutorials/widgets/images/sphx_glr_plot_3_waveforms_gallery_008.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 6.613 seconds) .. _sphx_glr_download_tutorials_widgets_plot_3_waveforms_gallery.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_3_waveforms_gallery.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_3_waveforms_gallery.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_3_waveforms_gallery.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_