DataManager is a simple class for managing data produced by multiple runs of a simulation carried out in separate processes or machines. Each process is assigned a unique ID and Python Shelf object to write its data to. Each shelf is a dictionary whose keys must be strings. The DataManager can collate information across multiple shelves using the get(key) method, which returns a dictionary with keys the unique session names, and values the value written in that session (typically only the values will be of interest). If each value is a tuple or list then you can use the get_merged(key) to get a concatenated list. If the data type is more complicated you can use the get(key) method and merge by hand. The idea is each process generates files with names that do not interfere with each other so that there are no file concurrency issues, and then in the data analysis phase, the data generated separately by each process is merged together.
Methods:
Attributes:
The following function describes how to load Address-Event Representation files (AER files). See also the AERSpikeMonitor for saving spikes in that format, and SpikeGeneratorGroup for reusing them in a simulation.
Loads Address Event Representation (AER) data files for use in Brian. Files contain spikes as a binary representation of an address (i.e. neuron identifier) and a timestamp.
This function returns two arrays, an array of addresses (neuron indices) and an array of spike times (in second).
Note: For index files (that point to multiple .(ae)dat files, typically aeidx files) it will return a list containing tuples (addr, time) as for single files.
Usage:
ids, times = load_aer(‘/path/to/file.aedat’)
Keyword Arguments:
reinit_time If True, sets the first spike time to zero and all others relative to that one.
check_sorted If True, checks if timestamps are sorted, and sorts them if necessary.
Example use:
To use the spikes recorded in the AER file filename in a Brian NeuronGroup, one should do:
addr, timestamp = load_AER(filename, reinit_time = True) G = AERSpikeGeneratorGroup((addr, timestamps))
An example script can be found in examples/misc/spikes_io.py