Skip to content

Commit 2ae0ca2

Browse files
committed
do Igor demo from g-node
1 parent b1f227f commit 2ae0ca2

File tree

1 file changed

+22
-24
lines changed

1 file changed

+22
-24
lines changed

examples/plot_igorio.py

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,39 @@
11
"""
2-
IgorProIO Demo (BROKEN)
2+
IgorProIO Demo
33
=======================
44
55
"""
66

77
###########################################################
88
# Import our packages
9-
import os
9+
1010
from urllib.request import urlretrieve
11-
import zipfile
1211
import matplotlib.pyplot as plt
1312
from neo.io import get_io
1413

1514
#############################################################
1615
# Then download some data
17-
# Downloaded from Human Brain Project Collaboratory
18-
# Digital Reconstruction of Neocortical Microcircuitry (nmc-portal)
19-
# http://microcircuits.epfl.ch/#/animal/8ecde7d1-b2d2-11e4-b949-6003088da632
20-
# NOTE: this dataset is not found as the link is broken.
16+
# we can try out some data on the NeuralEnsemble ephy testing repo
2117

22-
# datafile_url = "https://microcircuits.epfl.ch/data/released_data/B95.zip"
23-
# filename_zip = "B95.zip"
24-
# filename = "grouped_ephys/B95/B95_Ch0_IDRest_107.ibw"
25-
# urlretrieve(datafile_url, filename_zip)
18+
url_repo = "https://web.gin.g-node.org/NeuralEnsemble/ephy_testing_data/raw/master/"
19+
distantfile = "igor/win-version2.ibw"
20+
localfile = "win-version2.ibw"
21+
urlretrieve(distantfile, localfile)
2622

27-
# zip_ref = zipfile.ZipFile(filename_zip) # create zipfile object
28-
# zip_ref.extract(path=".", member=filename) # extract file to dir
29-
# zip_ref.close()
3023

3124
# ######################################################
32-
# # Once we have our data we can use `get_io` to find an
33-
# # io (Igor in this case). Then we read the analogsignals
34-
# # Finally we will make some nice plots
35-
# reader = get_io(filename)
36-
# signal = reader.read_analogsignal()
37-
# plt.plot(signal.times, signal)
38-
# plt.xlabel(signal.sampling_period.dimensionality)
39-
# plt.ylabel(signal.dimensionality)
40-
41-
# plt.show()
25+
# Once we have our data we can use `get_io` to find an
26+
# io (Igor in this case). Then we read the analogsignals
27+
# Finally we will make some nice plots
28+
#
29+
# Note: not all IOs have all types of read functionality
30+
# see our documentation for a better understanding of the
31+
# Neo object hierarchy and the functionality of differnt IOs
32+
33+
reader = get_io(localfile)
34+
signal = reader.read_analogsignal()
35+
plt.plot(signal.times, signal)
36+
plt.xlabel(signal.sampling_period.dimensionality)
37+
plt.ylabel(signal.dimensionality)
38+
39+
plt.show()

0 commit comments

Comments
 (0)