Python utils
- class python_utils.SpikeSim(path, sim_fname, neglect_t, neglect_t_end=- 1, config_fname='')[source]
Class loading and parsing files given by a simulation. The main attributes are the simulation parameters and results:
end_t: end time of simulation
dt: time resolution of the simulation
input_mode: external input mode:
0 (base mode): each neuron receives an indipendent poisson signal with mean frequency = SubNetwork::ext_in_rate
2 (paper mode): the input to the striatal population is correlated (ask for details)
rho_corr_paper (only with input_mode 2)
data: dictionary with spike times corresponding to each population; data[‘pop’] is a list of np.arrays each containing the activity of a neuron
subnets: a list of the SubNetworks in the simulation
- activityDistribution(pop='', save_img='')[source]
Method computing the distribution of the number of spike of each neuron in the subnetworks
- static crossCorr(x, y, L, rescale=True)[source]
Method computing the cross correlation between two vectors mediated over subvectors of len L Notes: * L must be even and less than len(x)/2 * the two vector must be of the same lenght * if rescale is True (default) each subvector is zscored before calculating the cross correlation; otherways only the mean is subtracted to the data
- histogram(pop='', res=1.0, save_img='')[source]
Method showing or saving the spiking activity of a given subnet
- Parameters
pop (float) – desidered population; if ‘all’ is passed all population are showed.
res – time width of each bin in the histogram
save_img (string) – path and name of the file to be saved
- necglectTime()[source]
Method removing the spikes occurring before t_start and after t_end (if > 0)
- python_utils.load_pkl(path)[source]
Function loading an object from a pickle file.
- Parameters
path (string) – path to the object to be loaded