|
1 | 1 | """ |
2 | | -IgorProIO Demo (BROKEN) |
| 2 | +IgorProIO Demo |
3 | 3 | ======================= |
4 | 4 |
|
5 | 5 | """ |
6 | 6 |
|
7 | 7 | ########################################################### |
8 | 8 | # Import our packages |
9 | | -import os |
| 9 | + |
10 | 10 | from urllib.request import urlretrieve |
11 | | -import zipfile |
12 | 11 | import matplotlib.pyplot as plt |
13 | 12 | from neo.io import get_io |
14 | 13 |
|
15 | 14 | ############################################################# |
16 | 15 | # 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 |
21 | 17 |
|
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) |
26 | 22 |
|
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() |
30 | 23 |
|
31 | 24 | # ###################################################### |
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