.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/plot_read_proxy_with_lazy_load.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_examples_plot_read_proxy_with_lazy_load.py: Demonstration of lazy load and proxy objects ============================================ .. GENERATED FROM PYTHON SOURCE LINES 8-11 Import our packages first It is often nice to have units so we will also import quantities .. GENERATED FROM PYTHON SOURCE LINES 11-18 .. code-block:: Python import urllib import neo import quantities as pq import numpy as np .. GENERATED FROM PYTHON SOURCE LINES 19-23 Let's get a file NeuralEnsemble maintains a wide variety of small test datasets that are free to use. We can use urllib to pull down one of these files for use .. GENERATED FROM PYTHON SOURCE LINES 23-30 .. code-block:: Python url_repo = "https://web.gin.g-node.org/NeuralEnsemble/ephy_testing_data/raw/master/" # Get med file distantfile = url_repo + "micromed/File_micromed_1.TRC" localfile = "./File_micromed_1.TRC" urllib.request.urlretrieve(distantfile, localfile) .. rst-class:: sphx-glr-script-out .. code-block:: none ('./File_micromed_1.TRC', ) .. GENERATED FROM PYTHON SOURCE LINES 31-36 create a reader creating a reader for neo is easy it just requires using the name of the desired reader and providing either a filename or a directory name (reader dependent). Since we got a micromed file we will use MicromedIO. .. GENERATED FROM PYTHON SOURCE LINES 36-40 .. code-block:: Python reader = neo.MicromedIO(filename="File_micromed_1.TRC") reader.parse_header() .. GENERATED FROM PYTHON SOURCE LINES 41-44 as always we can look view some interesting information about the metadata and structure of a file just by printing the reader and it's header .. GENERATED FROM PYTHON SOURCE LINES 44-48 .. code-block:: Python print(reader) print(f"Header information: {reader.header}") .. rst-class:: sphx-glr-script-out .. code-block:: none MicromedIO: File_micromed_1.TRC nb_block: 1 nb_segment: [1] signal_streams: [Signals (chans: 64)] signal_channels: [FP1, FP2, AF7, AF3 ... Trig , VEOG , HEOG , EMG] spike_channels: [] event_channels: [Trigger, Note, Event A, Event B] Header information: {'nb_block': 1, 'nb_segment': [1], 'signal_streams': array([('Signals', '0')], dtype=[('name', '` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_read_proxy_with_lazy_load.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_