pictures
This commit is contained in:
parent
7a916adbb4
commit
ad1bf43cb5
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 60 KiB |
@ -29,7 +29,7 @@ def data_overview3():
|
||||
row = 2 # sharex=True,
|
||||
|
||||
plot_style()
|
||||
default_figsize(column=2, length=4.2) #65.5
|
||||
default_figsize(column=2, length=6.2) #65.5
|
||||
#fig, ax = plt.subplots(4, 2) # , figsize=(14, 7.5) constrained_layout=True,
|
||||
var_it = 'Response Modulation [Hz]'
|
||||
var_it2 = ''
|
||||
@ -45,8 +45,8 @@ def data_overview3():
|
||||
right = 0.85
|
||||
ws = 0.75
|
||||
print(right)
|
||||
grid0 = gridspec.GridSpec(2, 2, wspace=ws, bottom=0.13,
|
||||
hspace=0.3, left=0.1, right=right, top=0.95)
|
||||
grid0 = gridspec.GridSpec(3, 2, wspace=ws, bottom=0.13,
|
||||
hspace=0.45, left=0.1, right=right, top=0.95)
|
||||
|
||||
###################################
|
||||
###############################
|
||||
@ -86,9 +86,7 @@ def data_overview3():
|
||||
scores = ['max(diag5Hz)/med_diagonal_proj_fr','max(diag5Hz)/med_diagonal_proj_fr',
|
||||
] # + '_diagonal_proj'
|
||||
|
||||
|
||||
|
||||
|
||||
max_xs = [[5,5,[]],[[],[],[]]]
|
||||
for c, cell_type_here in enumerate(cell_types):
|
||||
frame_file = setting_overview_score(frame_load_sp, cell_type_here, min_amp='range', species=species)
|
||||
|
||||
@ -111,17 +109,18 @@ def data_overview3():
|
||||
colorbar = False
|
||||
#if colorbar:
|
||||
|
||||
x_axis = ['cv_base','response_modulation']#,'fr_base']#
|
||||
var_item_names = [var_it,var_it2]#,var_it2]#['Response Modulation [Hz]',]
|
||||
var_types = ['response_modulation','']#,'']#'response_modulation'
|
||||
x_axis_names = ['CV','Response Modulation [Hz]']#$_{Base}$,'Fr$_{Base}$',]
|
||||
x_axis = ['cv_base','cv_stim','response_modulation']#,'fr_base']#
|
||||
var_item_names = [var_it,var_it,var_it2]#,var_it2]#['Response Modulation [Hz]',]
|
||||
var_types = ['response_modulation','response_modulation','']#,'']#'response_modulation'
|
||||
max_x = max_xs[c]
|
||||
x_axis_names = ['CV$_{Base}$','CV$_{stim}$','Response Modulation [Hz]']#$_{Base}$,'Fr$_{Base}$',]
|
||||
#score = scores[0]
|
||||
score_n = ['Perc99/Med', 'Perc99/Med']
|
||||
score_n = ['Perc99/Med', 'Perc99/Med', 'Perc99/Med']
|
||||
score = scores[c]
|
||||
scores_here = [score,score]#,score]
|
||||
scores_here = [score,score,score]#,score]
|
||||
score_name = ['max(diag5Hz)/med_diagonal_proj_fr','max(diag5Hz)/med_diagonal_proj_fr']#,'max(diag5Hz)/med_diagonal_proj_fr']#'Perc99/Med'
|
||||
score_name = ['Fr/Med', 'Fr/Med']#'Fr/Med'] # 'Perc99/Med'
|
||||
score_name = [NLI_scorename(), NLI_scorename()]#NLI_scorename()] # 'Fr/Med''Perc99/Med'
|
||||
score_name = [NLI_scorename(), NLI_scorename(), NLI_scorename()]#NLI_scorename()] # 'Fr/Med''Perc99/Med'
|
||||
ax_j = []
|
||||
axls = []
|
||||
axss = []
|
||||
@ -132,6 +131,7 @@ def data_overview3():
|
||||
log = False
|
||||
|
||||
|
||||
marker = ['o']
|
||||
for v, var_type in enumerate(var_types):
|
||||
# ax = plt.subplot(grid0[1+v])#grid_lower[0, v]
|
||||
|
||||
@ -149,9 +149,11 @@ def data_overview3():
|
||||
else:
|
||||
xlimk = None
|
||||
|
||||
cmap, _, y_axis = plt_burst_modulation_hists(axk, axl, var_item_names[v], axs, cell_type_here,
|
||||
x_axis[v], frame_file, max_val, scores_here[v],
|
||||
burst_fraction=burst_fraction[c],xlim = xlimk, ha = 'right', x_pos = 1, xmin = xmin, ymin = ymin, burst_fraction_reset = burst_corr_reset,var_item=var_type)
|
||||
cmap, _, y_axis = plt_burst_modulation_hists(axk, axl, var_item_names[v], axs, cell_type_here, x_axis[v],
|
||||
frame_file, scores_here[v], ymin=ymin, xmin=xmin,
|
||||
burst_fraction_reset=burst_corr_reset, var_item=var_type,
|
||||
max_x=max_x[v], xlim=xlimk, x_pos=1,
|
||||
burst_fraction=burst_fraction[c], ha='right')
|
||||
|
||||
if v == 0:
|
||||
colors = colors_overview()
|
||||
@ -161,10 +163,12 @@ def data_overview3():
|
||||
axl.show_spines('')
|
||||
axs.set_ylabel(score_name[v])
|
||||
axs.set_xlabel(x_axis_names[v])
|
||||
if (' P-unit' in cell_type_here) & (x_axis[v] == 'cv_base' ):
|
||||
axs.set_xlim(xlimk)
|
||||
axk.set_xlim(xlimk)
|
||||
#embed()
|
||||
extra_lim = False
|
||||
if extra_lim:
|
||||
if (' P-unit' in cell_type_here) & ('cv' in x_axis[v]):
|
||||
axs.set_xlim(xlimk)
|
||||
axk.set_xlim(xlimk)
|
||||
#embed()
|
||||
#remove_yticks(axl)
|
||||
|
||||
if log:
|
||||
@ -174,7 +178,7 @@ def data_overview3():
|
||||
axl.minorticks_off()
|
||||
axl.set_yticks_blank()
|
||||
|
||||
plt_specific_cells(axs, cell_type_here, x_axis[v], frame_file, scores_here[v])
|
||||
plt_specific_cells(axs, cell_type_here, x_axis[v], frame_file, scores_here[v], marker = ['o',"s"])
|
||||
tags.append(axk)
|
||||
counter += 1
|
||||
#plt.show()
|
||||
@ -400,7 +404,7 @@ def start_name(cell_type_here, species):
|
||||
return species[0:7] + ' ' + cell_type_here[0:7]
|
||||
|
||||
|
||||
def plt_specific_cells(axs, cell_type_here, cv_name, frame_file, score):
|
||||
def plt_specific_cells(axs, cell_type_here, cv_name, frame_file, score, marker = []):
|
||||
######################################################
|
||||
# hier kommen die kontrast Punkte dazu
|
||||
# für die Zellen spielt Burst correctin ja keine Rolle
|
||||
@ -414,9 +418,16 @@ def plt_specific_cells(axs, cell_type_here, cv_name, frame_file, score):
|
||||
# ax = plt.subplot(grid[1, cv_n])
|
||||
# todo: hier nur noch die kleinste und größte Amplitude nehmen
|
||||
# embed()
|
||||
axs.scatter(frame_file[cv_name].loc[cells_extra], frame_file[score].loc[cells_extra],
|
||||
s=9, facecolor="None", edgecolor='black', alpha=0.7, clip_on=False) # colors[str(cell_type_here)]
|
||||
#embed()
|
||||
if not marker:
|
||||
axs.scatter(frame_file[cv_name].loc[cells_extra], frame_file[score].loc[cells_extra],
|
||||
s=9, facecolor="None", edgecolor='black', alpha=0.7, clip_on=False) # colors[str(cell_type_here)]
|
||||
else:
|
||||
#embed()
|
||||
axs.scatter(frame_file[cv_name].loc[cells_extra][0:2], frame_file[score].loc[cells_extra][0:2],
|
||||
s=9, facecolor="None", marker = marker[1], edgecolor='black', alpha=0.7, clip_on=False) # colors[str(cell_type_here)]
|
||||
axs.scatter(frame_file[cv_name].loc[cells_extra][2:4], frame_file[score].loc[cells_extra][2:4],
|
||||
s=9, facecolor="None", marker = marker[0], edgecolor='black', alpha=0.7, clip_on=False) # colors[str(cell_type_here)]
|
||||
|
||||
|
||||
def plt_var_axis(ax_j, axls, axss,score_name, burst_fraction, cell_type_here, counter, cv_name, frame_file, grid0, max_val, score,
|
||||
scores_here, var_item_names, var_types, x_axis, x_axis_names, log = False):
|
||||
@ -425,9 +436,9 @@ def plt_var_axis(ax_j, axls, axss,score_name, burst_fraction, cell_type_here, co
|
||||
|
||||
axk, axl, axs, axls, axss, ax_j = get_grid_4(ax_j, axls, axss, grid0[counter])
|
||||
counter += 1
|
||||
cmap, _, y_axis = plt_burst_modulation_hists(axk, axl, var_item_names[v], axs, cell_type_here,
|
||||
x_axis[v], frame_file, max_val, scores_here[v],
|
||||
burst_fraction=burst_fraction[v], var_item=var_type)
|
||||
cmap, _, y_axis = plt_burst_modulation_hists(axk, axl, var_item_names[v], axs, cell_type_here, x_axis[v],
|
||||
frame_file, scores_here[v], var_item=var_type,
|
||||
burst_fraction=burst_fraction[v])
|
||||
axs.set_ylabel(score_name[v])
|
||||
axs.set_xlabel(x_axis_names[v])
|
||||
if v in [0, 1]:
|
||||
|
BIN
motivation.pdf
BIN
motivation.pdf
Binary file not shown.
BIN
motivation.png
BIN
motivation.png
Binary file not shown.
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 47 KiB |
@ -171,7 +171,7 @@ def motivation_all_small(dev_desired = '1',ylim=[-1.25, 1.25], c1=10, dfs=['m1',
|
||||
# load plotting arrays
|
||||
arrays, arrays_original, spikes_pure = save_arrays_susept(
|
||||
data_dir, cell, c, b, chirps, devs, extract, group_mean, mean_type, plot_group=0,
|
||||
rocextra=False, sorted_on=sorted_on, dev_desired = dev_desired)
|
||||
rocextra=False, sorted_on=sorted_on, base_several = True, dev_desired = dev_desired)
|
||||
####################################################
|
||||
|
||||
####################################################
|
||||
@ -306,17 +306,47 @@ def motivation_all_small(dev_desired = '1',ylim=[-1.25, 1.25], c1=10, dfs=['m1',
|
||||
fr = len(spikes_pure['base_0'][i])/duration
|
||||
frs.append(fr)
|
||||
fr = np.mean(frs)
|
||||
|
||||
#embed()
|
||||
# embed()
|
||||
base_several = False
|
||||
if base_several:
|
||||
spikes_new = []
|
||||
for i in range(len(spikes_pure['base_0'])):
|
||||
duration = 100
|
||||
duration_full = 101#501
|
||||
dur = np.arange(0, duration_full, duration)
|
||||
for d_nr in range(len(dur) - 1):
|
||||
#embed()
|
||||
spikes_new.append(np.array(spikes_pure['base_0'][i][
|
||||
(spikes_pure['base_0'][i] > dur[d_nr]) & (
|
||||
spikes_pure['base_0'][i] < dur[
|
||||
d_nr + 1])])/1000-dur[d_nr]/1000)
|
||||
# spikes_pure['base_0'] = spikes_new
|
||||
|
||||
sampling_rate = 1/np.diff(time_array)
|
||||
sampling_rate = int(sampling_rate[0]*1000)
|
||||
spikes_mats = []
|
||||
smoothed05 = []
|
||||
for i in range(len(spikes_new)):
|
||||
spikes_mat = cr_spikes_mat(spikes_new[i], sampling_rate, int(sampling_rate*duration/1000))
|
||||
spikes_mats.append(spikes_mat)
|
||||
smoothed05.append(gaussian_filter(spikes_mat, sigma=(float(dev_desired)/1000) * sampling_rate))
|
||||
smoothed_base = np.mean(smoothed05, axis=0)
|
||||
mat_base = np.mean(spikes_mats, axis=0)
|
||||
else:
|
||||
smoothed_base = arrays[0][0]
|
||||
mat_base = arrays_original[0][0]
|
||||
#embed()#arrays[0]v
|
||||
fr_isi, ax_ps, ax_as = plot_arrays_ROC_psd_single3(
|
||||
[arrays[0], arrays[2], arrays[1], arrays[3]],
|
||||
[arrays_original[0], arrays_original[2], arrays_original[1],
|
||||
[[smoothed_base], arrays[2], arrays[1], arrays[3]],
|
||||
[[mat_base], arrays_original[2], arrays_original[1],
|
||||
arrays_original[3]], spikes_pure, fr, cell, grid0, chirps, extract,
|
||||
mean_type,
|
||||
group_mean, b, devs,
|
||||
xlim=xlim, row=1 + d * 3,
|
||||
array_chosen=array_chosen,
|
||||
color0_burst=color0_burst, mean_types=[mean_type],
|
||||
color01=color01, color02=color02,
|
||||
color01=color01, color02=color02,ylim_log=(-15, 3),
|
||||
color012=color012,color012_minus = 'pink',
|
||||
color01_2=color01_2)
|
||||
|
||||
@ -345,7 +375,7 @@ def motivation_all_small(dev_desired = '1',ylim=[-1.25, 1.25], c1=10, dfs=['m1',
|
||||
# plt.show()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
motivation_all_small(dev_desired = '1.5', c1=10, mult_type='_multsorted2_', devs=['05'], redo=True, save=True, end='all',
|
||||
if __name__ == '__main__':#2.5
|
||||
motivation_all_small(dev_desired = '1', c1=10, mult_type='_multsorted2_', devs=['05'], redo=True, save=True, end='all',
|
||||
cut_matrix='malefemale', chose_score='mean_nrs', restrict='modulation_no_classes', step='50',
|
||||
detections=['MeanTrialsIndexPhaseSort'], sorted_on='LocalReconst0.2NormAm')#
|
||||
|
29878
motivation_05_012.csv
29878
motivation_05_012.csv
File diff suppressed because it is too large
Load Diff
33906
motivation_05_base_0.csv
33906
motivation_05_base_0.csv
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -408,7 +408,7 @@ In this work, the influence of nonlinearities on stimulus encoding in the primar
|
||||
|
||||
Nonlinear processes are fundamental in neuronal information processing. On the systemic level: deciding to take one or another action is a nonlinear process. On a finer scale, neurons are inherently nonlinear: whether an action potential is elicited depends on the membrane potential to exceed a certain threshold\citealp{Adelson1985, Brincat2004, Chacron2000, Chacron2001, Nelson1997, Gussin2007, Middleton2007, Longtin2008}. In conjunction with neuronal noise, nonlinear mechanism facilitate the encoding of weak stimuli via stochastic resonance\citealp{Wiesenfeld1995, Stocks2000,Neiman2011fish}. We can find nonlinearities in many sensory systems such as rectification in the transduction machinery of inner hair cells \citealp{Peterson2019}, signal rectification in electroreceptor cells \citealp{Chacron2000, Chacron2001}, or in complex cells of the visual system \citealp{Adelson1985}. In the auditory or the active electric sense, for example, nonlinear processes are needed to extract envelopes, i.e. amplitude modulations of a carrier signal\citealp{Joris2004, Barayeu2023} called beats. Beats are common stimuli in different sensory modalities enabling rhythm and pitch perception in human hearing \citealp{Roeber1834, Plomp1967, Joris2004, Grahn2012} and providing context for electrocommunication in weakly electric fish \citealp{Engler2001, Hupe2008, Henninger2018, Benda2020}.
|
||||
|
||||
While the sensory periphery can often be well described by linear models, this is not valid for many upstream neurons. Rather, nonlinear processes are implemented to extract special stimulus features\citealp{Gabbiani1996}. In active electrosensation, the self-generated electric field (electric organ discharge, EOD)\citealp{Salazar2013} that is quasi sinusoidal in wavetype electric fish and acts as the carrier signal that is amplitude modulated in the context of communication\citealp{Benda2013, Fotowat2013, Walz2014, Henninger2018} as well as object detection and navigation\citealp{Fotowat2013, Nelson1999}. In social contexts, the interference of the EODs of two interacting animals result in a characteristic periodic amplitude modulation, the so-called beat. The beat amplitude is defined by the smaller EOD amplitude, its frequency is defined as the difference between the two EOD frequencies ($\Delta f = f-\feod{}$, valid for $f < feod{}/2$\citealp{Barayeu2023}). Cutaneous electroreceptor organs that are distributed over the bodies of these fish \citealp{Carr1982} are tuned to the own field\citealp{Hopkins1976,Viancour1979}. P-type electroreceptor afferents (P-units) innervate these organs via ribbon synapses\citealp{Szabo1965, Wachtel1966} and project to the hindbrain where they trifurcate and synapse onto pyramidal cells in the electrosensory lateral line lobe (ELL)\citealp{Krahe2014}. The P-units ot the gymnotiform electric fish \lepto{} encode such amplitude modulations (AMs) by modulation of their firing rate\citealp{Gabbiani1996}. They fire probabilistically but phase-locked to the own EOD and the skipping of cycles leads to their characteristic multimodal interspike interval distribution. Even though the extraction of the AM itself requires a nonlinearity\citealp{Middleton2006,Stamper2012Envelope,Savard2011} encoding the time-course of the AM is linear over a wide range\citealp{Xu1996,Benda2005,Gussin2007,Grewe2017,Savard2011}. In the context of social signalling among three fish we observe an AM of the AM, also referred to as second-order envelope or just social envelope\citealp{Middleton2006, Savard2011, Stamper2012Envelope}. Encoding this again requires nonlinearities\citealp{Middleton2006} and it was shown that a subpopulation of P-units are sensitive to envelopes\citealp{Savard2011} and exhibit nonlinearities e.g. when driven by strong stimuli\citealp{Nelson1997,Chacron2004}.
|
||||
While the sensory periphery can often be well described by linear models, this is not true for many upstream neurons. Rather, nonlinear processes are implemented to extract special stimulus features\citealp{Gabbiani1996}. In active electrosensation, the self-generated electric field (electric organ discharge, EOD)\citealp{Salazar2013} that is quasi sinusoidal in wavetype electric fish and acts as the carrier signal that is amplitude modulated in the context of communication\citealp{Benda2013, Fotowat2013, Walz2014, Henninger2018} as well as object detection and navigation\citealp{Fotowat2013, Nelson1999}. In social contexts, the interference of the EODs of two interacting animals result in a characteristic periodic amplitude modulation, the so-called beat. The beat amplitude is defined by the smaller EOD amplitude, its frequency is defined as the difference between the two EOD frequencies ($\Delta f = f-\feod{}$, valid for $f < feod{}/2$)\citealp{Barayeu2023}. Cutaneous electroreceptor organs that are distributed over the bodies of these fish \citealp{Carr1982} are tuned to the own field\citealp{Hopkins1976,Viancour1979}. P-type electroreceptor afferents (P-units) innervate these organs via ribbon synapses\citealp{Szabo1965, Wachtel1966} and project to the hindbrain where they trifurcate and synapse onto pyramidal cells in the electrosensory lateral line lobe (ELL)\citealp{Krahe2014}. The P-units ot the gymnotiform electric fish \lepto{} encode such amplitude modulations (AMs) by modulation of their firing rate\citealp{Gabbiani1996}. They fire probabilistically but phase-locked to the own EOD and the skipping of cycles leads to their characteristic multimodal interspike interval distribution. Even though the extraction of the AM itself requires a nonlinearity\citealp{Middleton2006,Stamper2012Envelope,Savard2011} encoding the time-course of the AM is linear over a wide range\citealp{Xu1996,Benda2005,Gussin2007,Grewe2017,Savard2011}. In the context of social signalling among three fish we observe an AM of the AM, also referred to as second-order envelope or just social envelope\citealp{Middleton2006, Savard2011, Stamper2012Envelope}. Encoding this again requires nonlinearities\citealp{Middleton2006} and it was shown that a subpopulation of P-units are sensitive to envelopes\citealp{Savard2011} and exhibit nonlinearities e.g. when driven by strong stimuli\citealp{Nelson1997,Chacron2004}.
|
||||
|
||||
\begin{figure*}[h!]
|
||||
\includegraphics[width=\columnwidth]{motivation}
|
||||
|
216
trialnr.py
Normal file
216
trialnr.py
Normal file
@ -0,0 +1,216 @@
|
||||
#from utils_suseptibility import default_settings
|
||||
#from plt_RAM import model_and_data_isi, model_cells
|
||||
|
||||
#from utils_suseptibility import model_and_data, remove_yticks
|
||||
#from utils_suseptibility import *
|
||||
#from utils_susept import nonlin_title, plt_data_susept, plt_single_square_modl, set_clim_same_here, set_xlabel_arrow, \
|
||||
# set_ylabel_arrow, \
|
||||
# xpos_y_modelanddata
|
||||
|
||||
#from utils_all import default_settings, find_cell_add, get_flowchart_params, load_folder_name, load_model_susept, \
|
||||
# overlap_cells, \
|
||||
# plot_lowpass2, plt_time_arrays, remove_xticks, remove_yticks, resave_small_files, save_visualization, set_same_ylim
|
||||
from utils_suseptibility import *#model_and_data
|
||||
|
||||
#from plt_RAM import model_and_data, model_and_data_sheme, model_and_data_vertical2
|
||||
|
||||
def table_printen(table):
|
||||
print(table.keys())
|
||||
for l in range(len(table)):
|
||||
list_here = np.array(table.iloc[l])
|
||||
l1 = "& ".join(list_here)
|
||||
print(l1)
|
||||
|
||||
|
||||
def trialnr(eod_metrice = False, width=0.005, nffts=['whole'], powers=[1], cells=["2013-01-08-aa-invivo-1"], show=False,
|
||||
contrasts=[0], noises_added=[''], D_extraction_method=['additiv_cv_adapt_factor_scaled'],
|
||||
internal_noise=['RAM'], external_noise=['RAM'], level_extraction=[''], receiver_contrast=[1],
|
||||
dendrids=[''], ref_types=[''], adapt_types=[''], c_noises=[0.1], c_signal=[0.9], cut_offs1=[300],
|
||||
label=r'$\frac{1}{mV^2S}$'): # ['eRAM']
|
||||
# plot_style()#['_RAMscaled']'_RAMscaled'
|
||||
|
||||
duration_noise = '_short',
|
||||
formula = 'code' ##'formula'
|
||||
# ,int(2 ** 16) int(2 ** 16), int(2 ** 15),
|
||||
stimulus_length = 1 # 20#550 # 30 # 15#45#0.5#1.5 15 45 100
|
||||
trials_nrs = [1] # [100, 500, 1000, 3000, 10000, 100000, 1000000] # 500
|
||||
stimulus_type = '_StimulusOrig_' # ,#
|
||||
# ,3]#, 3, 1, 1.5, 0.5, ] # ,1,1.5, 0.5] #[1,1.5, 0.5] # 1.5,0.5]3, 1,
|
||||
variant = 'sinz'
|
||||
mimick = 'no'
|
||||
cell_recording_save_name = ''
|
||||
trans = 1 # 5
|
||||
rep = 1000000 # 500000#0
|
||||
repeats = [20, rep] # 250000
|
||||
aa = 0
|
||||
good_data, remaining = overlap_cells()
|
||||
cells_all = [good_data[0]]
|
||||
|
||||
plot_style()
|
||||
default_figsize(column=2, length=3.1) #.254.75 0.75
|
||||
#grid = gridspec.GridSpec(2, 5, wspace=0.95, bottom=0.09,
|
||||
# hspace=0.25, width_ratios = [1,0,1,1,1], left=0.09, right=0.93, top=0.9)
|
||||
|
||||
a = 0
|
||||
maxs = []
|
||||
mins = []
|
||||
mats = []
|
||||
ims = []
|
||||
perc05 = []
|
||||
perc95 = []
|
||||
iternames = [D_extraction_method, external_noise,
|
||||
internal_noise, powers, nffts, dendrids, cut_offs1, trials_nrs, c_signal,
|
||||
c_noises,
|
||||
ref_types, adapt_types, noises_added, level_extraction, receiver_contrast, contrasts, ]
|
||||
|
||||
nr = '2'
|
||||
# embed()
|
||||
# cell_contrasts = ["2013-01-08-aa-invivo-1"]
|
||||
# cells_triangl_contrast = np.concatenate([cells_all,cell_contrasts])
|
||||
# cells_triangl_contrast = 1
|
||||
# cell_contrasts = 1
|
||||
|
||||
rows = len(cells_all) # len(good_data)+len(cell_contrasts)
|
||||
perc = 'perc'
|
||||
lp = 2
|
||||
label_model = r'Nonlinearity $\frac{1}{S}$'
|
||||
for all in it.product(*iternames):
|
||||
|
||||
var_type, stim_type_afe, stim_type_noise, power, nfft, dendrid, cut_off1, trial_nrs, c_sig, c_noise, ref_type, adapt_type, noise_added, extract, a_fr, a_fe = all
|
||||
# print(trials_stim,stim_type_noise, power, nfft, a_fe,a_fr, dendrid, var_type, cut_off1,trial_nrs)
|
||||
fig = plt.figure()
|
||||
|
||||
hs = 0.45
|
||||
|
||||
|
||||
##################################
|
||||
# model part
|
||||
|
||||
trial_nr = 500000
|
||||
cell = '2013-01-08-aa-invivo-1'
|
||||
cell = '2012-07-03-ak-invivo-1'
|
||||
print('cell'+str(cell))
|
||||
cells_given = [cell]
|
||||
save_name_rev = load_folder_name(
|
||||
'calc_model') + '/' + 'calc_RAM_model-2__nfft_whole_power_1_RAM_additiv_cv_adapt_factor_scaled_cNoise_0.1_cSig_0.9_cutoff1_300_cutoff2_300no_sinz_length1_TrialsStim_' + str(
|
||||
trial_nr) + '_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV_revQuadrant_'
|
||||
# for trial in trials:#.009
|
||||
trial_nr = 1000000#1000000
|
||||
trial_nrs_here = trial_nrs_ram_model()
|
||||
stacks = []
|
||||
perc95 = []
|
||||
perc05 = []
|
||||
median = []
|
||||
|
||||
for tr in trial_nrs_here:
|
||||
save_names = [
|
||||
'calc_RAM_model-2__nfft_whole_power_1_RAM_additiv_cv_adapt_factor_scaled_cNoise_0.1_cSig_0.9_cutoff1_300_cutoff2_300no_sinz_length1_TrialsStim_'+str(tr)+'_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV',]
|
||||
|
||||
#'calc_RAM_model-2__nfft_whole_power_1_RAM_additiv_cv_adapt_factor_scaled_cNoise_0.1_cSig_0.9_cutoff1_300_cutoff2_300no_sinz_length1_TrialsStim_5000000_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV'
|
||||
#'calc_RAM_model-2__nfft_whole_power_1_afe_0.009_RAM_RAM_additiv_cv_adapt_factor_scaled_cNoise_0.1_cSig_0.9_cutoff1_300_cutoff2_300no_sinz_length1_TrialsStim_11_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV',
|
||||
#'calc_RAM_model-2__nfft_whole_power_1_afe_0.009_RAM_RAM_additiv_cv_adapt_factor_scaled_cNoise_0.1_cSig_0.9_cutoff1_300_cutoff2_300no_sinz_length1_TrialsStim_500000_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV',
|
||||
|
||||
nrs_s = [3, 4, 8, 9]#, 10, 11
|
||||
#embed()
|
||||
tr_name = trial_nr/1000000
|
||||
if tr_name == 1:
|
||||
tr_name = 1
|
||||
ax_model = []
|
||||
|
||||
for s, sav_name in enumerate(save_names):
|
||||
|
||||
save_name = load_folder_name('calc_model') + '/' + sav_name
|
||||
|
||||
cell_add, cells_save = find_cell_add(cells_given)
|
||||
perc = 'perc'
|
||||
|
||||
path = save_name + '.pkl' # '../'+
|
||||
# stack = get_stack_one_quadrant(cell, cell_add, cells_save, path, save_name)
|
||||
|
||||
# full_matrix = create_full_matrix2(np.array(stack), np.array(stack_rev))
|
||||
# stack_final = get_axis_on_full_matrix(full_matrix, stack)
|
||||
# im = plt_RAM_perc(ax, perc, np.abs(stack))
|
||||
#
|
||||
stack = load_model_susept(path, cells_save, save_name.split(r'/')[-1] + cell_add)
|
||||
if len(stack)> 0:
|
||||
model_show, stack_plot = get_stack(cell, stack)
|
||||
stacks.append(stack_plot)
|
||||
perc95.append(np.percentile(stack_plot,95))
|
||||
perc05.append(np.percentile(stack_plot, 5))
|
||||
median.append(np.percentile(stack_plot, 50))
|
||||
else:
|
||||
stacks.append([])
|
||||
perc95.append(float('nan'))
|
||||
perc05.append(float('nan'))
|
||||
median.append(float('nan'))
|
||||
|
||||
plt.plot(trial_nrs_here, perc05)
|
||||
plt.plot(trial_nrs_here, perc95)
|
||||
plt.plot(trial_nrs_here, median)
|
||||
#embed()
|
||||
#fig.tag([axes[0:3]], xoffs=-3, yoffs=1.6) # ax_ams[3],
|
||||
#fig.tag([[axes[4]]], xoffs=-3, yoffs=1.6, minor_index=0) # ax_ams[3],
|
||||
#fig.tag([axes[3:6]], xoffs=-3, yoffs=1.6) #, major_index = 1, minor_index = 2 ax_ams[3],
|
||||
#fig.tag([[axes[7]]], xoffs=-3, yoffs=1.6, major_index=2,minor_index=0) # ax_ams[3],
|
||||
#fig.tag([axes[8::]], xoffs=-3, yoffs=1.6, major_index=2, minor_index=2) # ax_ams[3],
|
||||
#fig.tag([axes[7::]], xoffs=-3, yoffs=1.6) # ax_ams[3],
|
||||
|
||||
#fig.tag([ax_ams[0],ax_data[0],axes[2], axes[3]], xoffs=-3, yoffs=1.6)#ax_ams[3],
|
||||
|
||||
save_visualization(pdf=True)
|
||||
|
||||
|
||||
def start_pos_modeldata():
|
||||
return 1.03
|
||||
|
||||
|
||||
def signal_component_name():
|
||||
return r'$\xi_{signal}$'#signal noise'
|
||||
|
||||
|
||||
def noise_component_name():#$\xi_{noise}$noise_name =
|
||||
return r'$\xi_{noise}$'#'Noise component'#'intrinsic noise'
|
||||
|
||||
|
||||
def ypos_x_modelanddata():
|
||||
return -0.45
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
|
||||
model = resave_small_files("models_big_fit_d_right.csv", load_folder='calc_model_core')
|
||||
cells = model.cell.unique()
|
||||
# embed()
|
||||
params = {'cells': cells}
|
||||
|
||||
show = True
|
||||
# if show == False:
|
||||
|
||||
# low CV: cells = ['2012-07-03-ak-invivo-1']
|
||||
plot_style()
|
||||
default_settings(lw=0.5, column=2, length=3.35) #8.5
|
||||
redo = False
|
||||
D_extraction_method = ['additiv_cv_adapt_factor_scaled']
|
||||
# D_extraction_method = ['additiv_visual_d_4_scaled']
|
||||
|
||||
##########################
|
||||
# hier printen wir die table Werte zum kopieren in den Text
|
||||
path = 'print_table_suscept-model_params_suscept_table.csv'
|
||||
if os.path.exists(path):
|
||||
table = pd.read_csv(path)
|
||||
table_printen(table)
|
||||
|
||||
path = 'print_table_all-model_params_suscept_table.csv'
|
||||
if os.path.exists(path):
|
||||
table = pd.read_csv()
|
||||
print('model big')
|
||||
table_printen(table)
|
||||
#embed()
|
||||
|
||||
##########################
|
||||
#embed()
|
||||
trialnr(eod_metrice = False, width=0.005, show=show, D_extraction_method=D_extraction_method,
|
||||
label=r'$\frac{1}{mV^2S}$') #r'$\frac{1}{mV^2S}$'
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0,32.0,33.0,34.0,35.0,36.0,37.0,38.0,39.0,40.0,41.0,42.0,43.0,44.0,45.0,46.0,47.0,48.0,49.0,50.0,51.0,52.0,53.0,54.0,55.0,56.0,57.0,58.0,59.0,60.0,61.0,62.0,63.0,64.0,65.0,66.0,67.0,68.0,69.0,70.0,71.0,72.0,73.0,74.0,75.0,76.0,77.0,78.0,79.0,80.0,81.0,82.0,83.0,84.0,85.0,86.0,87.0,88.0,89.0,90.0,91.0,92.0,93.0,94.0,95.0,96.0,97.0,98.0,99.0,100.0,101.0,102.0,103.0,104.0,105.0,106.0,107.0,108.0,109.0,110.0,111.0,112.0,113.0,114.0,115.0,116.0,117.0,118.0,119.0,120.0,121.0,122.0,123.0,124.0,125.0,126.0,127.0,128.0,129.0,130.0,131.0,132.0,133.0,134.0,135.0,136.0,137.0,138.0,139.0,140.0,141.0,142.0,143.0,144.0,145.0,146.0,147.0,148.0,149.0,150.0,151.0,152.0,153.0,154.0,155.0,156.0,157.0,158.0,159.0,160.0,161.0,162.0,163.0,164.0,165.0,166.0,167.0,168.0,169.0,170.0,171.0,172.0,173.0,174.0,175.0,176.0,177.0,178.0,179.0,180.0,181.0,182.0,183.0,184.0,185.0,186.0,187.0,188.0,189.0,190.0,191.0,192.0,193.0,194.0,195.0,196.0,197.0,198.0,199.0,200.0,201.0,202.0,203.0,204.0,205.0,206.0,207.0,208.0,209.0,210.0,211.0,212.0,213.0,214.0,215.0,216.0,217.0,218.0,219.0,220.0,221.0,222.0,223.0,224.0,225.0,226.0,227.0,228.0,229.0,230.0,231.0,232.0,233.0,234.0,235.0,236.0,237.0,238.0,239.0,240.0,241.0,242.0,243.0,244.0,245.0,246.0,247.0,248.0,249.0,250.0,251.0,252.0,253.0,254.0,255.0,256.0,257.0,258.0,259.0,260.0,261.0,262.0,263.0,264.0,265.0,266.0,267.0,268.0,269.0,270.0,271.0,272.0,273.0,274.0,275.0,276.0,277.0,278.0,279.0,280.0,281.0,282.0,283.0,284.0,285.0,286.0,287.0,288.0,289.0,290.0,291.0,292.0,293.0,294.0,295.0,296.0,297.0,298.0,299.0,isf_psd,osf_psd,io_cross,d_isf_all,d_osf_all,var_RAM,trial_nr,cell,file_name,eod_fr,cv,fr,fr_stim,cv_stim,ser_stim,ser_first_stim,ser_sum_stim,fr_stim_mean,cv_stim_mean,ser_stim_mean,ser_first_stim_mean,ser_sum_stim_mean
|
|
@ -0,0 +1 @@
|
||||
,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0,32.0,33.0,34.0,35.0,36.0,37.0,38.0,39.0,40.0,41.0,42.0,43.0,44.0,45.0,46.0,47.0,48.0,49.0,50.0,51.0,52.0,53.0,54.0,55.0,56.0,57.0,58.0,59.0,60.0,61.0,62.0,63.0,64.0,65.0,66.0,67.0,68.0,69.0,70.0,71.0,72.0,73.0,74.0,75.0,76.0,77.0,78.0,79.0,80.0,81.0,82.0,83.0,84.0,85.0,86.0,87.0,88.0,89.0,90.0,91.0,92.0,93.0,94.0,95.0,96.0,97.0,98.0,99.0,100.0,101.0,102.0,103.0,104.0,105.0,106.0,107.0,108.0,109.0,110.0,111.0,112.0,113.0,114.0,115.0,116.0,117.0,118.0,119.0,120.0,121.0,122.0,123.0,124.0,125.0,126.0,127.0,128.0,129.0,130.0,131.0,132.0,133.0,134.0,135.0,136.0,137.0,138.0,139.0,140.0,141.0,142.0,143.0,144.0,145.0,146.0,147.0,148.0,149.0,150.0,151.0,152.0,153.0,154.0,155.0,156.0,157.0,158.0,159.0,160.0,161.0,162.0,163.0,164.0,165.0,166.0,167.0,168.0,169.0,170.0,171.0,172.0,173.0,174.0,175.0,176.0,177.0,178.0,179.0,180.0,181.0,182.0,183.0,184.0,185.0,186.0,187.0,188.0,189.0,190.0,191.0,192.0,193.0,194.0,195.0,196.0,197.0,198.0,199.0,200.0,201.0,202.0,203.0,204.0,205.0,206.0,207.0,208.0,209.0,210.0,211.0,212.0,213.0,214.0,215.0,216.0,217.0,218.0,219.0,220.0,221.0,222.0,223.0,224.0,225.0,226.0,227.0,228.0,229.0,230.0,231.0,232.0,233.0,234.0,235.0,236.0,237.0,238.0,239.0,240.0,241.0,242.0,243.0,244.0,245.0,246.0,247.0,248.0,249.0,250.0,251.0,252.0,253.0,254.0,255.0,256.0,257.0,258.0,259.0,260.0,261.0,262.0,263.0,264.0,265.0,266.0,267.0,268.0,269.0,270.0,271.0,272.0,273.0,274.0,275.0,276.0,277.0,278.0,279.0,280.0,281.0,282.0,283.0,284.0,285.0,286.0,287.0,288.0,289.0,290.0,291.0,292.0,293.0,294.0,295.0,296.0,297.0,298.0,299.0,isf_psd,osf_psd,io_cross,d_isf_all,d_osf_all,var_RAM,trial_nr,cell,file_name,eod_fr,cv,fr,fr_stim,cv_stim,ser_stim,ser_first_stim,ser_sum_stim,fr_stim_mean,cv_stim_mean,ser_stim_mean,ser_first_stim_mean,ser_sum_stim_mean
|
|
@ -0,0 +1 @@
|
||||
,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0,32.0,33.0,34.0,35.0,36.0,37.0,38.0,39.0,40.0,41.0,42.0,43.0,44.0,45.0,46.0,47.0,48.0,49.0,50.0,51.0,52.0,53.0,54.0,55.0,56.0,57.0,58.0,59.0,60.0,61.0,62.0,63.0,64.0,65.0,66.0,67.0,68.0,69.0,70.0,71.0,72.0,73.0,74.0,75.0,76.0,77.0,78.0,79.0,80.0,81.0,82.0,83.0,84.0,85.0,86.0,87.0,88.0,89.0,90.0,91.0,92.0,93.0,94.0,95.0,96.0,97.0,98.0,99.0,100.0,101.0,102.0,103.0,104.0,105.0,106.0,107.0,108.0,109.0,110.0,111.0,112.0,113.0,114.0,115.0,116.0,117.0,118.0,119.0,120.0,121.0,122.0,123.0,124.0,125.0,126.0,127.0,128.0,129.0,130.0,131.0,132.0,133.0,134.0,135.0,136.0,137.0,138.0,139.0,140.0,141.0,142.0,143.0,144.0,145.0,146.0,147.0,148.0,149.0,150.0,151.0,152.0,153.0,154.0,155.0,156.0,157.0,158.0,159.0,160.0,161.0,162.0,163.0,164.0,165.0,166.0,167.0,168.0,169.0,170.0,171.0,172.0,173.0,174.0,175.0,176.0,177.0,178.0,179.0,180.0,181.0,182.0,183.0,184.0,185.0,186.0,187.0,188.0,189.0,190.0,191.0,192.0,193.0,194.0,195.0,196.0,197.0,198.0,199.0,200.0,201.0,202.0,203.0,204.0,205.0,206.0,207.0,208.0,209.0,210.0,211.0,212.0,213.0,214.0,215.0,216.0,217.0,218.0,219.0,220.0,221.0,222.0,223.0,224.0,225.0,226.0,227.0,228.0,229.0,230.0,231.0,232.0,233.0,234.0,235.0,236.0,237.0,238.0,239.0,240.0,241.0,242.0,243.0,244.0,245.0,246.0,247.0,248.0,249.0,250.0,251.0,252.0,253.0,254.0,255.0,256.0,257.0,258.0,259.0,260.0,261.0,262.0,263.0,264.0,265.0,266.0,267.0,268.0,269.0,270.0,271.0,272.0,273.0,274.0,275.0,276.0,277.0,278.0,279.0,280.0,281.0,282.0,283.0,284.0,285.0,286.0,287.0,288.0,289.0,290.0,291.0,292.0,293.0,294.0,295.0,296.0,297.0,298.0,299.0,isf_psd,osf_psd,io_cross,d_isf_all,d_osf_all,var_RAM,trial_nr,cell,file_name,eod_fr,cv,fr,fr_stim,cv_stim,ser_stim,ser_first_stim,ser_sum_stim,fr_stim_mean,cv_stim_mean,ser_stim_mean,ser_first_stim_mean,ser_sum_stim_mean
|
|
@ -0,0 +1 @@
|
||||
,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0,32.0,33.0,34.0,35.0,36.0,37.0,38.0,39.0,40.0,41.0,42.0,43.0,44.0,45.0,46.0,47.0,48.0,49.0,50.0,51.0,52.0,53.0,54.0,55.0,56.0,57.0,58.0,59.0,60.0,61.0,62.0,63.0,64.0,65.0,66.0,67.0,68.0,69.0,70.0,71.0,72.0,73.0,74.0,75.0,76.0,77.0,78.0,79.0,80.0,81.0,82.0,83.0,84.0,85.0,86.0,87.0,88.0,89.0,90.0,91.0,92.0,93.0,94.0,95.0,96.0,97.0,98.0,99.0,100.0,101.0,102.0,103.0,104.0,105.0,106.0,107.0,108.0,109.0,110.0,111.0,112.0,113.0,114.0,115.0,116.0,117.0,118.0,119.0,120.0,121.0,122.0,123.0,124.0,125.0,126.0,127.0,128.0,129.0,130.0,131.0,132.0,133.0,134.0,135.0,136.0,137.0,138.0,139.0,140.0,141.0,142.0,143.0,144.0,145.0,146.0,147.0,148.0,149.0,150.0,151.0,152.0,153.0,154.0,155.0,156.0,157.0,158.0,159.0,160.0,161.0,162.0,163.0,164.0,165.0,166.0,167.0,168.0,169.0,170.0,171.0,172.0,173.0,174.0,175.0,176.0,177.0,178.0,179.0,180.0,181.0,182.0,183.0,184.0,185.0,186.0,187.0,188.0,189.0,190.0,191.0,192.0,193.0,194.0,195.0,196.0,197.0,198.0,199.0,200.0,201.0,202.0,203.0,204.0,205.0,206.0,207.0,208.0,209.0,210.0,211.0,212.0,213.0,214.0,215.0,216.0,217.0,218.0,219.0,220.0,221.0,222.0,223.0,224.0,225.0,226.0,227.0,228.0,229.0,230.0,231.0,232.0,233.0,234.0,235.0,236.0,237.0,238.0,239.0,240.0,241.0,242.0,243.0,244.0,245.0,246.0,247.0,248.0,249.0,250.0,251.0,252.0,253.0,254.0,255.0,256.0,257.0,258.0,259.0,260.0,261.0,262.0,263.0,264.0,265.0,266.0,267.0,268.0,269.0,270.0,271.0,272.0,273.0,274.0,275.0,276.0,277.0,278.0,279.0,280.0,281.0,282.0,283.0,284.0,285.0,286.0,287.0,288.0,289.0,290.0,291.0,292.0,293.0,294.0,295.0,296.0,297.0,298.0,299.0,isf_psd,osf_psd,io_cross,d_isf_all,d_osf_all,var_RAM,trial_nr,cell,file_name,eod_fr,cv,fr,fr_stim,cv_stim,ser_stim,ser_first_stim,ser_sum_stim,fr_stim_mean,cv_stim_mean,ser_stim_mean,ser_first_stim_mean,ser_sum_stim_mean
|
|
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0,32.0,33.0,34.0,35.0,36.0,37.0,38.0,39.0,40.0,41.0,42.0,43.0,44.0,45.0,46.0,47.0,48.0,49.0,50.0,51.0,52.0,53.0,54.0,55.0,56.0,57.0,58.0,59.0,60.0,61.0,62.0,63.0,64.0,65.0,66.0,67.0,68.0,69.0,70.0,71.0,72.0,73.0,74.0,75.0,76.0,77.0,78.0,79.0,80.0,81.0,82.0,83.0,84.0,85.0,86.0,87.0,88.0,89.0,90.0,91.0,92.0,93.0,94.0,95.0,96.0,97.0,98.0,99.0,100.0,101.0,102.0,103.0,104.0,105.0,106.0,107.0,108.0,109.0,110.0,111.0,112.0,113.0,114.0,115.0,116.0,117.0,118.0,119.0,120.0,121.0,122.0,123.0,124.0,125.0,126.0,127.0,128.0,129.0,130.0,131.0,132.0,133.0,134.0,135.0,136.0,137.0,138.0,139.0,140.0,141.0,142.0,143.0,144.0,145.0,146.0,147.0,148.0,149.0,150.0,151.0,152.0,153.0,154.0,155.0,156.0,157.0,158.0,159.0,160.0,161.0,162.0,163.0,164.0,165.0,166.0,167.0,168.0,169.0,170.0,171.0,172.0,173.0,174.0,175.0,176.0,177.0,178.0,179.0,180.0,181.0,182.0,183.0,184.0,185.0,186.0,187.0,188.0,189.0,190.0,191.0,192.0,193.0,194.0,195.0,196.0,197.0,198.0,199.0,200.0,201.0,202.0,203.0,204.0,205.0,206.0,207.0,208.0,209.0,210.0,211.0,212.0,213.0,214.0,215.0,216.0,217.0,218.0,219.0,220.0,221.0,222.0,223.0,224.0,225.0,226.0,227.0,228.0,229.0,230.0,231.0,232.0,233.0,234.0,235.0,236.0,237.0,238.0,239.0,240.0,241.0,242.0,243.0,244.0,245.0,246.0,247.0,248.0,249.0,250.0,251.0,252.0,253.0,254.0,255.0,256.0,257.0,258.0,259.0,260.0,261.0,262.0,263.0,264.0,265.0,266.0,267.0,268.0,269.0,270.0,271.0,272.0,273.0,274.0,275.0,276.0,277.0,278.0,279.0,280.0,281.0,282.0,283.0,284.0,285.0,286.0,287.0,288.0,289.0,290.0,291.0,292.0,293.0,294.0,295.0,296.0,297.0,298.0,299.0,isf_psd,osf_psd,io_cross,d_isf_all,d_osf_all,var_RAM,trial_nr,cell,file_name,eod_fr,cv,fr,fr_stim,cv_stim,ser_stim,ser_first_stim,ser_sum_stim,fr_stim_mean,cv_stim_mean,ser_stim_mean,ser_first_stim_mean,ser_sum_stim_mean
|
|
@ -0,0 +1 @@
|
||||
,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0,32.0,33.0,34.0,35.0,36.0,37.0,38.0,39.0,40.0,41.0,42.0,43.0,44.0,45.0,46.0,47.0,48.0,49.0,50.0,51.0,52.0,53.0,54.0,55.0,56.0,57.0,58.0,59.0,60.0,61.0,62.0,63.0,64.0,65.0,66.0,67.0,68.0,69.0,70.0,71.0,72.0,73.0,74.0,75.0,76.0,77.0,78.0,79.0,80.0,81.0,82.0,83.0,84.0,85.0,86.0,87.0,88.0,89.0,90.0,91.0,92.0,93.0,94.0,95.0,96.0,97.0,98.0,99.0,100.0,101.0,102.0,103.0,104.0,105.0,106.0,107.0,108.0,109.0,110.0,111.0,112.0,113.0,114.0,115.0,116.0,117.0,118.0,119.0,120.0,121.0,122.0,123.0,124.0,125.0,126.0,127.0,128.0,129.0,130.0,131.0,132.0,133.0,134.0,135.0,136.0,137.0,138.0,139.0,140.0,141.0,142.0,143.0,144.0,145.0,146.0,147.0,148.0,149.0,150.0,151.0,152.0,153.0,154.0,155.0,156.0,157.0,158.0,159.0,160.0,161.0,162.0,163.0,164.0,165.0,166.0,167.0,168.0,169.0,170.0,171.0,172.0,173.0,174.0,175.0,176.0,177.0,178.0,179.0,180.0,181.0,182.0,183.0,184.0,185.0,186.0,187.0,188.0,189.0,190.0,191.0,192.0,193.0,194.0,195.0,196.0,197.0,198.0,199.0,200.0,201.0,202.0,203.0,204.0,205.0,206.0,207.0,208.0,209.0,210.0,211.0,212.0,213.0,214.0,215.0,216.0,217.0,218.0,219.0,220.0,221.0,222.0,223.0,224.0,225.0,226.0,227.0,228.0,229.0,230.0,231.0,232.0,233.0,234.0,235.0,236.0,237.0,238.0,239.0,240.0,241.0,242.0,243.0,244.0,245.0,246.0,247.0,248.0,249.0,250.0,251.0,252.0,253.0,254.0,255.0,256.0,257.0,258.0,259.0,260.0,261.0,262.0,263.0,264.0,265.0,266.0,267.0,268.0,269.0,270.0,271.0,272.0,273.0,274.0,275.0,276.0,277.0,278.0,279.0,280.0,281.0,282.0,283.0,284.0,285.0,286.0,287.0,288.0,289.0,290.0,291.0,292.0,293.0,294.0,295.0,296.0,297.0,298.0,299.0,isf_psd,osf_psd,io_cross,d_isf_all,d_osf_all,var_RAM,trial_nr,cell,file_name,eod_fr,cv,fr,fr_stim,cv_stim,ser_stim,ser_first_stim,ser_sum_stim,fr_stim_mean,cv_stim_mean,ser_stim_mean,ser_first_stim_mean,ser_sum_stim_mean
|
|
@ -0,0 +1 @@
|
||||
,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0,32.0,33.0,34.0,35.0,36.0,37.0,38.0,39.0,40.0,41.0,42.0,43.0,44.0,45.0,46.0,47.0,48.0,49.0,50.0,51.0,52.0,53.0,54.0,55.0,56.0,57.0,58.0,59.0,60.0,61.0,62.0,63.0,64.0,65.0,66.0,67.0,68.0,69.0,70.0,71.0,72.0,73.0,74.0,75.0,76.0,77.0,78.0,79.0,80.0,81.0,82.0,83.0,84.0,85.0,86.0,87.0,88.0,89.0,90.0,91.0,92.0,93.0,94.0,95.0,96.0,97.0,98.0,99.0,100.0,101.0,102.0,103.0,104.0,105.0,106.0,107.0,108.0,109.0,110.0,111.0,112.0,113.0,114.0,115.0,116.0,117.0,118.0,119.0,120.0,121.0,122.0,123.0,124.0,125.0,126.0,127.0,128.0,129.0,130.0,131.0,132.0,133.0,134.0,135.0,136.0,137.0,138.0,139.0,140.0,141.0,142.0,143.0,144.0,145.0,146.0,147.0,148.0,149.0,150.0,151.0,152.0,153.0,154.0,155.0,156.0,157.0,158.0,159.0,160.0,161.0,162.0,163.0,164.0,165.0,166.0,167.0,168.0,169.0,170.0,171.0,172.0,173.0,174.0,175.0,176.0,177.0,178.0,179.0,180.0,181.0,182.0,183.0,184.0,185.0,186.0,187.0,188.0,189.0,190.0,191.0,192.0,193.0,194.0,195.0,196.0,197.0,198.0,199.0,200.0,201.0,202.0,203.0,204.0,205.0,206.0,207.0,208.0,209.0,210.0,211.0,212.0,213.0,214.0,215.0,216.0,217.0,218.0,219.0,220.0,221.0,222.0,223.0,224.0,225.0,226.0,227.0,228.0,229.0,230.0,231.0,232.0,233.0,234.0,235.0,236.0,237.0,238.0,239.0,240.0,241.0,242.0,243.0,244.0,245.0,246.0,247.0,248.0,249.0,250.0,251.0,252.0,253.0,254.0,255.0,256.0,257.0,258.0,259.0,260.0,261.0,262.0,263.0,264.0,265.0,266.0,267.0,268.0,269.0,270.0,271.0,272.0,273.0,274.0,275.0,276.0,277.0,278.0,279.0,280.0,281.0,282.0,283.0,284.0,285.0,286.0,287.0,288.0,289.0,290.0,291.0,292.0,293.0,294.0,295.0,296.0,297.0,298.0,299.0,isf_psd,osf_psd,io_cross,d_isf_all,d_osf_all,var_RAM,trial_nr,cell,file_name,eod_fr,cv,fr,fr_stim,cv_stim,ser_stim,ser_first_stim,ser_sum_stim,fr_stim_mean,cv_stim_mean,ser_stim_mean,ser_first_stim_mean,ser_sum_stim_mean
|
|
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
||||
,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0,32.0,33.0,34.0,35.0,36.0,37.0,38.0,39.0,40.0,41.0,42.0,43.0,44.0,45.0,46.0,47.0,48.0,49.0,50.0,51.0,52.0,53.0,54.0,55.0,56.0,57.0,58.0,59.0,60.0,61.0,62.0,63.0,64.0,65.0,66.0,67.0,68.0,69.0,70.0,71.0,72.0,73.0,74.0,75.0,76.0,77.0,78.0,79.0,80.0,81.0,82.0,83.0,84.0,85.0,86.0,87.0,88.0,89.0,90.0,91.0,92.0,93.0,94.0,95.0,96.0,97.0,98.0,99.0,100.0,101.0,102.0,103.0,104.0,105.0,106.0,107.0,108.0,109.0,110.0,111.0,112.0,113.0,114.0,115.0,116.0,117.0,118.0,119.0,120.0,121.0,122.0,123.0,124.0,125.0,126.0,127.0,128.0,129.0,130.0,131.0,132.0,133.0,134.0,135.0,136.0,137.0,138.0,139.0,140.0,141.0,142.0,143.0,144.0,145.0,146.0,147.0,148.0,149.0,150.0,151.0,152.0,153.0,154.0,155.0,156.0,157.0,158.0,159.0,160.0,161.0,162.0,163.0,164.0,165.0,166.0,167.0,168.0,169.0,170.0,171.0,172.0,173.0,174.0,175.0,176.0,177.0,178.0,179.0,180.0,181.0,182.0,183.0,184.0,185.0,186.0,187.0,188.0,189.0,190.0,191.0,192.0,193.0,194.0,195.0,196.0,197.0,198.0,199.0,200.0,201.0,202.0,203.0,204.0,205.0,206.0,207.0,208.0,209.0,210.0,211.0,212.0,213.0,214.0,215.0,216.0,217.0,218.0,219.0,220.0,221.0,222.0,223.0,224.0,225.0,226.0,227.0,228.0,229.0,230.0,231.0,232.0,233.0,234.0,235.0,236.0,237.0,238.0,239.0,240.0,241.0,242.0,243.0,244.0,245.0,246.0,247.0,248.0,249.0,250.0,251.0,252.0,253.0,254.0,255.0,256.0,257.0,258.0,259.0,260.0,261.0,262.0,263.0,264.0,265.0,266.0,267.0,268.0,269.0,270.0,271.0,272.0,273.0,274.0,275.0,276.0,277.0,278.0,279.0,280.0,281.0,282.0,283.0,284.0,285.0,286.0,287.0,288.0,289.0,290.0,291.0,292.0,293.0,294.0,295.0,296.0,297.0,298.0,299.0,isf_psd,osf_psd,io_cross,d_isf_all,d_osf_all,var_RAM,trial_nr,cell,file_name,eod_fr,cv,fr,fr_stim,cv_stim,ser_stim,ser_first_stim,ser_sum_stim,fr_stim_mean,cv_stim_mean,ser_stim_mean,ser_first_stim_mean,ser_sum_stim_mean
|
|
@ -0,0 +1 @@
|
||||
,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0,32.0,33.0,34.0,35.0,36.0,37.0,38.0,39.0,40.0,41.0,42.0,43.0,44.0,45.0,46.0,47.0,48.0,49.0,50.0,51.0,52.0,53.0,54.0,55.0,56.0,57.0,58.0,59.0,60.0,61.0,62.0,63.0,64.0,65.0,66.0,67.0,68.0,69.0,70.0,71.0,72.0,73.0,74.0,75.0,76.0,77.0,78.0,79.0,80.0,81.0,82.0,83.0,84.0,85.0,86.0,87.0,88.0,89.0,90.0,91.0,92.0,93.0,94.0,95.0,96.0,97.0,98.0,99.0,100.0,101.0,102.0,103.0,104.0,105.0,106.0,107.0,108.0,109.0,110.0,111.0,112.0,113.0,114.0,115.0,116.0,117.0,118.0,119.0,120.0,121.0,122.0,123.0,124.0,125.0,126.0,127.0,128.0,129.0,130.0,131.0,132.0,133.0,134.0,135.0,136.0,137.0,138.0,139.0,140.0,141.0,142.0,143.0,144.0,145.0,146.0,147.0,148.0,149.0,150.0,151.0,152.0,153.0,154.0,155.0,156.0,157.0,158.0,159.0,160.0,161.0,162.0,163.0,164.0,165.0,166.0,167.0,168.0,169.0,170.0,171.0,172.0,173.0,174.0,175.0,176.0,177.0,178.0,179.0,180.0,181.0,182.0,183.0,184.0,185.0,186.0,187.0,188.0,189.0,190.0,191.0,192.0,193.0,194.0,195.0,196.0,197.0,198.0,199.0,200.0,201.0,202.0,203.0,204.0,205.0,206.0,207.0,208.0,209.0,210.0,211.0,212.0,213.0,214.0,215.0,216.0,217.0,218.0,219.0,220.0,221.0,222.0,223.0,224.0,225.0,226.0,227.0,228.0,229.0,230.0,231.0,232.0,233.0,234.0,235.0,236.0,237.0,238.0,239.0,240.0,241.0,242.0,243.0,244.0,245.0,246.0,247.0,248.0,249.0,250.0,251.0,252.0,253.0,254.0,255.0,256.0,257.0,258.0,259.0,260.0,261.0,262.0,263.0,264.0,265.0,266.0,267.0,268.0,269.0,270.0,271.0,272.0,273.0,274.0,275.0,276.0,277.0,278.0,279.0,280.0,281.0,282.0,283.0,284.0,285.0,286.0,287.0,288.0,289.0,290.0,291.0,292.0,293.0,294.0,295.0,296.0,297.0,298.0,299.0,isf_psd,osf_psd,io_cross,d_isf_all,d_osf_all,var_RAM,trial_nr,cell,file_name,eod_fr,cv,fr,fr_stim,cv_stim,ser_stim,ser_first_stim,ser_sum_stim,fr_stim_mean,cv_stim_mean,ser_stim_mean,ser_first_stim_mean,ser_sum_stim_mean
|
|
@ -0,0 +1 @@
|
||||
,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0,32.0,33.0,34.0,35.0,36.0,37.0,38.0,39.0,40.0,41.0,42.0,43.0,44.0,45.0,46.0,47.0,48.0,49.0,50.0,51.0,52.0,53.0,54.0,55.0,56.0,57.0,58.0,59.0,60.0,61.0,62.0,63.0,64.0,65.0,66.0,67.0,68.0,69.0,70.0,71.0,72.0,73.0,74.0,75.0,76.0,77.0,78.0,79.0,80.0,81.0,82.0,83.0,84.0,85.0,86.0,87.0,88.0,89.0,90.0,91.0,92.0,93.0,94.0,95.0,96.0,97.0,98.0,99.0,100.0,101.0,102.0,103.0,104.0,105.0,106.0,107.0,108.0,109.0,110.0,111.0,112.0,113.0,114.0,115.0,116.0,117.0,118.0,119.0,120.0,121.0,122.0,123.0,124.0,125.0,126.0,127.0,128.0,129.0,130.0,131.0,132.0,133.0,134.0,135.0,136.0,137.0,138.0,139.0,140.0,141.0,142.0,143.0,144.0,145.0,146.0,147.0,148.0,149.0,150.0,151.0,152.0,153.0,154.0,155.0,156.0,157.0,158.0,159.0,160.0,161.0,162.0,163.0,164.0,165.0,166.0,167.0,168.0,169.0,170.0,171.0,172.0,173.0,174.0,175.0,176.0,177.0,178.0,179.0,180.0,181.0,182.0,183.0,184.0,185.0,186.0,187.0,188.0,189.0,190.0,191.0,192.0,193.0,194.0,195.0,196.0,197.0,198.0,199.0,200.0,201.0,202.0,203.0,204.0,205.0,206.0,207.0,208.0,209.0,210.0,211.0,212.0,213.0,214.0,215.0,216.0,217.0,218.0,219.0,220.0,221.0,222.0,223.0,224.0,225.0,226.0,227.0,228.0,229.0,230.0,231.0,232.0,233.0,234.0,235.0,236.0,237.0,238.0,239.0,240.0,241.0,242.0,243.0,244.0,245.0,246.0,247.0,248.0,249.0,250.0,251.0,252.0,253.0,254.0,255.0,256.0,257.0,258.0,259.0,260.0,261.0,262.0,263.0,264.0,265.0,266.0,267.0,268.0,269.0,270.0,271.0,272.0,273.0,274.0,275.0,276.0,277.0,278.0,279.0,280.0,281.0,282.0,283.0,284.0,285.0,286.0,287.0,288.0,289.0,290.0,291.0,292.0,293.0,294.0,295.0,296.0,297.0,298.0,299.0,isf_psd,osf_psd,io_cross,d_isf_all,d_osf_all,var_RAM,trial_nr,cell,file_name,eod_fr,cv,fr,fr_stim,cv_stim,ser_stim,ser_first_stim,ser_sum_stim,fr_stim_mean,cv_stim_mean,ser_stim_mean,ser_first_stim_mean,ser_sum_stim_mean,var_stim
|
|
@ -4442,13 +4442,14 @@ def load_model_susept(path, cells, save_name, save=True, redo=False):
|
||||
|
||||
redo = False
|
||||
print(name1)
|
||||
#embed()
|
||||
if (versions_comp == 'develop'):
|
||||
#embed()
|
||||
if (os.path.exists(name1)):
|
||||
cont = check_creation_time(load_function, name1)
|
||||
else:
|
||||
cont = True
|
||||
|
||||
#embed()
|
||||
if (redo == True) | cont: # (not os.path.exists(name1))
|
||||
print('redo model')
|
||||
model = resave_model_susept(cells, load_function, name1, path, remove_old, save, versions_comp)
|
||||
@ -4502,8 +4503,10 @@ def load_model_susept(path, cells, save_name, save=True, redo=False):
|
||||
def resave_model_susept(cells, load_function, name1, path, remove_old, save, versions_comp):
|
||||
if not os.path.exists(path):
|
||||
dated_up = update_ssh_file(path)
|
||||
|
||||
if os.path.exists(path):
|
||||
embed()
|
||||
if os.path.exists(
|
||||
|
||||
):
|
||||
################################
|
||||
# wenn es den localen Computer von Sascha findet soll es die Versionen nochmal updaten
|
||||
# if (redo == True) : # | (not os.path.exists(name1))& (not os.path.exists(name0))
|
||||
|
@ -2,6 +2,7 @@ import ast
|
||||
import csv
|
||||
import warnings
|
||||
|
||||
import numpy
|
||||
from scipy.optimize import curve_fit
|
||||
from scipy.signal import vectorstrength
|
||||
from scipy.stats import alpha, gaussian_kde
|
||||
@ -2837,13 +2838,7 @@ def plt_squares_special(params, col_desired=2, var_items=['contrasts'], show=Fal
|
||||
|
||||
|
||||
def plt_single_square_modl(ax, cell, model, perc, titles, width,eod_metrice = True, nr = 3, titles_plot=False, resize=False):
|
||||
try:
|
||||
model_show = model[(model.cell == cell)]
|
||||
except:
|
||||
print('cell something')
|
||||
embed()
|
||||
stack_plot = change_model_from_csv_to_plots(model_show)
|
||||
stack_plot = RAM_norm(stack_plot, model_show=model_show)
|
||||
model_show, stack_plot = get_stack(cell, model)
|
||||
if resize:
|
||||
stack_plot, add_nonlin_title, resize_val = rescale_colorbar_and_values(stack_plot)
|
||||
else:
|
||||
@ -2889,6 +2884,17 @@ def plt_single_square_modl(ax, cell, model, perc, titles, width,eod_metrice = Tr
|
||||
return add_nonlin_title,cbar, fig, stack_plot, im
|
||||
|
||||
|
||||
def get_stack(cell, model):
|
||||
try:
|
||||
model_show = model[(model.cell == cell)]
|
||||
except:
|
||||
print('cell something')
|
||||
embed()
|
||||
stack_plot = change_model_from_csv_to_plots(model_show)
|
||||
stack_plot = RAM_norm(stack_plot, model_show=model_show)
|
||||
return model_show, stack_plot
|
||||
|
||||
|
||||
#[1, 0, 0][1, 0, 0.4]
|
||||
|
||||
|
||||
@ -8824,7 +8830,7 @@ def motivation_small_roc(ylim=[-1.25, 1.25], c1=10, dfs=['m1', 'm2'], mult_type=
|
||||
data_dir, cell, c, b, chirps, devs, extract, group_mean, mean_type,
|
||||
plot_group=0,
|
||||
rocextra=False, sorted_on=sorted_on)
|
||||
# embed()
|
||||
#embed()
|
||||
fr_isi, ax_ps, ax_as = plot_arrays_ROC_psd_single3(
|
||||
[arrays[0], arrays[2], arrays[1], arrays[3]],
|
||||
[arrays_original[0], arrays_original[2], arrays_original[1],
|
||||
@ -10031,6 +10037,7 @@ def plot_arrays_ROC_psd_single3(arrays, arrays_original, spikes_pure, fr, cell,
|
||||
color_psd = 'black'
|
||||
# embed()
|
||||
ax_as = []
|
||||
#embed()
|
||||
for j in range(len(arrays)):
|
||||
###################################
|
||||
# plt spikes
|
||||
@ -10054,7 +10061,7 @@ def plot_arrays_ROC_psd_single3(arrays, arrays_original, spikes_pure, fr, cell,
|
||||
# hier kann man aussuchen welches power spektrum machen haben will
|
||||
f, nfft = get_psds_ROC(array_chosen, arrays, arrays_original, j, mean_type, names, p_means_all)
|
||||
ax_as.append(ax_a)
|
||||
|
||||
#embed()
|
||||
|
||||
#########################################
|
||||
# plot the psds
|
||||
@ -10189,7 +10196,7 @@ def plt_psds_ROC(add_burst_corr, arrays, ax00, ax_ps, cell, color_psd, colors_p,
|
||||
embed()
|
||||
pp, pp_mean = decide_log_ROCs(j, log, names, p_means_all, ref)
|
||||
|
||||
# embed()
|
||||
#embed()
|
||||
# add_log = 10.5#2.5
|
||||
try: # todo: if log müsste hier was anderes rein, das log veränderte nämlich!#2.5
|
||||
plt_peaks_several(np.array(labels)[choice[j]], np.array(freqs)[choice[j]], pp, j,
|
||||
@ -10205,6 +10212,7 @@ def plt_psds_ROC(add_burst_corr, arrays, ax00, ax_ps, cell, color_psd, colors_p,
|
||||
ax00.show_spines('b')
|
||||
if j == 0:
|
||||
ax00.yscalebar(-0.02, 0.5, 10, 'dB', va='center', ha='left')
|
||||
#embed()
|
||||
return ax00, fr_isi
|
||||
|
||||
|
||||
@ -10221,7 +10229,7 @@ def f2_core(DF1):
|
||||
|
||||
|
||||
def f1_core(DF2):
|
||||
return '$2 |\Delta f_{1}|=%s$' %(DF2 * 2) + '\,Hz'
|
||||
return '$2 |\Delta f_{1}|=%s$' %(np.abs(DF2) * 2) + '\,Hz'
|
||||
|
||||
|
||||
def fdiff_core(DF1, DF2):
|
||||
@ -10229,7 +10237,7 @@ def fdiff_core(DF1, DF2):
|
||||
|
||||
|
||||
def fsum_core(DF1, DF2):
|
||||
return '$||\Delta f_{1}| +|\Delta f_{2}||=%s$' %(np.abs(DF1) + np.abs(DF2)) + '\,Hz'#)
|
||||
return '$||\Delta f_{1}| + |\Delta f_{2}||=%s$' %(np.abs(DF1) + np.abs(DF2)) + '\,Hz'#)
|
||||
|
||||
|
||||
def decide_log_ROCs(j, log, names, p_means_all, ref):
|
||||
@ -10349,7 +10357,7 @@ def plt_traces_ROC(array_chosen, arrays, ax00, colors, datapoints, group_mean, j
|
||||
|
||||
|
||||
def save_arrays_susept(data_dir, cell, c, b, chirps, devs, extract, group_mean, mean_type, plot_group, rocextra,
|
||||
sorted_on='LocalReconst0.2Norm', dev_desired = '1'):
|
||||
sorted_on='LocalReconst0.2Norm', base_several = False, dev_desired = '1',mean_type0 = ''):#'_MeanTrialsIndex'
|
||||
# sorted_on = 'LocalReconst' # 'EodLocSynch'
|
||||
|
||||
version_comp, subfolder, mod_name_slash, mod_name, subfolder_path = find_code_vs_not()
|
||||
@ -10374,7 +10382,7 @@ def save_arrays_susept(data_dir, cell, c, b, chirps, devs, extract, group_mean,
|
||||
|
||||
|
||||
#embed()
|
||||
mean_type0 = '_MeanTrialsIndex'
|
||||
|
||||
spikes_pure, fish_number_base, chirp, fish_cuts, time_array, fish_number, smoothened2, smoothed05, eod_mt, eod_interp, effective_duration, cut, devname, frame = cut_spikes_and_eod_three(
|
||||
group_mean, b, extract, chirps=chirps, emb=False,
|
||||
mean_type=mean_type, sorted_on=sorted_on,
|
||||
@ -10384,6 +10392,7 @@ def save_arrays_susept(data_dir, cell, c, b, chirps, devs, extract, group_mean,
|
||||
# group_mean,
|
||||
# mean_type)
|
||||
|
||||
|
||||
if printing: # todo: also das dauert lange das könnte man optimizieren
|
||||
print('arrays1 ' + str(time.time() - t3))
|
||||
# embed()
|
||||
@ -10409,6 +10418,7 @@ def save_arrays_susept(data_dir, cell, c, b, chirps, devs, extract, group_mean,
|
||||
|
||||
# embed()
|
||||
if ('Phase' not in mean_type0) & (mean_type0 != ''):
|
||||
#embed()
|
||||
for i in range(len(delays_length['base_0'])):
|
||||
delays_length['base_0'][i] = np.arange(0, delays_length['base_0'][i][-1], 1)
|
||||
try:
|
||||
@ -10671,7 +10681,7 @@ def plt_single_pds(nfft, f, p_means, p_mean_all_here, ylim_psd, xlim_psd, color_
|
||||
# remove_xticks(ax00)
|
||||
if j != 0:
|
||||
remove_yticks(ax00)
|
||||
|
||||
#embed()
|
||||
return ref, ax00
|
||||
|
||||
|
||||
@ -15368,7 +15378,7 @@ def fft_matrix(deltat, osf, f_range, isf, norm='', quadrant=''): # stimulus,
|
||||
return np.array(f_mat1), np.array(f_mat2), np.array(f_idx_sum), np.array(cross)
|
||||
|
||||
|
||||
def exclude_nans_for_corr(file_here, var_item, x=[], y=[], cv_name='cv_base', score='perc99/med'):
|
||||
def exclude_nans_for_corr(file_here, var_item, x=[], y=[], max_x = None, cv_name='cv_base', score='perc99/med'):
|
||||
# embed()
|
||||
if len(x) == 0:
|
||||
x = file_here[cv_name]
|
||||
@ -15384,6 +15394,19 @@ def exclude_nans_for_corr(file_here, var_item, x=[], y=[], cv_name='cv_base', sc
|
||||
x = x[~exclude_here]
|
||||
y = y[~exclude_here]
|
||||
c_axis = c_axis[~exclude_here]
|
||||
|
||||
if max_x:
|
||||
#embed()
|
||||
if np.sum(x > max_x) > 0:
|
||||
y = y[x < max_x]
|
||||
try:
|
||||
c_axis = c_axis.loc[x < max_x]
|
||||
except:
|
||||
print('c something')
|
||||
embed()
|
||||
x = x[x < max_x]
|
||||
|
||||
|
||||
return c_axis, x, y, exclude_here
|
||||
|
||||
|
||||
@ -15674,10 +15697,11 @@ def get_axis(cv_name, frame_file, score):
|
||||
return x_axis, y_axis
|
||||
|
||||
|
||||
def plt_burst_modulation_hists(axk, axl, var_item_name, ax, cell_type_here, cv_name, frame_file, max_val,
|
||||
score, ymin='no', xmin='no', ymax = 'no', top=False,
|
||||
def plt_burst_modulation_hists(axk, axl, var_item_name, ax, cell_type_here, cv_name, frame_file, score, ymin='no',
|
||||
xmin='no', ymax='no', top=False,
|
||||
burst_fraction_reset='burst_fraction_burst_corr_individual_base',
|
||||
var_item='response_modulation', n = True, xlim = None, x_pos = 0, burst_fraction=1, ha = 'left'):
|
||||
var_item='response_modulation', max_x=None, n=True, xlim=None, x_pos=0, burst_fraction=1,
|
||||
ha='left'):
|
||||
cmap = []
|
||||
x_axis = []
|
||||
y_axis = []
|
||||
@ -15727,7 +15751,7 @@ def plt_burst_modulation_hists(axk, axl, var_item_name, ax, cell_type_here, cv_n
|
||||
y_axis = frame_file[score] # np.array(frame_file[score])[frame_file[score] > 0]
|
||||
# c_axis = np.array(frame_file['response_modulation'])[frame_file[score] > 0]
|
||||
c_axis, x_axis, y_axis, exclude_here = exclude_nans_for_corr(frame_file, var_item, cv_name=cv_name,
|
||||
score=score)
|
||||
score=score, max_x = max_x)
|
||||
# corr, p_value = stats.pearsonr(x, y)
|
||||
# y =
|
||||
# c=c_axis[x_axis < max_val], cmap=cm,
|
||||
@ -39979,3 +40003,6 @@ def end_fi_s():
|
||||
return 90
|
||||
|
||||
|
||||
def trial_nrs_ram_model():
|
||||
trial_nrs_here = np.array([9, 11, 20, 30, 100, 500, 1000, 10000, 100000, 250000, 500000, 750000, 1000000])
|
||||
return trial_nrs_here
|
Loading…
Reference in New Issue
Block a user