예제 #1
0
def new_simu((psfile, num_file, tot_file, check_repo_is_dirty)):
    """Run a simulation using the specified parameter set file"""
    filedir = path.dirname(psfile) + "/"
    # Register system state
    info = get_sys_state(check_repo_is_dirty)

    # Creating simulation run arguments
    args = SIM_PARSER.parse_args([psfile, "--no-plot", "--no-brian-output", "--no-summary"])

    # Run simulation and get results
    paramset, results = multiglom_network.main(args)

    # Write the simulation to HDF5
    nfilename = filedir + info["time"].replace(":", "-")
    nfilename += "_" + info["uuid"] + ".h5"
    init_data_h5(nfilename)
    write_simu_data(nfilename, info, paramset, results)
        # Compute one mean for interconnected neurons and another for the other neurons
        mean_pop = np.mean(subpop_memb_pot[~subpop_interco_neurons], axis=0)
        mean_pop_interco = np.mean(subpop_memb_pot[subpop_interco_neurons], axis=0)
        mean_memb_pot[glom*2] = mean_pop
        mean_memb_pot[glom*2 + 1] = mean_pop_interco

    results['data'] = {'spikes_it': [array_spikes_it,
                           "Spikes: one array for the neuron number, another one for the spike times."],
                       'input': [mean_inputs,
                           "Mean network input conductance value for each glomerule."],
                       's_granule': [monit_gr['s'].values,
                           "Variable 's' of the granules."],
                       's_syn_self': [monit_gr['s_syn_self'].values,
                           "Variable 's_syn' for the granule, without  integrating the mitral 's' from other subpopulations."],
                       'mean_memb_pot': [mean_memb_pot,
                            "Mean membrane potential. For each subpop: one mean for the interconnected neurons and one mean for the non-interconnected neurons."]}

    results['indexes'] = {'MPS': mps_indexes, 'STS': sts_indexes, 'FFTMAX': fftmax,
                          'peak_distances': peak_distances}

    return {'set': model.PARAMETERS, 'arrays': ps_arrays}, results


if __name__ == '__main__':
    # Argument parsing
    from arg_parsers import SIM_PARSER
    args = SIM_PARSER.parse_args()

    # Run script
    ps, res = main(args)