plot burstiness
This commit is contained in:
parent
bf8634a247
commit
7f8391ba4f
71
test.py
71
test.py
@ -1,68 +1,25 @@
|
||||
|
||||
from Baseline import get_baseline_class
|
||||
from CellData import CellData
|
||||
from CellData import CellData, icelldata_of_dir
|
||||
from models.LIFACnoise import LifacNoiseModel
|
||||
from Baseline import BaselineCellData, BaselineModel
|
||||
from os import listdir
|
||||
import numpy as np
|
||||
from IPython import embed
|
||||
import pyrelacs.DataLoader as Dl
|
||||
from ModelFit import ModelFit
|
||||
|
||||
|
||||
|
||||
fit = ModelFit("results/invivo_results/start_parameter_7_err_6.87/")
|
||||
|
||||
print(fit.comparable_error())
|
||||
fit.generate_master_plot()
|
||||
|
||||
|
||||
|
||||
quit()
|
||||
|
||||
|
||||
|
||||
def icelldata_of_dir(base_path):
|
||||
global COUNT
|
||||
for item in sorted(listdir(base_path)):
|
||||
item_path = base_path + item
|
||||
|
||||
try:
|
||||
data = CellData(item_path)
|
||||
|
||||
yield data
|
||||
|
||||
except TypeError as e:
|
||||
print(str(e))
|
||||
|
||||
except IndexError as e:
|
||||
print(str(e), "\n")
|
||||
|
||||
except ValueError as e:
|
||||
print(str(e), "\n")
|
||||
|
||||
print("Currently throw errors: {}".format(COUNT))
|
||||
|
||||
|
||||
for data in icelldata_of_dir("invivo_data/"):
|
||||
v1 = data.get_base_traces(data.V1)
|
||||
|
||||
if len(v1) == 0:
|
||||
embed()
|
||||
quit()
|
||||
|
||||
|
||||
quit()
|
||||
|
||||
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()
|
||||
|
||||
from FiCurve import FICurveModel
|
||||
import os
|
||||
import matplotlib.pyplot as plt
|
||||
vs = []
|
||||
for cell in icelldata_of_dir("invivo_data/"):
|
||||
base = BaselineCellData(cell)
|
||||
|
||||
vs.append(base.get_burstiness())
|
||||
|
||||
bins = np.arange(0, 1.05, 0.05)
|
||||
plt.hist(vs, bins=bins)
|
||||
plt.show()
|
||||
quit()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user