Ejemplo n.º 1
0
from neurotune import optimizers
from neurotune import utils


if __name__ == '__main__':

    showPlots = not (len(sys.argv) == 2 and sys.argv[1] == '-nogui')

    sim_vars = {'amp':     65,
               'period':  250,
               'offset':  -10}

    min_constraints = [60,  150, -20]
    max_constraints = [100, 300, 20]

    swc = SineWaveController(1000, 0.1)


    times, volts = swc.run_individual(sim_vars, showPlots, False)

    weights={'value_200': 1.0,
             'value_400': 1.0,
             'value_812': 1.0}


    data_analysis = evaluators.PointBasedAnalysis(volts, times)
    targets =  data_analysis.analyse(weights.keys())


    print("Target data: %s"%targets)
Ejemplo n.º 2
0
# Implementation of SineWaveController
# moved to: https://github.com/pgleeson/neurotune/blob/master/neurotune/controllers.py

from neurotune.controllers import SineWaveController
    
    
if __name__ == '__main__':

    sim_vars = {'amp':     65,
               'period':  250,
               'offset':  -10}
    
    swc = SineWaveController(1000, 0.1)
        
  
    swc.run_individual(sim_vars, True, True)
    
Ejemplo n.º 3
0
from neurotune import utils
import pprint
from pyelectro import analysis
    
from neurotune.controllers import SineWaveController
    
if __name__ == '__main__':

    sim_vars = {'amp':     65,
               'period':  250,
               'offset':  -10}
               
    min_constraints = [60,  150, -50]
    max_constraints = [100, 300, 50]
    
    swc = SineWaveController(1000, 0.1)
        

    swc.run_individual(sim_vars, True, False)

    times, volts = swc.run_individual(sim_vars, False)

    analysis_var={'peak_delta':0,'baseline':0,'dvdt_threshold':0, 'peak_threshold':0}

    surrogate_analysis=analysis.IClampAnalysis(volts,
                                               times,
                                               analysis_var,
                                               start_analysis=0,
                                               end_analysis=1000,
                                               smooth_data=False,
                                               show_smoothed_data=False)