multimeter – Sampling continuous quantities from neurons
Description
The multimeter
allows to record analog values from neurons.
Differently from NEST, a multimeter can be created using the command
CreateRecord
and takes as input the following parameters:
a string representing the label of the record
a list of strings with the name of the parameter to be recorded
a list of node ids from the nodes to be recorded
a list of integers indicating the node port to be recorded
Thus, the recording of the membrane potential for a single neuron can be done as follows:
recorder = nestgpu.CreateRecord('label', ['V_m'], [neuron[0]], [0]})
The lenght of the lists should be the same for all the three list
entries of CreateRecord
.
The sampling interval for recordings is the same one as the simulation resolution (default 0.1 ms) and cannot be changed.
Differently from the NEST multimeter, the recorder should not be connected
with the nodes through a Connect routine since the nodes connected
to the record are specified in the CreateRecord
routine.
The command GetRecordData
returns, after the simulation, an
array containing the values of the parameters recorded for every node
specified in the CreateRecord
routine. In particular the array
has a dimension of simulated_time/resolution * n_nodes+1
, where the
first column shows the time simulated and the other columns shows the value of
the parameter recorded for every node. The number of rows and columns
can also be retreived through the commands GetRecordDataRows
and
GetRecordDataColumns
. Here follows an example:
rows = nestgpu.GetRecordDataRows(recorder)
columns = nestgpu.GetRecordDataColumns(recorder)
print("recorder has {} rows and {} columns".format(rows, columns))
recorded_data = nestgpu.GetRecordData(record)
time = [row[0] for row in recorded_data]
variable = [row[1] for row in recorded_data]