Esempio n. 1
0
        time_range = None
    else:
        if t_min is None:
            time_range = [0.0, t_max]
        else:
            time_range = [t_min, t_max]

    if not populations:
        populations = ['eachPop']

    if graph_type is None:
        graph_type = 'matrix'

    plot.plot_spike_histogram_autocorr(spike_events_path,
                                       spike_events_namespace,
                                       include=populations,
                                       time_range=time_range,
                                       time_variable=t_variable,
                                       lag=lag,
                                       bin_size=spike_hist_bin,
                                       maxCells=max_cells,
                                       graph_type=graph_type,
                                       fontSize=font_size,
                                       saveFig=True)


if __name__ == '__main__':
    main(args=sys.argv[(
        utils.list_find(lambda x: os.path.basename(x) == script_name, sys.argv
                        ) + 1):])
Esempio n. 2
0
            new_response_dict = {}
            if gid is not None:

                random_gid = random_gids[gid-population_start]
                new_response_dict[random_gid] = {'rate': stimulus_dict['rate'],
                                                 'spiketrain': np.asarray(stimulus_dict['spiketrain'],
                                                                          dtype=np.float32),
                                                 'modulation': stimulus_dict['modulation'],
                                                 'peak_index': stimulus_dict['peak_index'] }

                print('Rank %i; source: %s; assigned spike trains for gid %i to gid %i in %.2f s' % \
                      (rank, population, gid, random_gid+population_start, time.time() - local_time))
                count += 1
            if not debug:
                append_cell_attributes(comm, stimulus_path, population, new_response_dict,
                                       namespace=output_stimulus_namespace,
                                       io_size=io_size, chunk_size=chunk_size,
                                       value_chunk_size=value_chunk_size)
            sys.stdout.flush()
            del new_response_dict
            gc.collect()

        global_count = comm.gather(count, root=0)
        if rank == 0:
            print('%i ranks randomized spike trains for %i cells in %.2f s' % (comm.size, np.sum(global_count),
                                                                               time.time() - start_time))


if __name__ == '__main__':
    main(args=sys.argv[(utils.list_find(lambda s: s.find(script_name) != -1,sys.argv)+1):])