manual:python_binary_toolkit
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
manual:python_binary_toolkit [2016/08/10 18:14] – created zenke | manual:python_binary_toolkit [2016/08/30 18:19] – [Auryn Python binary tools] zenke | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Auryn Python | + | ====== Auryn Python |
Auryn v0.8.0 is the first version to come with a set of Python tools which allow decoding from binary files generated with [[BinarySpikeMonitor]] or [[BinaryStateMonitor]]. You can find the Python code in the '' | Auryn v0.8.0 is the first version to come with a set of Python tools which allow decoding from binary files generated with [[BinarySpikeMonitor]] or [[BinaryStateMonitor]]. You can find the Python code in the '' | ||
+ | To use the Auryn tools point your Python path to the '' | ||
+ | < | ||
+ | export PYTHONPATH=$PYTHONPATH:< | ||
+ | </ | ||
===== Example: Plot spikes from spk file ===== | ===== Example: Plot spikes from spk file ===== | ||
Line 12: | Line 16: | ||
import numpy as np | import numpy as np | ||
import pylab as pl | import pylab as pl | ||
- | from auryn_binary_tools | + | from auryntools |
filename | filename | ||
Line 38: | Line 42: | ||
import numpy as np | import numpy as np | ||
import pylab as pl | import pylab as pl | ||
- | from auryn_binary_tools | + | from auryntools |
num_mpi_ranks = 4 | num_mpi_ranks = 4 | ||
Line 67: | Line 71: | ||
import numpy as np | import numpy as np | ||
import pylab as pl | import pylab as pl | ||
- | from auryn_binary_tools | + | from auryntools |
datadir = "/ | datadir = "/ | ||
Line 99: | Line 103: | ||
{{ : | {{ : | ||
as you can see the neuron here is torn between being selective to a square and a triangle. | as you can see the neuron here is torn between being selective to a square and a triangle. | ||
+ | |||
+ | |||
+ | ===== Example: Get membrane potential from BinaryStateMonitor file ===== | ||
+ | |||
+ | Finally, here is an example of howto read binary state monitor files: | ||
+ | |||
+ | <code python> | ||
+ | import numpy as np | ||
+ | import pylab as pl | ||
+ | from auryntools import * | ||
+ | |||
+ | # This code snipped assumes that you have run the example simulation | ||
+ | # sim_epsp_binmon with default parameters and adjusted the below | ||
+ | # filename to its output. | ||
+ | |||
+ | filename | ||
+ | t_from=0.2 | ||
+ | t_to =2.5 | ||
+ | |||
+ | sf = AurynBinaryStateFile(filename) | ||
+ | mem = np.array(sf.get_data(t_from, | ||
+ | |||
+ | pl.plot(mem[:, | ||
+ | pl.xlabel(" | ||
+ | pl.ylabel(" | ||
+ | pl.show() | ||
+ | </ | ||
+ | |||
+ | {{ : |
manual/python_binary_toolkit.txt · Last modified: 2016/08/30 18:21 by zenke