From 2ae0ca2a7b044c0c5a11cc9d223afefdd884f771 Mon Sep 17 00:00:00 2001 From: zm711 <92116279+zm711@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:18:11 -0500 Subject: [PATCH 1/2] do Igor demo from g-node --- examples/plot_igorio.py | 46 ++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/examples/plot_igorio.py b/examples/plot_igorio.py index 5afcf9932..53b30da7e 100644 --- a/examples/plot_igorio.py +++ b/examples/plot_igorio.py @@ -1,41 +1,39 @@ """ -IgorProIO Demo (BROKEN) +IgorProIO Demo ======================= """ ########################################################### # Import our packages -import os + from urllib.request import urlretrieve -import zipfile import matplotlib.pyplot as plt from neo.io import get_io ############################################################# # Then download some data -# Downloaded from Human Brain Project Collaboratory -# Digital Reconstruction of Neocortical Microcircuitry (nmc-portal) -# http://microcircuits.epfl.ch/#/animal/8ecde7d1-b2d2-11e4-b949-6003088da632 -# NOTE: this dataset is not found as the link is broken. +# we can try out some data on the NeuralEnsemble ephy testing repo -# datafile_url = "https://microcircuits.epfl.ch/data/released_data/B95.zip" -# filename_zip = "B95.zip" -# filename = "grouped_ephys/B95/B95_Ch0_IDRest_107.ibw" -# urlretrieve(datafile_url, filename_zip) +url_repo = "https://web.gin.g-node.org/NeuralEnsemble/ephy_testing_data/raw/master/" +distantfile = "igor/win-version2.ibw" +localfile = "win-version2.ibw" +urlretrieve(distantfile, localfile) -# zip_ref = zipfile.ZipFile(filename_zip) # create zipfile object -# zip_ref.extract(path=".", member=filename) # extract file to dir -# zip_ref.close() # ###################################################### -# # Once we have our data we can use `get_io` to find an -# # io (Igor in this case). Then we read the analogsignals -# # Finally we will make some nice plots -# reader = get_io(filename) -# signal = reader.read_analogsignal() -# plt.plot(signal.times, signal) -# plt.xlabel(signal.sampling_period.dimensionality) -# plt.ylabel(signal.dimensionality) - -# plt.show() +# Once we have our data we can use `get_io` to find an +# io (Igor in this case). Then we read the analogsignals +# Finally we will make some nice plots +# +# Note: not all IOs have all types of read functionality +# see our documentation for a better understanding of the +# Neo object hierarchy and the functionality of differnt IOs + +reader = get_io(localfile) +signal = reader.read_analogsignal() +plt.plot(signal.times, signal) +plt.xlabel(signal.sampling_period.dimensionality) +plt.ylabel(signal.dimensionality) + +plt.show() From 5962a8a9bca0c9bd9db7507d494b356fb744ee67 Mon Sep 17 00:00:00 2001 From: zm711 <92116279+zm711@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:27:21 -0500 Subject: [PATCH 2/2] oops! --- examples/plot_igorio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/plot_igorio.py b/examples/plot_igorio.py index 53b30da7e..0ee086b74 100644 --- a/examples/plot_igorio.py +++ b/examples/plot_igorio.py @@ -16,7 +16,7 @@ # we can try out some data on the NeuralEnsemble ephy testing repo url_repo = "https://web.gin.g-node.org/NeuralEnsemble/ephy_testing_data/raw/master/" -distantfile = "igor/win-version2.ibw" +distantfile = url_repo + "igor/win-version2.ibw" localfile = "win-version2.ibw" urlretrieve(distantfile, localfile)