one with everything
This commit is contained in:
@@ -254,23 +254,6 @@ def rectify_stimulus_array(stimulus_array: np.ndarray):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
# # X = [0.05, 0.02, 50, 0.1, 0.03]
|
||||
# model = LifacNoiseModel()
|
||||
# # model.set_variable("mem_tau", X[0])
|
||||
# # model.set_variable("noise_strength", X[1])
|
||||
# # model.set_variable("input_scaling", X[2])
|
||||
# # model.set_variable("tau_a", X[3])
|
||||
# # model.set_variable("delta_a", X[4])
|
||||
# stim = SinusoidalStepStimulus(700, 0.2, start_time=1, duration=1)
|
||||
# bf, vs, sc = model.calculate_baseline_markers(700)
|
||||
# print("baseline freq:{:.2f}\nVector strength: {:.3f}\nSerial cor:".format(bf, vs), sc)
|
||||
# contrasts = np.arange(-0.3, 0.31, 0.05)
|
||||
# model.calculate_fi_curve(contrasts, 700)
|
||||
# f_infinities, slope = model.calculate_fi_markers(contrasts, 700)
|
||||
# print("FI-Curve\nSlope: {:.2f}\nValues:".format(slope), f_infinities)
|
||||
# plot_model_during_stimulus(model, stim, 3)
|
||||
|
||||
# quit()
|
||||
|
||||
model_parameters = {'v_offset': -15.234375, 'input_scaling': 64.94152780134829, 'step_size': 5e-05, 'a_zero': 2,
|
||||
'threshold': 1, 'v_base': 0, 'delta_a': 0.04763179657857666, 'tau_a': 0.07891848949732623,
|
||||
@@ -288,7 +271,7 @@ if __name__ == '__main__':
|
||||
|
||||
# test_baseline_polar_plot()
|
||||
# time_test_function()
|
||||
# test_cell_data()
|
||||
test_cell_data()
|
||||
# test_peak_detection()
|
||||
# test_simulation_speed()
|
||||
# test_parameters()
|
||||
|
||||
40
tests/smallest_error_thrower.py
Normal file
40
tests/smallest_error_thrower.py
Normal file
@@ -0,0 +1,40 @@
|
||||
|
||||
import pyrelacs.DataLoader as Dl
|
||||
|
||||
|
||||
def main():
|
||||
traces_missing()
|
||||
|
||||
|
||||
# Index / Value error depending on cell:
|
||||
def throw_error():
|
||||
cell_folder = "../invivo_data/2014-06-06-ah-invivo-1/"
|
||||
repro = "BaselineActivity"
|
||||
|
||||
for info, key, time, x in Dl.iload_traces(cell_folder, repro=repro):
|
||||
continue
|
||||
|
||||
|
||||
def traces_missing():
|
||||
cell_folder = "../invivo_data/2011-10-25-ab-invivo-1"
|
||||
|
||||
repro = "BaselineActivity"
|
||||
|
||||
time_traces = []
|
||||
v1_traces = []
|
||||
eod_traces = []
|
||||
local_eod_traces = []
|
||||
stimulus_traces = []
|
||||
|
||||
for info, key, time, x in Dl.iload_traces(cell_folder, repro=repro):
|
||||
time_traces.append(time)
|
||||
v1_traces.append(x[0])
|
||||
eod_traces.append(x[1])
|
||||
local_eod_traces.append(x[2])
|
||||
stimulus_traces.append(x[3])
|
||||
|
||||
print("num of v1 traces: {:}\nnum of eod traces: {:}\nnum of local eod traces: {:}\nnum of stim traces: {:}".format(len(v1_traces), len(eod_traces), len(local_eod_traces), len(stimulus_traces)))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -1,27 +0,0 @@
|
||||
import pyrelacs.DataLoader as Dl
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
from DataParserFactory import get_parser
|
||||
import pprint
|
||||
from Baseline import get_baseline_class
|
||||
from FiCurve import get_fi_curve_class
|
||||
from CellData import icelldata_of_dir
|
||||
from models.LIFACnoise import LifacNoiseModel
|
||||
|
||||
parameter_bursty_model = {'step_size': 5e-05, 'mem_tau': 0.0066693150193490695, 'v_base': 0, 'v_zero': 0,
|
||||
'threshold': 1, 'v_offset': -45.703125, 'input_scaling': 172.13861987237314,
|
||||
'delta_a': 0.06148215166012024, 'tau_a': 0.03391674075000068, 'a_zero': 2,
|
||||
'noise_strength': 0.0684136549210377, 'dend_tau': 0.0013694103932013805,
|
||||
'refractory_period': 0.001}
|
||||
eod = 752
|
||||
model = LifacNoiseModel(parameter_bursty_model)
|
||||
baseline_model = get_baseline_class(model, 752, trials=2)
|
||||
baseline_model.get_burstiness()
|
||||
|
||||
quit()
|
||||
|
||||
|
||||
for cell_data in icelldata_of_dir("../data/"):
|
||||
baseline = get_baseline_class(cell_data)
|
||||
|
||||
baseline.get_burstiness()
|
||||
Reference in New Issue
Block a user