nest package

Subpackages

Submodules

nest.raster_plot module

Functions for raster plotting.

nest.raster_plot.extract_events(data, time=None, sel=None)[source]

Extract all events within a given time interval.

Both time and sel may be used at the same time such that all events are extracted for which both conditions are true.

data : list
Matrix such that data[:,0] is a vector of all gids and data[:,1] a vector with the corresponding time stamps.
time : list, optional
List with at most two entries such that time=[t_max] extracts all events with t< t_max time=[t_min, t_max] extracts all events with t_min <= t < t_max
sel : list, optional
List of gids such that sel=[gid1, … , gidn] extracts all events from these gids. All others are discarded.
numpy.array
List of events as (gid, t) tuples
nest.raster_plot.from_data(data, sel=None, **kwargs)[source]

Plot raster plot from data array.

data : list
Matrix such that data[:,0] is a vector of all gids and data[:,1] a vector with the corresponding time stamps.
sel : list, optional
List of gids such that sel=[gid1, … , gidn] extracts all events from these gids. All others are discarded.
kwargs:
Parameters passed to _make_plot
nest.raster_plot.from_device(detec, plot_lid=False, **kwargs)[source]

Plot raster from a spike detector.

detec : TYPE
Description
plot_lid : bool, optional
Whether to convert from local IDs
kwargs:
Parameters passed to _make_plot

nest.NESTError

nest.raster_plot.from_file(fname, **kwargs)[source]

Plot raster from file.

fname : str or tuple(str) or list(str)

File name or list of file names

If a list of files is given, the data from them is concatenated as if it had been stored in a single file - useful when MPI is enabled and data is logged separately for each MPI rank, for example.

kwargs:
Parameters passed to _make_plot
nest.raster_plot.from_file_numpy(fname, **kwargs)[source]

Use numpy.

nest.raster_plot.from_file_pandas(fname, **kwargs)[source]

Use pandas.

nest.visualization module

nest.voltage_trace module

Functions to plot voltage traces.

nest.voltage_trace.from_device(detec, neurons=None, title=None, grayscale=False, timeunit='ms')[source]

Plot the membrane potential of a set of neurons recorded by the given Voltmeter or Multimeter.

detec : list
Global id of Voltmeter or Multimeter in a list, e.g. [1]
neurons : list, optional
Indices of of neurons to plot
title : str, optional
Plot title
grayscale : bool, optional
Plot in grayscale
timeunit : str, optional
Unit of time
nest.NESTError
Description
nest.voltage_trace.from_file(fname, title=None, grayscale=False)[source]

Plot voltage trace from file.

fname : str or list
Filename or list of filenames to load from
title : str, optional
Plot title
grayscale : bool, optional
Plot in grayscale

ValueError

nest.voltage_trace.show()[source]

Call pylab.show() to show all figures and enter the GUI main loop. Python will block until all figure windows are closed again. You should call this function only once at the end of a script.

See also: http://matplotlib.sourceforge.net/faq/howto_faq.html#use-show

Module contents

Initializer of PyNEST.

nest.catching_sli_run(cmd)[source]

Send a command string to the NEST kernel to be executed, catch SLI errors and re-raise them in Python.

cmd : str
The SLI command to be executed.
NESTError
SLI errors are bubbled to the Python API as NESTErrors.
nest.init(argv)[source]

Initializes NEST.

argv : list
Command line arguments, passed to the NEST kernel

_kernel.NESTError

nest.pcd()
nest.sli_func(s, *args, **kwargs)[source]

Convenience function for executing an SLI command s with arguments args.

This executes the SLI sequence: sli_push(args); sli_run(s); y=sli_pop()

s : str
Function to call
*args
Arbitrary number of arguments to pass to the SLI function
**kwargs
namespace : str
The sli code is executed in the given SLI namespace.
litconv : bool
Convert string args beginning with / to literals.

The function may have multiple return values. The number of return values is determined by the SLI function that was called.

r,q = sli_func(‘dup rollu add’,2,3) r = sli_func(‘add’,2,3) r = sli_func(‘add pop’,2,3) l = sli_func(‘CreateLayer’, {…}, namespace=’topology’)

nest.sli_pop()
nest.sli_push()
nest.sli_run(cmd)

Send a command string to the NEST kernel to be executed, catch SLI errors and re-raise them in Python.

cmd : str
The SLI command to be executed.
NESTError
SLI errors are bubbled to the Python API as NESTErrors.
nest.spp()
nest.sps()
nest.sr(cmd)

Send a command string to the NEST kernel to be executed, catch SLI errors and re-raise them in Python.

cmd : str
The SLI command to be executed.
NESTError
SLI errors are bubbled to the Python API as NESTErrors.
nest.test()[source]

Runs all PyNEST unit tests.