updated full_model figure
BIN
ampullary.pdf
BIN
ampullary.png
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
@ -52,5 +52,5 @@ if __name__ == '__main__':
|
||||
cells_plot2 = [cell]
|
||||
ampullary_punit(cells_plot2=cells_plot2, RAM=False)
|
||||
else:
|
||||
cells_plot2 = p_units_to_show(type_here='amp')
|
||||
ampullary_punit(eod_metrice = False, color_same = False, fr_name = '$f_{base}$', tags_individual = True, isi_delta = 5, titles=['Low-CV ampullary cell,'],cells_plot2=cells_plot2, RAM=False, scale_val = False, add_texts = [0.25,1.3])
|
||||
cells_plot2 = p_units_to_show(type_here='amp')#permuted = True,
|
||||
ampullary_punit(eod_metrice = False, base_extra = True,color_same = False, fr_name = '$f_{base}$', tags_individual = True, isi_delta = 5, titles=[''],cells_plot2=cells_plot2, RAM=False, scale_val = False, add_texts = [0.25,1.3])#Low-CV ampullary cell,
|
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 142 KiB |
@ -7,6 +7,6 @@ from IPython import embed
|
||||
if __name__ == '__main__':
|
||||
|
||||
|
||||
|
||||
cells_plot2 = p_units_to_show(type_here = 'contrasts')
|
||||
ampullary_punit(eod_metrice = False, color_same = False, fr_name = '$f_{base}$', cells_plot2=[cells_plot2[0]], isi_delta = 5, titles=['Low-CV P-unit,'],tags_individual = True, xlim_p = [0,1.15])
|
||||
#stack_file = pd.read_csv('..\calc_RAM\calc_nix_RAM-eod_2022-01-28-ag-invivo-1_all__amp_20.0_filename_InputArr_400hz_30_P-unitApteronotusleptorhynchus.csv')
|
||||
cells_plot2 = p_units_to_show(type_here = 'contrasts')#permuted = True,
|
||||
ampullary_punit(eod_metrice = False, color_same = False,base_extra = True, fr_name = '$f_{base}$', cells_plot2=[cells_plot2[0]], isi_delta = 5, titles=[''],tags_individual = True, xlim_p = [0,1.15])#Low-CV P-unit,
|
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 142 KiB |
@ -6,5 +6,5 @@ from IPython import embed
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
cells_plot2 = p_units_to_show(type_here='contrasts')
|
||||
ampullary_punit(eod_metrice = False, color_same = False, fr_name = '$f_{base}$', tags_individual = True, isi_delta = 5, cells_plot2=[cells_plot2[1]], titles=['High-CV P-unit,', 'Ampullary cell,'],)
|
||||
cells_plot2 = p_units_to_show(type_here='contrasts')#permuted = True,
|
||||
ampullary_punit(base_extra = True,eod_metrice = False, color_same = False, fr_name = '$f_{base}$', tags_individual = True, isi_delta = 5, cells_plot2=[cells_plot2[1]], titles=['', 'Ampullary cell,'],)#High-CV P-unit,
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 69 KiB |
@ -45,7 +45,7 @@ def data_overview3():
|
||||
right = 0.85
|
||||
ws = 0.75
|
||||
print(right)
|
||||
grid0 = gridspec.GridSpec(3, 2, wspace=ws, bottom=0.13,
|
||||
grid0 = gridspec.GridSpec(3, 2, wspace=ws, bottom=0.07,
|
||||
hspace=0.45, left=0.1, right=right, top=0.95)
|
||||
|
||||
###################################
|
||||
@ -86,10 +86,25 @@ def data_overview3():
|
||||
scores = ['max(diag5Hz)/med_diagonal_proj_fr','max(diag5Hz)/med_diagonal_proj_fr',
|
||||
] # + '_diagonal_proj'
|
||||
|
||||
max_xs = [[5,5,[]],[[],[],[]]]
|
||||
max_xs = [[[],[],[]],[[],[],[]]]
|
||||
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)
|
||||
#embed()
|
||||
test = False
|
||||
# ok das schließe ich aus weil da irgendwas in der Detektion ist, das betrifft jetzt genau 3 Zellen, also nicht so schlimm
|
||||
#63 2018-08-14-af-invivo-1
|
||||
#241 2018-09-05-aj-invivo-1
|
||||
#252 2022-01-08-ah-invivo-1
|
||||
frame_file = frame_file[frame_file.cv_stim <5]
|
||||
if test:
|
||||
frame_file[frame_file.cv_base > 3].cell
|
||||
frame_file[frame_file.cv_stim > 3].cv_stim
|
||||
|
||||
#
|
||||
frame_file.groupby('cell').count()
|
||||
frame_file.groupby('cell').groups.keys()
|
||||
frame_file.group_by('cell')
|
||||
len(frame_file.cell.unique())
|
||||
|
||||
##############################################
|
||||
# modulatoin comparison for both cell_types
|
||||
@ -128,58 +143,70 @@ def data_overview3():
|
||||
#frame_max = frame_file[frame_file[score]>5]
|
||||
cv_name = "cv_base"
|
||||
max_val = 1.5
|
||||
log = False
|
||||
log = ''#'logall'#''#'logy','logall'True#False
|
||||
|
||||
|
||||
marker = ['o']
|
||||
for v, var_type in enumerate(var_types):
|
||||
# ax = plt.subplot(grid0[1+v])#grid_lower[0, v]
|
||||
|
||||
axk, axl, axs, axls, axss, ax_j = get_grid_4(ax_j, axls, axss, grid0[v,counter])
|
||||
axx, axy, axs, axls, axss, ax_j = get_grid_4(ax_j, axls, axss, grid0[v,counter])
|
||||
|
||||
|
||||
if log:
|
||||
if log == 'logy':
|
||||
ymin = 'no'
|
||||
else:
|
||||
ymin = 0
|
||||
xmin = 0
|
||||
|
||||
if (' P-unit' in cell_type_here) & (x_axis[v] == 'cv_base' ):
|
||||
xlimk = [0, 1.7]
|
||||
if (' P-unit' in cell_type_here) & ('cv' in x_axis[v]):
|
||||
xlimk = [0, 2]
|
||||
else:
|
||||
xlimk = None
|
||||
xlimk = None
|
||||
|
||||
cmap, _, y_axis = plt_burst_modulation_hists(axk, axl, var_item_names[v], axs, cell_type_here, x_axis[v],
|
||||
labelpad = 0.5#-1
|
||||
cmap, _, y_axis = plt_burst_modulation_hists(axx, axy, 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,
|
||||
max_x=max_x[v], xlim=xlimk, x_pos=1, labelpad = labelpad,
|
||||
burst_fraction=burst_fraction[c], ha='right')
|
||||
|
||||
if v == 0:
|
||||
colors = colors_overview()
|
||||
axk.set_title(cell_types_name[c], color = colors[cell_type_here])
|
||||
axx.set_title(cell_types_name[c], color = colors[cell_type_here])
|
||||
|
||||
axk.show_spines('')
|
||||
axl.show_spines('')
|
||||
axx.show_spines('')
|
||||
axy.show_spines('')
|
||||
axs.set_ylabel(score_name[v])
|
||||
axs.set_xlabel(x_axis_names[v])
|
||||
axs.set_xlabel(x_axis_names[v], labelpad = labelpad)
|
||||
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)
|
||||
axx.set_xlim(xlimk)
|
||||
#embed()
|
||||
#remove_yticks(axl)
|
||||
|
||||
if log:
|
||||
axl.set_yscale('log')
|
||||
if log == 'logy':
|
||||
axy.set_yscale('log')
|
||||
axs.set_yscale('log')
|
||||
make_log_ticks([axs])
|
||||
axl.minorticks_off()
|
||||
axl.set_yticks_blank()
|
||||
axy.minorticks_off()
|
||||
elif log == 'logall':
|
||||
axy.set_yscale('log')
|
||||
axs.set_yscale('log')
|
||||
make_log_ticks([axs])
|
||||
axy.minorticks_off()
|
||||
|
||||
axx.set_xscale('log')
|
||||
axs.set_xscale('log')
|
||||
make_log_ticks([axs])
|
||||
axx.minorticks_off()
|
||||
axy.set_yticks_blank()
|
||||
|
||||
plt_specific_cells(axs, cell_type_here, x_axis[v], frame_file, scores_here[v], marker = ['o',"s"])
|
||||
tags.append(axk)
|
||||
tags.append(axx)
|
||||
counter += 1
|
||||
#plt.show()
|
||||
############################
|
||||
@ -189,6 +216,7 @@ def data_overview3():
|
||||
#for species in speciess:
|
||||
for c, cell_type_here in enumerate(cell_types):
|
||||
frame_file = setting_overview_score(frame_load_sp, cell_type_here, min_amp='min', species=species)
|
||||
print(cell_type_here + str(len(frame_file.cell.unique())))
|
||||
#embed()
|
||||
cells_amp = ['2011-09-21-ab', '2010-06-21-am', '2012-05-15-ac', '2012-04-26-ae', '2012-05-07-ac',
|
||||
'2010-06-21-ac']
|
||||
@ -395,7 +423,7 @@ def data_overview3():
|
||||
show = False#True
|
||||
fig = plt.gcf()
|
||||
#embed()
|
||||
tags_final = np.concatenate([tags[0::2],tags[1::2]])#,tags[2::3]
|
||||
tags_final = np.concatenate([tags[0::3],tags[1::3],tags[2::3]])#,tags[2::3]
|
||||
fig.tag(tags_final, xoffs=-4.2, yoffs=1.12)
|
||||
save_visualization(pdf = True, show = show)
|
||||
|
||||
|
BIN
model_full.pdf
BIN
model_full.png
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 82 KiB |
430
model_full.py
@ -5,7 +5,7 @@ def model_full(c1=10, mult_type='_multsorted2_', devs=['05'], save=True, end='al
|
||||
|
||||
plot_style()
|
||||
default_figsize(column=2, length=2.3)
|
||||
grid = gridspec.GridSpec(1, 3, wspace=0.6, bottom = 0.1, width_ratios = [2,1,1], hspace=0.15, top=0.95, left=0.075, right=0.87)
|
||||
grid = gridspec.GridSpec(1, 4, wspace=0.15, bottom = 0.2, width_ratios = [2,1, 1.5,1.5], hspace=0.15, top=0.92, left=0.075, right=0.98)
|
||||
|
||||
axes = []
|
||||
##################################
|
||||
@ -16,15 +16,17 @@ def model_full(c1=10, mult_type='_multsorted2_', devs=['05'], save=True, end='al
|
||||
|
||||
axes.append(ax)
|
||||
|
||||
perc,im,stack_final = plt_model_big(ax, ls = ls, lw = 0.5)
|
||||
cell = '2012-07-03-ak-invivo-1'
|
||||
|
||||
perc,im,stack_final = plt_model_big(ax, ls = ls, lw = 0.75, cell = cell)
|
||||
fr_waves = 139
|
||||
fr_noise = 120
|
||||
f1 = 33
|
||||
f2 = 139
|
||||
|
||||
color01, color012, color01_2, color02, color0_burst, color0 = colors_suscept_paper_dots()
|
||||
#embed()
|
||||
ax.plot(fr_noise * f1/fr_waves, fr_noise*f2/fr_waves, 'o', ms = 5, markeredgecolor = 'orange', markerfacecolor="None")
|
||||
ax.plot(-fr_noise * f1 / fr_waves, fr_noise * f2 / fr_waves, 'o', ms = 5, markeredgecolor='pink', markerfacecolor="None")
|
||||
#ax.plot(fr_noise * f1/fr_waves, fr_noise*f2/fr_waves, 'o', ms = 5, markeredgecolor = color012, markerfacecolor="None")
|
||||
#ax.plot(-fr_noise * f1 / fr_waves, fr_noise * f2 / fr_waves, 'o', ms = 5, markeredgecolor=color01_2, markerfacecolor="None")
|
||||
|
||||
# if len(cbar) > 0:
|
||||
###############################
|
||||
@ -48,8 +50,6 @@ def model_full(c1=10, mult_type='_multsorted2_', devs=['05'], save=True, end='al
|
||||
stack_final = get_axis_on_full_matrix(full_matrix, mat)
|
||||
|
||||
abs_matrix = np.abs(stack_final)
|
||||
#embed()
|
||||
#if np.
|
||||
abs_matrix, add_nonlin_title, resize_val = rescale_colorbar_and_values(abs_matrix)
|
||||
|
||||
|
||||
@ -74,8 +74,295 @@ def model_full(c1=10, mult_type='_multsorted2_', devs=['05'], save=True, end='al
|
||||
|
||||
#################
|
||||
# power spectra data
|
||||
log = ''#'log'
|
||||
ylim_log = (-15, 3)
|
||||
nfft = 2 ** 13
|
||||
xlim_psd = [0, 300]
|
||||
DF1_desired, DF2_desired, fr, eod_fr, arrays_len = plt_data_full_model(c1, chose_score, detections, devs, dfs, end, grid[3], mult_type, sorted_on, alpha = [1,0.5], log = log,ylim_log = ylim_log, nfft = nfft, xlim_psd = xlim_psd)
|
||||
|
||||
|
||||
#################
|
||||
#################
|
||||
# power spectra model
|
||||
|
||||
|
||||
grid0 = gridspec.GridSpecFromSubplotSpec(len(DF1_desired), 1, wspace=0.15, hspace=0.35,
|
||||
subplot_spec=grid[2])
|
||||
|
||||
fr_mult = fr / eod_fr
|
||||
DF1_frmult = np.abs((np.array(DF1_desired)-1)/fr_mult)
|
||||
DF2_frmult = np.abs((np.array(DF2_desired) - 1) / fr_mult)
|
||||
#embed()
|
||||
DF1_frmult[0] = 1
|
||||
#DF2_frmult[0] = 0.1
|
||||
#DF1_frmult[1] = 0.4
|
||||
#DF2_frmult[1] = 0.6
|
||||
ylim_log = (-35, 3)
|
||||
|
||||
|
||||
#########################
|
||||
# punkte die zur zweiten Reihe gehören
|
||||
|
||||
alphas = [1,0.5]
|
||||
for g in range(len(DF1_desired)):
|
||||
axp = plt.subplot(grid0[g])
|
||||
fr = plt_model_full_model(axp, cells=[cell],trials_nr = arrays_len[g], add_pp=250, single_waves=['_SeveralSumWave_', ], cell_start=11,
|
||||
zeros='ones', several_peaks_nr = 3, alpha = alphas[g], log = log, nfft = nfft, freqs_mult1 = DF1_frmult[g], freqs_mult2 = DF2_frmult[g], xlim = [0, 170], a_f1s=[0.1], a_frs=[1], add_half=0, show=True)#01
|
||||
|
||||
axes.append(axp)
|
||||
if g == 0:
|
||||
remove_xticks(axp)
|
||||
axp.set_xlabel('')
|
||||
axp.set_xlim(xlim_psd)
|
||||
if log == 'log':
|
||||
axp.set_ylim(ylim_log)
|
||||
|
||||
join_y(axes[1::])
|
||||
#.share
|
||||
|
||||
#ax.plot(fr_noise * f1 / fr_waves, fr_noise * f2 / fr_waves, 'o', ms=5, markeredgecolor=color012,
|
||||
# markerfacecolor="None", alpha = 0.5)
|
||||
#ax.plot(-fr_noise * f1 / fr_waves, fr_noise * f2 / fr_waves, 'o', ms=5, markeredgecolor=color01_2,
|
||||
# markerfacecolor="None", alpha = 0.5)
|
||||
|
||||
DF2_hz = np.abs(np.array(DF1_desired) * eod_fr-eod_fr)
|
||||
DF1_hz = np.abs(np.array(DF2_desired) * eod_fr - eod_fr)
|
||||
|
||||
#embed()
|
||||
for f in range(len(DF1_hz)):
|
||||
ax.plot(fr_noise * DF1_hz[f] / fr_waves, fr_noise * DF2_hz[f] / fr_waves, 'o', ms=5, markeredgecolor=color012,
|
||||
markerfacecolor="None")#, alpha = alphas[f]
|
||||
ax.plot(-fr_noise * DF1_hz[f] / fr_waves, fr_noise * DF2_hz[f] / fr_waves, 's', ms=5, markeredgecolor=color01_2,
|
||||
markerfacecolor="None")#, alpha = alphas[f]
|
||||
|
||||
|
||||
#embed()
|
||||
#tag2(fig=fig, xoffs=[-4.5, -4.5, -4.5, -5.5], yoffs=1.25)
|
||||
#axes = plt.gca()
|
||||
#fig.tag(axes[::-1], xoffs=-4.5, yoffs=0.4) # ax_ams[3],
|
||||
|
||||
save_visualization()
|
||||
|
||||
|
||||
def plt_model_full_model(axp, min=0.2, cells=[], alpha = 1, trials_nr = 15, add_pp=50,
|
||||
single_waves=['_SingleWave_', '_SeveralWave_', ], cell_start=13,
|
||||
zeros='zeros', several_peaks_nr = 2, a_f1s=[0, 0.005, 0.01, 0.05, 0.1, 0.2, ], a_frs=[1],
|
||||
add_half=0, log = 'log', xlim = [0, 350], freqs_mult1 = None, freqs_mult2 = None, show=False, nfft=int(2 ** 15), beat='', gain=1, us_name=''):
|
||||
model_cells = pd.read_csv(load_folder_name('calc_model_core') + "/models_big_fit_d_right.csv")
|
||||
if len(cells) < 1:
|
||||
cells = model_cells.cell.loc[range(cell_start, len(model_cells))]
|
||||
# embed()
|
||||
plot_style()
|
||||
fr = float('nan')
|
||||
for cell in cells:
|
||||
|
||||
# eod_fr, eod_fj, eod_fe = frequency_choice(model_params, step1, step2, three_waves, a_fj, step_type=step_type,
|
||||
# symmetry=symmetry, start_mult_jammer=start_mult_jammer,
|
||||
# start_mult_emitter=start_mult_emitter, start_f1=start_f1, end_f1=end_f1,
|
||||
# start_f2=start_f2, end_f2=end_f2)
|
||||
|
||||
# sachen die ich variieren will
|
||||
###########################################
|
||||
|
||||
####### VARY HERE
|
||||
for single_wave in single_waves:
|
||||
if single_wave == '_SingleWave_':
|
||||
a_f2s = [0] # , 0,0.2
|
||||
else:
|
||||
a_f2s = [0.1]
|
||||
for a_f2 in a_f2s:
|
||||
# 150
|
||||
|
||||
titles_amp = ['base eodf', 'baseline to Zero', ]
|
||||
for a, a_fr in enumerate(a_frs):
|
||||
# fig, ax = plt.subplots(4 + 1, len(a_f1s), figsize=(5, 5.5)) # sharex=True,
|
||||
# ax = ax.reshape(len(ax),1)
|
||||
# fig = plt.figure(figsize=(12, 5.5))
|
||||
#default_figsize(column=2, length=2.3) # 3
|
||||
# default_setting(column = 2, length = 5.5)
|
||||
#grid = gridspec.GridSpec(3, 2, wspace=0.35, left=0.095, hspace=0.2, top=0.94, bottom=0.25,
|
||||
# right=0.95)
|
||||
ax = {}
|
||||
for aa, a_f1 in enumerate(a_f1s):
|
||||
|
||||
SAM, cell, damping, damping_type, deltat, eod_fish_r, eod_fr, f1, f2, freqs1, freqs2, model_params, offset, phase_right, phaseshift_fr, rate_adapted, rate_baseline_after, rate_baseline_before, sampling, spike_adapted, spikes, stimuli, stimulus_altered, stimulus_length, time_array, v_dent_output, v_mem_output = outputmodel(
|
||||
a_fr, add_half, cell, model_cells, single_wave, trials_nr, freqs_mult1 = freqs_mult1, freqs_mult2 = freqs_mult2)
|
||||
|
||||
|
||||
# ax[3].xscalebar(0.1, -0.02, 20, 'ms', va='right', ha='bottom') ##ylim[0]
|
||||
# ax[3].set_xlabel('Time [ms]')
|
||||
#axp = plt.subplot(grid[:, 1])
|
||||
axp.show_spines('lb')
|
||||
|
||||
# ax[4, 0].set_xlim(0.1 * 1000, 0.125 * 1000)
|
||||
|
||||
# ax[4, 1].get_shared_x_axes().join(*ax[4, :])
|
||||
base_cut, mat_base = find_base_fr(spike_adapted, deltat, stimulus_length, time_array)
|
||||
fr = np.mean(base_cut)
|
||||
frate, isis_diff = ISI_frequency(time_array, spike_adapted[0], fill=0.0)
|
||||
isi = np.diff(spike_adapted[0])
|
||||
cv0 = np.std(isi) / np.mean(isi)
|
||||
cv1 = np.std(frate) / np.mean(frate)
|
||||
# embed()
|
||||
|
||||
fs = 11
|
||||
# for fff, freq2 in enumerate(freqs2):
|
||||
# freq2 = [freq2]
|
||||
# embed()
|
||||
for ff, freq1 in enumerate(freqs1):
|
||||
freq1 = [freq1]
|
||||
freq2 = [freqs2[ff]]
|
||||
# time_var = time.time()
|
||||
beat1 = freq1 - eod_fr
|
||||
titles = False
|
||||
if titles:
|
||||
plt.suptitle('diverging from half fr by ' + str(add_half) + ' f1:' + str(
|
||||
np.round(freq1)[0]) + ' f2:' + str(np.round(freq2)[0]) + ' Hz \n' + str(
|
||||
beat1) + ' Hz Beat\n' + titles[ff] + titles_amp[a] + ' ' + cell + ' cv ' + str(
|
||||
np.round(cv0, 3)) + '_a_f0_' + str(a_fr) + '_a_f1_' + str(a_f1) + '_a_f2_' + str(
|
||||
a_f2) + ' tr_nr ' + str(trials_nr))
|
||||
|
||||
# if printing:
|
||||
# print(cell )
|
||||
# f_corr = create_beat_corr(np.array([freq1[f1]]), np.array([eod_fr]))
|
||||
# create the second eod_fish1 array analogous to the eod_fish_r array
|
||||
# embed()
|
||||
phaseshift_f1, phaseshift_f2 = get_phaseshifts(a_f1, a_f2, phase_right, phaseshift_fr)
|
||||
eod_fish1, time_fish_e = eod_fish_e_generation(time_array, a_f1, freq1, f1)
|
||||
eod_fish2, time_fish_j = eod_fish_e_generation(time_array, a_f2, freq2, f2)
|
||||
|
||||
eod_stimulus = eod_fish1 + eod_fish2
|
||||
|
||||
for t in range(trials_nr):
|
||||
stimulus, eod_fish_sam = create_stimulus_SAM(SAM, eod_stimulus, eod_fish_r, freq1, f1,
|
||||
eod_fr,
|
||||
time_array, a_f1)
|
||||
|
||||
# embed()
|
||||
stimulus_orig = stimulus * 1
|
||||
|
||||
# damping variants
|
||||
std_dump, max_dump, range_dump, stimulus, damping_output = all_damping_variants(
|
||||
stimulus, time_array, damping_type, eod_fr, gain, damping, us_name, plot=False,
|
||||
std_dump=0, max_dump=0, range_dump=0)
|
||||
|
||||
stimuli.append(stimulus)
|
||||
# embed()
|
||||
cvs, adapt_output, baseline_after, _, rate_adapted[t], rate_baseline_before[t], \
|
||||
rate_baseline_after[t], spikes[t], \
|
||||
stimulus_altered[t], \
|
||||
v_dent_output[t], offset_new, v_mem_output[t], noise_final = simulate(cell, offset,
|
||||
stimulus, f1,
|
||||
**model_params)
|
||||
|
||||
#embed()
|
||||
stimulus_altered_output = np.mean(stimulus_altered, axis=0)
|
||||
# time_var2 = time.time()
|
||||
|
||||
# embed()
|
||||
test_stimulus_stability = False
|
||||
# embed()
|
||||
# time_model = time_var2 - time_var # 8
|
||||
|
||||
# embed()ax[0, ff]
|
||||
|
||||
spikes_mat = [[]] * len(spikes)
|
||||
pps = [[]] * len(spikes)
|
||||
for s in range(len(spikes)):
|
||||
spikes_mat[s] = cr_spikes_mat(spikes[s], 1 / deltat, int(stimulus_length * 1 / deltat))
|
||||
pps[s], f = ml.psd(spikes_mat[s] - np.mean(spikes_mat[s]), Fs=1 / deltat, NFFT=nfft,
|
||||
noverlap=nfft // 2)
|
||||
pp_mean = np.mean(pps, axis=0)
|
||||
sampling_rate = 1 / deltat
|
||||
smoothed05 = gaussian_filter(spikes_mat, sigma=gaussian_intro() * sampling_rate)
|
||||
mat05 = np.mean(smoothed05, axis=0)
|
||||
beat1 = np.round(freq1 - eod_fr)[0]
|
||||
# if titles:
|
||||
# ax[0].set_title('a_f1 ' + str(a_f1), fontsize=fs)
|
||||
|
||||
# ax[0, aa].set_title('f1:'+str(np.round(freq1)[0]) +' f2:'+str(np.round(freq2)[0]) + ' Hz \n'+str(beat1) + ' Hz Beat\n' +titles[ff], fontsize = fs)
|
||||
# ax[0].plot((time_array - min) * 1000, stimulus, color='grey', linewidth=0.5)
|
||||
|
||||
beat1 = (freq1 - eod_fr)[0]
|
||||
beat2 = (freq2 - eod_fr)[0]
|
||||
#embed()
|
||||
nr = 2
|
||||
color_01, color_012, color01_2, color_02, color0_burst, color0 = colors_suscept_paper_dots()
|
||||
if 'Several' in single_wave:
|
||||
freqs_beat = [fr, np.abs(beat1), np.abs(beat2), np.abs(np.abs(beat2) + np.abs(beat1)),np.abs(np.abs(beat2) - np.abs(beat1))
|
||||
] # np.abs(beat2 - beat1),np.abs(beat2 + beat1),
|
||||
|
||||
#colors_w, colors_wo, color_base, color_01, color_02, color_012 = colors_cocktailparty_all()
|
||||
colors = [color0,color_01, color_02, color_012, color01_2] # 'blue'
|
||||
labels = ['','', '', '', ''] # small , '|B1-B2|'
|
||||
#labels = ['$f_{1}=%d$' % beat1 + '\,Hz', '$f_{2}=%d$' % beat2 + '\,Hz',
|
||||
# '$f_{1} + f_{2}=f_{Base}=%d$' % (
|
||||
# beat1 + beat2 - 1) + '\,Hz'] # small , '|B1-B2|'
|
||||
add_texts = [nr, nr + 0.35, nr + 0.2, nr + 0.2, nr + 0.2] # [1.1,1.1,1.1]
|
||||
texts_left = [-7, -7, -7, -7,-7]
|
||||
# ax[1].set_title(
|
||||
# '$f_{1}=%d$' % beat1 + '\,Hz' + ', ' + '$f_{2}=%d$' % beat2 + '\,Hz' + ', ' + '$ f_{Base}=%d$' % (
|
||||
# beat1 + beat2 - 1) + '\,Hz')
|
||||
|
||||
else:
|
||||
freqs_beat = [np.abs(beat1), np.abs(beat1) * 2, np.abs(beat1 * 3),
|
||||
np.abs(beat1 * 4)] # np.abs(beat1) / 2,
|
||||
colors = ['black', 'orange', 'blue', 'purple', 'black'] # 'grey',
|
||||
#colors = colors_didactic()
|
||||
add_texts = [nr + 0.1, nr + 0.1, nr + 0.1, nr + 0.1] # [1.1,1.1,1.1,1.1]
|
||||
texts_left = [3, 0, 0, 0]
|
||||
labels = labels_didactic2() # colors_didactic, labels_didactic
|
||||
# labels = ['S1', 'S2 / B1', 'S3', 'S4 / B2', 'f0']#'',
|
||||
|
||||
if 'Several' in single_wave:
|
||||
color_beat = 'black'
|
||||
else:
|
||||
color_beat = colors[0]
|
||||
if (np.mean(stimulus) != 0) & (np.mean(stimulus) != 1):
|
||||
# try:
|
||||
eod_interp, eod_norm = extract_am(stimulus, time_array, sampling=sampling_rate,
|
||||
eodf=eod_fr,
|
||||
emb=False,
|
||||
extract='', norm=False)
|
||||
for l in range(len(spikes)):
|
||||
# ax[2, aa].scatter(spikes[l]*1000, np.ones(len(spikes[l]))*(l+1), color = 'grey', s = 5)
|
||||
spikes[l] = (spikes[l] - min) * 1000
|
||||
# ax[5, ff].set_xlim(0.1,0.2)
|
||||
|
||||
|
||||
pp, f = ml.psd(mat05 - np.mean(mat05), Fs=1 / deltat, NFFT=nfft,
|
||||
noverlap=nfft // 2)
|
||||
ref = (np.max(pp))
|
||||
|
||||
if log:
|
||||
pp_mean = 10 * np.log10(pp_mean / np.max(pp_mean))
|
||||
# pp_mean = np.log
|
||||
print(freqs_beat)
|
||||
print(labels)
|
||||
plt_peaks_several(labels, freqs_beat, pp_mean, 0,
|
||||
axp, pp_mean, colors, f, add_log=2.5,
|
||||
text_extra=True, ha='center', rel='rel', rot=0, several_peaks=True,
|
||||
exact=False, texts_left=texts_left, add_texts=add_texts,several_peaks_nr=several_peaks_nr,
|
||||
rots=[0, 0, 0, 0,0], ms=14, alphas = [alpha]*len(colors), perc=0.05, log=log, clip_on=True) # True
|
||||
|
||||
axp.plot(f, pp_mean, color='black', zorder=0) # 0.45
|
||||
axp.set_xlim(xlim)
|
||||
|
||||
test = False
|
||||
if test:
|
||||
test_spikes_clusters(eod_fish_r, spikes, mat05, sampling, s_name='ms', resamp_fact=1000)
|
||||
|
||||
if log == 'log':
|
||||
axp.set_ylabel('dB')
|
||||
else:
|
||||
axp.set_ylabel('Amplitude [Hz]')
|
||||
|
||||
axp.set_xlabel('Frequency [Hz]')
|
||||
return fr
|
||||
|
||||
|
||||
|
||||
def plt_data_full_model(c1, chose_score, detections, devs, dfs, end, grid, mult_type, sorted_on, log = 'log', alpha = [], ylim_log = (-15, 3), nfft = 2 ** 13, xlim_psd = [0, 235]):
|
||||
# mean_type = '_MeanTrialsIndexPhaseSort_Min0.25sExcluded_'
|
||||
extract = ''
|
||||
datasets, data_dir = find_all_dir_cells()
|
||||
@ -84,44 +371,39 @@ def model_full(c1=10, mult_type='_multsorted2_', devs=['05'], save=True, end='al
|
||||
append_others = 'apend_others' # '#'apend_others'#'apend_others'#'apend_others'##'apend_others'
|
||||
autodefine = '_DFdesired_'
|
||||
autodefine = 'triangle_diagonal_fr' # ['triangle_fr', 'triangle_diagonal_fr', 'triangle_df2_fr','triangle_df2_eodf''triangle_df1_eodf', ] # ,'triangle_df2_fr''triangle_df1_fr','_triangle_diagonal__fr',]
|
||||
DF2_desired = [-33]
|
||||
DF1_desired = [133]
|
||||
DF2_desired = [-33, 167] # (167, 133) (166, 249)
|
||||
DF1_desired = [133, 133] # (133, 265)167, -33) das ist ein komischer Punkt: (166,83)
|
||||
autodefine = '_dfchosen_closest_'
|
||||
autodefine = '_dfchosen_closest_first_'
|
||||
cells = ['2021-08-03-ac-invivo-1'] ##'2021-08-03-ad-invivo-1',,[10, ][5 ]
|
||||
|
||||
# c1s = [10] # 1, 10,
|
||||
# c2s = [10]
|
||||
minsetting = 'Min0.25sExcluded'
|
||||
c2 = 10
|
||||
|
||||
# detections = ['MeanTrialsIndexPhaseSort'] # ['AllTrialsIndex'] # ,'MeanTrialsIndexPhaseSort''DetectionAnalysis''_MeanTrialsPhaseSort'
|
||||
# detections = ['AllTrialsIndex'] # ['_MeanTrialsIndexPhaseSort_Min0.25sExcluded_extended_eod_loc_synch']
|
||||
|
||||
extend_trials = '' # 'extended'#''#'extended'#''#'extended'#''#'extended'#''#'extended'#''#'extended'# ok kein Plan was das hier ist
|
||||
# phase_sorting = ''#'PhaseSort'
|
||||
eodftype = '_psdEOD_'
|
||||
concat = '' # 'TrialsConcat'
|
||||
|
||||
indices = ['_allindices_']
|
||||
chirps = [
|
||||
''] # '_ChirpsDelete3_',,'_ChirpsDelete3_'','','',''#'_ChirpsDelete3_'#''#'_ChirpsDelete3_'#'#'_ChirpsDelete2_'#''#'_ChirpsDelete_'#''#'_ChirpsDelete_'#''#'_ChirpsDelete_'#''#'_ChirpsCache_'
|
||||
extract = '' # '_globalmax_'
|
||||
devs_savename = ['original', '05'] # ['05']#####################
|
||||
|
||||
# control = pd.read_pickle(
|
||||
# load_folder_name(
|
||||
# 'calc_model') + '/modell_all_cell_no_sinz3_afe0.1__afr1__afj0.1__length1.5_adaptoffsetallall2___stepefish' + step + 'Hz_ratecorrrisidual35__modelbigfit_nfft4096.pkl')
|
||||
|
||||
if len(cells) < 1:
|
||||
data_dir, cells = load_cells_three(end, data_dir=data_dir, datasets=datasets)
|
||||
cells, p_units_cells, pyramidals = restrict_cell_type(cells, 'p-units')
|
||||
|
||||
# default_settings(fs=8)
|
||||
|
||||
start = 'min' #
|
||||
cells = ['2021-08-03-ac-invivo-1']
|
||||
tag_cells = []
|
||||
fr = float('nan')
|
||||
eod_fr = float('nan')
|
||||
arrays_len = []
|
||||
for c, cell in enumerate(cells):
|
||||
counter_pic = 0
|
||||
contrasts = [c2]
|
||||
@ -142,12 +424,19 @@ def model_full(c1=10, mult_type='_multsorted2_', devs=['05'], save=True, end='al
|
||||
# hier muss das halt stimmen mit der auswahl
|
||||
# hier wollen wir eigntlich kein autodefine
|
||||
# sondern wir wollen so ein diagonal ding haben
|
||||
divergnce, fr, pivot_chosen, max_val, max_x, max_y, mult, DF1_desired, DF2_desired, min_y, min_x, min_val, diff_cut = chose_mat_max_value(
|
||||
DF1_desired, DF2_desired, '', mult_type, eodftype, indices, cell, contrast_small,
|
||||
contrast_big, contrast1, dfs, start, devname_orig, contrast, autodefine=autodefine,
|
||||
cut_matrix='cut', chose_score=chose_score) # chose_score = 'auci02_012-auci_base_01'
|
||||
DF1_desired = DF1_desired # [::-1]
|
||||
DF2_desired = DF2_desired # [::-1]
|
||||
df1 = []
|
||||
df2 = []
|
||||
for df in range(len(DF1_desired)):
|
||||
divergnce, fr, pivot_chosen, max_val, max_x, max_y, mult, DF1, DF2, min_y, min_x, min_val, diff_cut = chose_mat_max_value(
|
||||
DF1_desired[df], DF2_desired[df], '', mult_type, eodftype, indices, cell,
|
||||
contrast_small,
|
||||
contrast_big, contrast1, dfs, start, devname_orig, contrast, autodefine=autodefine,
|
||||
cut_matrix='cut', chose_score=chose_score) # chose_score = 'auci02_012-auci_base_01'
|
||||
df1.append(DF1[0])
|
||||
df2.append(DF2[0])
|
||||
|
||||
DF1_desired = df1 # [::-1]
|
||||
DF2_desired = df2 # [::-1]
|
||||
# embed()
|
||||
|
||||
#######################################
|
||||
@ -158,15 +447,21 @@ def model_full(c1=10, mult_type='_multsorted2_', devs=['05'], save=True, end='al
|
||||
b = load_b_public(c, cell, data_dir)
|
||||
|
||||
mt_sorted = predefine_grouping_frame(b, eodftype=eodftype, cell_name=cell)
|
||||
|
||||
counter_waves = 0
|
||||
|
||||
mt_sorted = mt_sorted[(mt_sorted['c2'] == c2) & (mt_sorted['c1'] == c1)]
|
||||
|
||||
test = False
|
||||
if test:
|
||||
mt_sorted[['DF1, DF2', 'm1, m2']]
|
||||
mt_sorted['DF1, DF2']
|
||||
for gg in range(len(DF1_desired)):
|
||||
|
||||
# embed()
|
||||
# try:
|
||||
grid0 = gridspec.GridSpecFromSubplotSpec(len(DF1_desired), 1, wspace=0.15, hspace=0.35,
|
||||
subplot_spec=grid[1])
|
||||
subplot_spec=grid)
|
||||
t3 = time.time()
|
||||
# except:
|
||||
# print('time thing')
|
||||
@ -183,6 +478,9 @@ def model_full(c1=10, mult_type='_multsorted2_', devs=['05'], save=True, end='al
|
||||
DF2_desired[gg], grouped,
|
||||
several=True, emb=False,
|
||||
concat=True)
|
||||
# mt_sorted['m1, m2']
|
||||
|
||||
# embed()
|
||||
# except:
|
||||
# print('grouped thing')
|
||||
# embed()
|
||||
@ -224,17 +522,14 @@ def model_full(c1=10, mult_type='_multsorted2_', devs=['05'], save=True, end='al
|
||||
# grid = gridspec.GridSpec(2, 1, wspace=0.7, left=0.05, top=0.95, bottom=0.15,
|
||||
# right=0.98)
|
||||
|
||||
|
||||
|
||||
##########################################################################
|
||||
# part with the power spectra
|
||||
|
||||
|
||||
xlim = [0, 100]
|
||||
|
||||
# plt.savefig(r'C:\Users\alexi\OneDrive - bwedu\Präsentations\latex\experimental_protocol.pdf')
|
||||
# embed()
|
||||
fr_end = divergence_title_add_on(group_mean, fr[gg], autodefine)
|
||||
# fr_end = divergence_title_add_on(group_mean, fr[gg], autodefine)
|
||||
|
||||
###########################################
|
||||
stimulus_length = 0.3
|
||||
@ -252,7 +547,7 @@ def model_full(c1=10, mult_type='_multsorted2_', devs=['05'], save=True, end='al
|
||||
a_fj = group_mean[0][0] / 100
|
||||
variant_cell = 'no' # 'receiver_emitter_jammer'
|
||||
print('f0' + str(eod_fr))
|
||||
print('f1'+str(eod_fe))
|
||||
print('f1' + str(eod_fe))
|
||||
print('f2' + str(eod_fj))
|
||||
eod_fish_j, time_array, time_fish_r, eod_fish_r, time_fish_e, eod_fish_e, time_fish_sam, eod_fish_sam, stimulus_am, stimulus_sam = extract_waves(
|
||||
variant_cell, '',
|
||||
@ -289,11 +584,11 @@ def model_full(c1=10, mult_type='_multsorted2_', devs=['05'], save=True, end='al
|
||||
color02 = 'red'
|
||||
color012 = 'orange'
|
||||
color01_2 = 'purple'
|
||||
color01, color012, color01_2, color02, color0_burst, color0 = colors_suscept_paper_dots()
|
||||
colors_am = ['black', 'black', 'black', 'black'] # color01, color02, color012]
|
||||
extracted = [False, True, True, True]
|
||||
extracted2 = [False, False, False, False]
|
||||
|
||||
|
||||
printing = True
|
||||
if printing:
|
||||
print(time.time() - t3)
|
||||
@ -306,44 +601,69 @@ def model_full(c1=10, mult_type='_multsorted2_', devs=['05'], save=True, end='al
|
||||
if d == 0: #
|
||||
# embed()
|
||||
# plot the psds
|
||||
ax00 = plt.subplot(grid0[gg])
|
||||
|
||||
p_means_all = {}
|
||||
names = ['0', '02', '01', '012']
|
||||
for j in range(len(arrays)):
|
||||
names = ['0', '02', '01',
|
||||
'012'] ## names = ['012']#'0', '02', '01',
|
||||
for j in range(len(arrays)): # [arrays[-1]]
|
||||
########################################
|
||||
# get the corresponding psds
|
||||
# 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)
|
||||
f, nfft = get_psds_ROC(array_chosen, arrays, arrays_original, j,
|
||||
mean_type,
|
||||
names, p_means_all, nfft = nfft)
|
||||
# f, nfft = get_psds_ROC(array_chosen, [arrays[-1]], [arrays_original[-1]], j, mean_type,
|
||||
# names, p_means_all)
|
||||
# ax_as.append(ax_a)
|
||||
ps = {}
|
||||
p_means = {}
|
||||
ax_ps = []
|
||||
|
||||
color012_minus = 'purple',
|
||||
colors_p = [color0, color02, color01, color012, color02, color01, color012_minus,
|
||||
#color012_minus = 'purple' # ,
|
||||
names = ['0', '02', '01', '012'] #
|
||||
|
||||
colors_p = [color0, color02, color01, color012, color02, color01, color01_2,
|
||||
color0_burst, color0_burst,
|
||||
color0, color0]
|
||||
ax00, fr_isi = plt_psds_ROC(arrays, ax00, ax_ps, cell, colors_p, f, grid0, group_mean, nfft, p_means, p_means_all,ps, 4, spikes_pure,time_array)
|
||||
# arrays, ax00, ax_ps, cell, colors_p, f, grid0, group_mean, nfft, p_means, p_means_all, ps, row,spikes_pure, time_array,
|
||||
|
||||
|
||||
|
||||
ax00 = plt.subplot(grid0[gg])
|
||||
# todo: da nicht alle vier über einander plotten das ist das problem!
|
||||
#embed()
|
||||
choice = [[0, 1,2,3,6], [0, 1,2,3,6], [0, 1,2,3,6], [0, 1,2,3,6]]
|
||||
arrays_len.append(len(spikes_pure['012']))
|
||||
|
||||
#labels = labels_all_motivation(DF1, DF2, fr_isi)
|
||||
|
||||
labels = ['$f_{base}$',
|
||||
'$|\Delta f_{1}|$',
|
||||
'$|\Delta f_{2}|$',
|
||||
'$|\Delta f_{1} + \Delta f_{2}|$',
|
||||
'$2|\Delta f_{1}|$',
|
||||
'$2|\Delta f_{2}|$',
|
||||
'$|\Delta f_{1} - \Delta f_{2}|$',
|
||||
'fr_bc',
|
||||
'fr_given_burst_corr_individual', 'highest_fr_burst_corr_individual',
|
||||
'fr', 'fr_given',
|
||||
'highest_fr'] # '$|$DF1-DF2$|$=' + str(np.abs(np.abs(DF1) - np.abs(DF2))) + 'Hz',
|
||||
if len(alpha)> 0:
|
||||
alphas = [alpha[gg]]*len(labels)
|
||||
else:
|
||||
alphas = []
|
||||
#embed()
|
||||
ax00, fr_isi = plt_psds_ROC(arrays, ax00, ax_ps, cell, colors_p, f, grid0,
|
||||
group_mean, nfft, p_means, p_means_all, ps, 4,
|
||||
spikes_pure, time_array, range_plot=[3], names=names,
|
||||
ax01=ax00, clip_on = False, xlim_psd=xlim_psd, alphas = alphas, choice = choice, labels = labels, ylim_log=ylim_log, log=log, text_extra=False)
|
||||
# [arrays[-1]]arrays, ax00, ax_ps, cell, colors_p, f, [-1]grid0, group_mean, nfft, p_means, p_means_all, ps, row,spikes_pure, time_array,
|
||||
#embed()
|
||||
if gg == 0:
|
||||
ax00.legend(ncol=6, loc=(-1.22, 1.1))
|
||||
if gg != len(DF1_desired) - 1:
|
||||
remove_xticks(ax00)
|
||||
ax00.set_xlabel('')
|
||||
|
||||
axes = []
|
||||
axes.append(ax_w)
|
||||
|
||||
|
||||
#################
|
||||
# power spectra model
|
||||
|
||||
|
||||
#print('finished model_full')
|
||||
fig = plt.gcf()
|
||||
#axes = plt.gca()
|
||||
#fig.tag(axes[::-1], xoffs=-4.5, yoffs=0.4) # ax_ams[3],
|
||||
|
||||
save_visualization()
|
||||
return DF1_desired, DF2_desired, fr, eod_fr, arrays_len
|
||||
|
||||
|
||||
def load_stack_data_susept(cell, save_name, end = ''):
|
||||
|
33070
model_full_05_012.csv
33072
model_full_05_base_0.csv
@ -1,87 +1,80 @@
|
||||
,0,1,2
|
||||
0,5.360000000375287,3.6000000003509633,5.439999999890446
|
||||
1,6.9100000003272655,5.150000000302942,7.064999999766755
|
||||
2,28.034999999628774,6.5749999997747075,26.89000000007671
|
||||
3,29.509999999656422,8.299999999853288,28.31500000045797
|
||||
4,31.210000000366556,12.724999999936234,29.739999999929736
|
||||
5,34.28499999999257,29.175000000013355,34.21499999965907
|
||||
6,36.98499999999694,30.750000000243276,35.765000000520544
|
||||
7,43.310000000285065,35.04999999984601,37.4149999997653
|
||||
8,58.38499999962732,36.59999999979799,58.16500000035465
|
||||
9,61.23500000038984,42.7999999996059,59.6400000003823
|
||||
10,64.23500000009153,59.30000000023891,61.34000000018294
|
||||
11,65.88500000024578,60.89999999983728,65.69000000034156
|
||||
12,88.18499999987762,65.2499999999959,67.26499999966198
|
||||
13,89.70999999955166,66.75000000030148,88.31499999994865
|
||||
14,91.45999999990818,68.64999999959717,89.76499999969836
|
||||
15,94.73499999993874,89.34999999963064,91.39000000048416
|
||||
16,97.10999999996784,90.89999999958262,94.7649999998075
|
||||
17,118.16000000025451,95.32499999966556,97.59000000029208
|
||||
18,119.73499999957494,96.8500000002491,117.14000000027318
|
||||
19,121.30999999980486,98.49999999949385,118.63999999966927
|
||||
20,124.36000000006243,119.37499999965394,120.06500000005053
|
||||
21,126.01000000021668,120.90000000023747,123.1150000003081
|
||||
22,127.68499999973938,124.00000000014143,125.96500000016113
|
||||
23,148.43500000032873,125.65000000029568,147.1899999996649
|
||||
24,150.06000000020504,127.14999999969177,148.66499999969255
|
||||
25,154.46000000001004,134.67499999967868,150.06499999979587
|
||||
26,156.03500000023996,149.6250000003597,154.69000000028336
|
||||
27,157.58500000019194,151.32500000016034,156.2149999999574
|
||||
28,178.48499999972046,155.5750000001167,174.49000000031538
|
||||
29,180.03499999967244,157.07499999951278,178.6650000003474
|
||||
30,184.48500000003332,163.14999999974998,180.1150000000971
|
||||
31,186.0349999999853,179.650000000383,181.7900000005293
|
||||
32,187.58499999993728,181.37499999955207,186.11500000040996
|
||||
33,208.58499999966807,185.57499999986203,187.84000000048854
|
||||
34,210.08499999997366,187.09999999953607,208.9400000004216
|
||||
35,212.38500000007843,189.05000000029713,210.28999999996904
|
||||
36,216.03499999973064,194.75000000000318,211.9400000001233
|
||||
37,217.58499999968262,209.77499999969905,216.1649999998017
|
||||
38,238.68499999961568,211.32499999965103,217.86500000051183
|
||||
39,240.21000000019922,215.77500000001191,238.83999999996468
|
||||
40,241.8849999997219,217.2750000003175,240.34000000027027
|
||||
41,246.05999999975393,223.27499999972088,241.91500000050019
|
||||
42,247.6099999997059,239.87499999964666,245.0399999997726
|
||||
43,268.76000000019485,241.62500000000318,246.54000000007818
|
||||
44,270.2849999998689,245.8499999996816,267.59000000036485
|
||||
45,271.88500000037675,247.37500000026512,269.0650000003925
|
||||
46,276.2100000002574,249.07500000006576,270.5150000001422
|
||||
47,277.6850000002851,269.89999999966994,274.98999999987154
|
||||
48,298.90999999978885,271.39999999997553,276.56500000010146
|
||||
49,300.35999999953856,275.79999999978054,297.61500000038814
|
||||
50,301.9600000000464,277.3499999997325,299.11499999978423
|
||||
51,305.010000000304,279.10000000008904,300.5400000001655
|
||||
52,306.56000000025597,300.0249999998955,303.86499999984244
|
||||
53,308.1349999995764,301.54999999956954,306.6150000004027
|
||||
54,329.00999999973646,306.02500000020837,308.3150000002033
|
||||
55,330.51000000004206,307.52499999960446,329.16500000008546
|
||||
56,335.1100000002516,309.24999999968304,330.61499999983516
|
||||
57,336.58500000027925,330.09999999956517,332.2399999997115
|
||||
58,338.1849999998776,331.6250000001487,335.4399999998177
|
||||
59,359.2350000001643,334.6999999997747,337.0150000000476
|
||||
60,360.8600000000406,336.3000000002826,359.1649999998308
|
||||
61,365.0099999997947,337.7500000000323,360.6650000001364
|
||||
62,366.55999999974665,344.0500000000425,362.31500000029064
|
||||
63,368.10999999969863,360.2750000003466,365.3649999996387
|
||||
64,374.3349999997845,361.8250000002986,366.9650000001466
|
||||
65,389.4599999996826,366.0999999996234,388.01500000043325
|
||||
66,392.159999999687,367.64999999957536,389.41500000053657
|
||||
67,395.2849999998689,373.89999999993915,390.8650000002863
|
||||
68,396.88500000037675,390.39999999966267,392.5150000004405
|
||||
69,398.4100000000508,394.85000000002356,396.7899999997653
|
||||
70,419.63499999955457,396.3749999996976,398.61500000004617
|
||||
71,422.2599999996346,397.8750000000032,418.2399999999516
|
||||
72,425.45999999974083,402.6250000000614,419.8649999998279
|
||||
73,426.91000000040003,420.72500000029277,421.3150000004871
|
||||
74,428.43500000007407,425.12500000009777,425.5899999998119
|
||||
75,435.960000000061,426.62499999949387,427.09000000011747
|
||||
76,450.8349999999082,428.07500000015307,449.4899999999516
|
||||
77,452.4100000001381,433.97500000026366,450.9649999999792
|
||||
78,455.51000000004206,435.9749999997616,452.66499999977987
|
||||
79,457.18499999956475,454.9499999997165,455.6899999997595
|
||||
80,458.68499999987034,456.4999999996685,457.215000000343
|
||||
81,480.8100000002851,457.97499999969614,479.56500000053074
|
||||
82,482.3849999996055,461.324999999651,481.06499999992684
|
||||
83,485.3850000002167,,482.91500000048563
|
||||
84,486.98499999981505,,
|
||||
85,488.60999999969135,,
|
||||
0,5.280000000281171,5.40000000015703,5.559999999883156
|
||||
1,6.779999999677266,11.249999999711742,10.260000000294976
|
||||
2,13.104999999965393,17.275000000302548,15.960000000001028
|
||||
3,16.005000000374302,23.1500000001352,17.610000000155278
|
||||
4,23.479999999805322,29.275000000018785,23.45999999970999
|
||||
5,29.429999999562305,30.850000000248706,29.560000000225127
|
||||
6,37.05499999975148,44.675000000245795,40.18500000011599
|
||||
7,45.95499999956376,47.32499999969428,46.134999999872974
|
||||
8,47.830000000400496,52.074999999752485,53.484999999733276
|
||||
9,53.30500000033356,53.60000000033602,59.6349999998948
|
||||
10,59.47999999986353,59.550000000093,67.26000000008398
|
||||
11,61.05500000009345,75.94999999961425,68.93499999960667
|
||||
12,75.90499999966272,77.47500000019778,76.23499999982059
|
||||
13,77.60500000037285,83.42499999995476,83.50999999975656
|
||||
14,83.50499999957395,89.69999999968701,89.73499999984242
|
||||
15,89.65499999973548,97.14999999974958,98.8099999997813
|
||||
16,97.20500000000033,106.02500000019342,106.25999999984387
|
||||
17,106.20500000001488,107.62499999979178,107.88499999972018
|
||||
18,112.43000000010073,113.52499999990238,113.81000000010872
|
||||
19,119.57999999955649,119.52500000021524,119.96000000027024
|
||||
20,121.12999999950847,128.95000000040733,130.58500000016107
|
||||
21,136.23000000003816,136.17499999978742,136.53499999991806
|
||||
22,142.30500000027536,137.8500000002196,143.83500000013197
|
||||
23,143.780000000303,143.77499999969865,149.90999999945967
|
||||
24,149.73000000006,149.80000000028946,151.68500000009413
|
||||
25,151.38000000021424,158.8999999995968,159.23499999944949
|
||||
26,166.28000000033938,166.52499999978596,166.5349999996634
|
||||
27,167.95499999986208,167.9999999998136,173.90999999980164
|
||||
28,173.82999999969473,173.85000000027782,180.10999999960956
|
||||
29,180.02999999950265,179.87499999995913,189.16000000018
|
||||
30,181.60499999973257,188.97500000017595,196.65999999988895
|
||||
31,196.40499999965544,196.39999999996058,198.28499999976526
|
||||
32,198.27999999958269,197.9750000001905,204.08499999967358
|
||||
33,203.9050000002739,203.9249999999475,210.33500000003738
|
||||
34,210.00499999987954,210.00000000018468,217.88500000030223
|
||||
35,217.57999999951284,217.62500000037386,226.73499999955862
|
||||
36,226.529999999881,226.55000000046408,232.83500000007376
|
||||
37,228.07999999983298,228.10000000041606,234.3100000001014
|
||||
38,234.08000000014584,233.99999999961716,240.30999999950478
|
||||
39,241.5799999998548,240.07499999985436,255.3599999994786
|
||||
40,247.60499999953612,242.0750000002618,256.90999999943057
|
||||
41,256.6800000003845,256.7749999999824,264.2099999996445
|
||||
42,264.1549999998155,264.000000000272,270.33499999952807
|
||||
43,270.1550000001284,265.95000000012357,272.2099999994553
|
||||
44,271.80500000028263,270.3000000002822,280.8849999994946
|
||||
45,284.25499999954485,279.3999999995895,288.38500000011305
|
||||
46,287.10500000030737,287.00000000041024,293.1099999998933
|
||||
47,294.15499999956086,294.149999999866,294.58499999992097
|
||||
48,296.00500000011965,296.1249999999955,300.6349999998802
|
||||
49,300.62999999969765,300.5750000003564,312.7849999994451
|
||||
50,316.8050000003554,309.52499999981507,317.1599999998817
|
||||
51,318.5299999995245,317.10000000035785,324.48499999946404
|
||||
52,323.4549999997093,324.3500000000159,330.55999999970123
|
||||
53,330.4799999995943,330.3749999996972,337.16000000031823
|
||||
54,332.35499999952157,339.474999999914,347.159999999627
|
||||
55,345.77999999961906,347.07499999982525,348.6599999999326
|
||||
56,348.5799999998257,348.7249999999795,354.58500000032114
|
||||
57,353.3299999998839,354.4499999999635,360.6849999999268
|
||||
58,361.0799999996438,360.5749999998471,369.93499999999227
|
||||
59,368.3549999995798,368.1749999997583,377.33499999949896
|
||||
60,377.08000000017495,377.2000000000508,379.05999999957754
|
||||
61,383.50499999975585,384.5499999999111,384.73499999991515
|
||||
62,390.62999999984316,390.6749999997947,390.8850000000767
|
||||
63,392.17999999979514,392.37499999959533,399.9349999997376
|
||||
64,398.3049999996787,399.89999999958223,407.5100000002804
|
||||
65,407.3299999999712,407.4000000002007,409.15999999952516
|
||||
66,414.6549999995536,409.10000000000133,414.9099999997871
|
||||
67,420.87999999963944,414.7999999997074,427.0600000002615
|
||||
68,428.35499999997995,422.5250000000988,430.23500000008977
|
||||
69,437.2800000000702,430.12500000001006,437.6599999998744
|
||||
70,439.0299999995172,437.47499999987036,444.9600000000883
|
||||
71,444.9299999996278,439.19999999994894,451.1349999996183
|
||||
72,450.9049999996627,444.8500000000086,458.86000000000973
|
||||
73,458.4050000002812,450.94999999961425,467.7349999995441
|
||||
74,467.52999999986645,459.97499999990674,469.3600000003299
|
||||
75,469.15499999974276,467.49999999989365,475.1099999996823
|
||||
76,475.05499999985335,474.8250000003855,481.1350000002731
|
||||
77,481.07999999953466,480.9500000002691,490.28500000013634
|
||||
78,488.70499999972384,482.67500000034767,
|
||||
|
|
@ -1,71 +1,73 @@
|
||||
,0,1,2
|
||||
0,4.374999999527063,0.8000000000265572,3.375000000005457
|
||||
1,12.3249999996915,9.94999999988977,9.649999999737702
|
||||
2,19.900000000234286,15.899999999646752,17.150000000356158
|
||||
3,25.649999999586726,22.12499999973261,24.5250000004944
|
||||
4,31.525000000328873,31.100000000378714,33.44999999967513
|
||||
5,40.77500000039436,38.499999999885404,39.524999999912325
|
||||
6,46.55000000002474,44.67500000032487,48.62500000012915
|
||||
7,52.64999999963038,50.700000000006185,53.24999999970714
|
||||
8,61.674999999922875,58.0000000002201,62.050000000226646
|
||||
9,72.19999999961146,65.67500000005566,72.6750000001175
|
||||
10,79.62500000030559,73.2250000003205,78.69999999979882
|
||||
11,85.72499999991123,82.09999999985484,87.6000000005206
|
||||
12,94.62499999972351,88.25000000001637,90.75000000007094
|
||||
13,99.79999999995925,95.87500000020555,96.7500000003838
|
||||
14,106.87500000040018,104.67499999981555,108.67500000017571
|
||||
15,115.67500000001019,106.3749999996162,111.65000000050895
|
||||
16,117.57500000021537,115.27500000033797,120.67499999989195
|
||||
17,127.87500000013097,121.27499999974134,126.7249999998512
|
||||
18,133.74999999996362,130.59999999973115,132.8000000000884
|
||||
19,142.74999999997817,136.39999999963948,138.95000000024993
|
||||
20,146.09999999993306,142.549999999801,147.87500000034015
|
||||
21,156.45000000040454,149.77500000009059,155.50000000052933
|
||||
22,160.874999999578,160.600000000386,161.4999999999327
|
||||
23,171.62499999994907,169.37499999971806,169.09999999984393
|
||||
24,177.47500000041327,172.60000000010223,179.42500000003747
|
||||
25,182.24999999983993,181.42499999999018,183.97499999969114
|
||||
26,188.17500000022847,186.22499999969477,191.74999999972897
|
||||
27,197.1000000003187,193.44999999998436,198.97500000001855
|
||||
28,206.0750000000553,202.40000000035252,207.9750000000331
|
||||
29,212.12500000001455,208.5250000002361,211.04999999965912
|
||||
30,218.10000000004948,215.97500000029868,223.0749999996533
|
||||
31,230.0999999997657,222.32499999995525,229.00000000004184
|
||||
32,233.17500000030122,231.07499999991887,235.0500000000011
|
||||
33,242.1249999997599,235.7249999997748,241.0749999996824
|
||||
34,245.2499999999418,241.72500000008768,250.07499999969696
|
||||
35,254.37499999952706,250.599999999622,256.32500000006075
|
||||
36,263.1499999997686,253.92500000020846,265.2000000005046
|
||||
37,264.9250000004031,265.800000000354,271.2250000001859
|
||||
38,275.3999999995358,272.0750000000862,280.17499999964457
|
||||
39,279.9750000003769,277.8499999997166,287.900000000036
|
||||
40,291.7749999996886,285.3749999997035,296.699999999646
|
||||
41,293.4750000003987,290.15000000003965,298.3250000004318
|
||||
42,299.4749999998021,296.0249999998723,307.3250000004464
|
||||
43,308.324999999968,306.7750000002434,313.27500000020336
|
||||
44,315.87500000023283,316.850000000386,322.4999999999909
|
||||
45,323.4499999998661,320.1000000001386,331.3999999998032
|
||||
46,329.47499999954744,328.9500000003045,337.425000000394
|
||||
47,335.62499999970896,335.09999999955653,343.47500000035325
|
||||
48,346.3000000001557,344.124999999849,352.6500000004944
|
||||
49,350.8249999995314,352.949999999737,358.4250000001248
|
||||
50,359.69999999997526,360.69999999949687,361.70000000015534
|
||||
51,367.2500000002401,365.19999999950414,372.12499999964166
|
||||
52,371.6500000000451,374.2750000003525,379.70000000018445
|
||||
53,382.09999999980937,381.8000000003394,387.34999999974207
|
||||
54,386.55000000017026,389.0750000002754,394.62499999967804
|
||||
55,392.57499999985157,395.17499999988104,405.05000000007385
|
||||
56,398.92499999950815,404.1250000002492,406.5749999997479
|
||||
57,409.1500000004089,413.17499999991014,412.7249999999094
|
||||
58,415.29999999966094,419.175000000223,418.82500000042455
|
||||
59,422.82499999964784,426.77500000013424,427.67499999968095
|
||||
60,431.775000000016,435.6749999999465,436.92499999974643
|
||||
61,437.8999999998996,437.4000000000251,445.97500000031687
|
||||
62,445.34999999996217,447.8750000000673,454.7749999999269
|
||||
63,452.8250000003027,455.37499999977626,461.29999999971005
|
||||
64,461.9750000001659,461.67499999978645,468.4500000000753
|
||||
65,470.97500000018044,470.34999999982574,475.87499999985994
|
||||
66,475.4499999999098,476.37499999950705,482.0999999999458
|
||||
67,481.4249999999447,482.32500000017353,489.72500000013497
|
||||
68,487.5499999998283,488.52499999998145,496.95000000042455
|
||||
69,497.90000000029977,496.09999999961474,
|
||||
0,2.2737367544323206e-10,3.974999999627471,6.175000000212094
|
||||
1,6.999999999834472,9.874999999738066,15.374999999721695
|
||||
2,12.974999999869397,15.949999999975262,24.274999999533975
|
||||
3,23.349999999709325,24.849999999787542,27.324999999791544
|
||||
4,25.27500000019245,33.82500000043365,36.27500000015971
|
||||
5,31.12499999974716,39.74999999991269,42.47499999996762
|
||||
6,44.62499999976899,48.8999999997759,49.925000000030195
|
||||
7,47.549999999546344,51.97500000031141,60.250000000223736
|
||||
8,55.24999999965985,62.5,65.07500000020627
|
||||
9,61.100000000124055,69.97500000034051,69.74999999943066
|
||||
10,70.12499999950705,76.17500000014843,81.82499999998072
|
||||
11,74.67500000007021,82.1750000004613,87.65000000016698
|
||||
12,82.20000000005712,88.02500000001601,93.74999999977263
|
||||
13,91.07499999959145,98.67500000018481,99.72499999980755
|
||||
14,92.77500000030159,106.0749999996915,108.44999999949323
|
||||
15,100.20000000008622,113.774999999805,117.574999999988
|
||||
16,112.15000000015607,119.77500000011787,120.74999999981628
|
||||
17,113.87500000023465,127.34999999975116,129.77500000010878
|
||||
18,118.45000000016626,136.12499999999272,137.30000000009568
|
||||
19,130.42499999960455,139.42500000030122,146.42499999968095
|
||||
20,136.39999999963948,148.22499999991123,153.7999999998192
|
||||
21,145.35000000000764,155.80000000045402,159.77499999985412
|
||||
22,151.50000000016917,163.47500000028958,168.74999999959073
|
||||
23,160.52499999955216,172.24999999962165,173.55000000020482
|
||||
24,163.74999999993634,178.57499999990978,183.82499999984248
|
||||
25,175.49999999960164,184.5999999995911,189.8499999995238
|
||||
26,183.1750000003467,190.42499999977736,195.89999999948304
|
||||
27,184.82499999959145,199.72500000039872,201.82499999987158
|
||||
28,193.57499999955508,205.7249999998021,211.25000000006366
|
||||
29,201.1750000003758,211.7500000003929,217.07500000024993
|
||||
30,205.65000000010514,219.20000000045547,221.65000000018154
|
||||
31,217.82499999994798,226.64999999960855,229.1000000002441
|
||||
32,223.7500000003365,237.20000000048458,235.24999999949614
|
||||
33,226.9250000001648,241.64999999993597,241.37500000028922
|
||||
34,237.4499999998534,247.82500000037544,250.1499999996213
|
||||
35,244.77500000034524,256.75000000046566,259.2499999998381
|
||||
36,247.95000000017353,270.0750000003609,269.6000000003096
|
||||
37,259.82500000031905,271.7000000002372,271.30000000011023
|
||||
38,264.5999999997457,279.4999999996435,280.1249999999982
|
||||
39,269.099999999753,286.72499999993306,283.3749999997508
|
||||
40,277.9750000001968,288.4750000002896,295.27500000017426
|
||||
41,288.57499999980973,295.97499999999854,301.4250000003358
|
||||
42,290.10000000039327,302.09999999988213,307.3499999998148
|
||||
43,298.9250000002812,312.7999999996973,316.3750000001073
|
||||
44,305.30000000021573,322.77499999963766,324.0750000002208
|
||||
45,313.99999999962347,328.80000000022847,328.32500000017717
|
||||
46,320.29999999963366,330.57499999995343,337.3250000001917
|
||||
47,326.37499999987085,341.0249999997177,339.2750000000433
|
||||
48,332.14999999950123,347.30000000035943,346.5750000002572
|
||||
49,344.07500000020264,355.99999999976717,358.44999999949323
|
||||
50,347.2999999996773,360.6499999996231,361.6749999998774
|
||||
51,357.97500000012406,368.3000000000902,370.649999999614
|
||||
52,362.2749999997268,377.09999999970023,379.70000000018445
|
||||
53,368.3750000002419,378.89999999970314,385.9250000002703
|
||||
54,377.3999999996249,386.1249999999927,391.7499999995471
|
||||
55,380.4499999998825,395.3250000004118,400.8000000001175
|
||||
56,389.5999999997457,404.5249999999214,406.7000000002281
|
||||
57,399.9500000002172,410.3500000001077,414.5249999999123
|
||||
58,406.2500000002274,419.3750000004002,422.0499999998992
|
||||
59,413.7750000002143,423.92500000005384,427.8249999995296
|
||||
60,419.4749999999203,431.6500000004453,436.8499999998221
|
||||
61,428.52499999958127,440.30000000020664,442.77500000021064
|
||||
62,434.47500000024775,443.449999999757,451.74999999994725
|
||||
63,440.72499999970205,454.1749999998501,458.12499999988177
|
||||
64,448.2749999999669,458.42499999980646,464.174999999841
|
||||
65,455.77499999967586,467.4750000003769,473.32499999970423
|
||||
66,461.6499999995085,476.4000000004671,477.67499999986285
|
||||
67,464.949999999817,484.00000000037835,486.8999999996504
|
||||
68,476.89999999988686,488.550000000032,492.574999999988
|
||||
69,485.6499999998505,497.72500000017317,
|
||||
70,487.2250000000804,,
|
||||
71,494.94999999956235,,
|
||||
|
|
@ -1,79 +1,79 @@
|
||||
,1,0,2
|
||||
0,0.9749999995259713,5.37499999973079,6.675000000271757
|
||||
1,6.624999999585635,6.87500000003638,12.875000000079671
|
||||
2,14.17499999985048,13.200000000324508,14.525000000233922
|
||||
3,15.949999999575448,20.599999999831198,21.774999999891953
|
||||
4,21.650000000190992,22.149999999783176,29.40000000008113
|
||||
5,29.575000000077488,31.124999999519787,36.77500000021937
|
||||
6,38.50000000016771,37.04999999990832,43.17500000043183
|
||||
7,44.59999999977335,44.574999999895226,51.82500000019318
|
||||
8,51.899999999987266,52.05000000023574,53.574999999640205
|
||||
9,59.299999999493956,58.2750000003216,59.6499999998774
|
||||
10,61.15000000005275,67.00000000000728,67.12500000021791
|
||||
11,68.89999999981265,73.44999999986612,74.5249999997246
|
||||
12,80.52499999990724,80.87499999965075,81.89999999986284
|
||||
13,81.97499999965694,89.5250000003216,88.02499999974643
|
||||
14,89.42499999971952,91.34999999969295,89.74999999982501
|
||||
15,90.99999999994944,97.22499999952561,97.65000000034306
|
||||
16,97.37499999988395,103.5249999995358,104.60000000030377
|
||||
17,104.72499999974426,112.19999999957508,112.05000000036634
|
||||
18,112.05000000023611,118.37500000001455,113.8749999997377
|
||||
19,119.50000000029868,127.1999999999025,125.74999999988322
|
||||
20,121.24999999974571,133.37500000034197,127.2500000001888
|
||||
21,133.37499999994216,135.00000000021828,134.6000000000491
|
||||
22,136.19999999951725,142.39999999972497,136.40000000005202
|
||||
23,142.250000000386,148.44999999968422,149.77500000050313
|
||||
24,149.67500000017063,157.4000000000524,157.17500000000982
|
||||
25,151.34999999969332,164.9250000000393,158.9000000000884
|
||||
26,157.42499999993052,172.37500000010186,164.82500000047693
|
||||
27,166.47499999959146,179.87499999981083,172.19999999970568
|
||||
28,172.25000000013134,181.57499999961146,179.87500000045074
|
||||
29,179.7000000001939,187.64999999984866,187.3750000001597
|
||||
30,181.50000000019682,196.6499999998632,193.29999999963874
|
||||
31,194.77499999953616,202.52499999969586,194.97500000007093
|
||||
32,196.49999999961474,210.17500000016298,202.45000000041145
|
||||
33,202.324999999801,217.49999999974534,210.15000000052495
|
||||
34,208.5750000001648,225.09999999965657,217.40000000018298
|
||||
35,217.29999999985048,226.92499999993743,225.07500000001855
|
||||
36,224.775000000191,232.60000000027503,232.37500000023246
|
||||
37,226.77499999968896,240.37500000031287,234.1249999996795
|
||||
38,238.5499999996322,247.6249999999709,241.72500000050022
|
||||
39,240.17499999950851,255.3250000000844,247.5000000001306
|
||||
40,247.45000000035398,262.775000000147,253.8750000000651
|
||||
41,253.67499999953034,268.72499999990396,262.5249999998265
|
||||
42,262.42499999949393,270.34999999978027,270.22499999994
|
||||
43,268.62500000021134,277.75000000019645,277.5749999998003
|
||||
44,277.42499999982135,285.2999999995518,279.27500000051043
|
||||
45,279.124999999622,292.699999999968,292.5250000004813
|
||||
46,286.57499999968456,298.82499999985157,294.3000000002063
|
||||
47,292.6249999996438,300.50000000028376,300.22499999968534
|
||||
48,300.17499999990866,314.2250000000786,307.74999999967224
|
||||
49,307.57500000032485,322.82500000019354,315.325000000215
|
||||
50,315.19999999960453,328.84999999987485,322.7249999997217
|
||||
51,321.3250000003976,330.5000000000291,330.3499999999109
|
||||
52,329.0750000001575,337.8999999995358,336.4250000001481
|
||||
53,337.60000000034813,345.7250000001295,337.97500000010007
|
||||
54,339.30000000014877,352.8500000002168,351.5500000000462
|
||||
55,346.7749999995798,359.0750000003027,353.0999999999982
|
||||
56,352.87500000009493,368.02499999976135,360.47500000013645
|
||||
57,360.34999999952595,369.8500000000422,367.8500000002747
|
||||
58,367.7249999996642,381.67499999963184,374.07500000036055
|
||||
59,375.3249999995754,383.20000000021537,377.0499999997843
|
||||
60,382.79999999991594,389.3500000003769,383.1500000002994
|
||||
61,390.4250000001051,398.0249999995067,390.8749999997814
|
||||
62,397.8249999996118,404.1749999996682,397.92499999994436
|
||||
63,399.6249999996147,406.04999999959546,405.9249999997552
|
||||
64,405.4750000000789,413.1250000000364,413.15000000004477
|
||||
65,407.3750000002841,420.7249999999476,420.525000000183
|
||||
66,419.075000000303,428.14999999973224,428.0500000001699
|
||||
67,427.94999999983736,435.6999999999971,434.24999999997783
|
||||
68,429.649999999638,437.4500000003536,435.9000000001321
|
||||
69,435.7249999998752,449.39999999951397,443.2499999999924
|
||||
70,443.1499999996598,456.9000000001324,450.8000000002572
|
||||
71,450.774999999849,458.34999999988213,458.1249999998396
|
||||
72,458.02499999950703,465.82500000022264,465.75000000002876
|
||||
73,465.5749999997719,473.2750000002852,473.20000000009134
|
||||
74,473.15000000031466,480.92499999984284,480.7749999997246
|
||||
75,479.4250000000469,488.27499999970314,482.6000000000055
|
||||
76,488.1000000000862,494.4500000001426,488.3999999999138
|
||||
77,489.87499999981117,,
|
||||
,0,1,2
|
||||
0,6.67499999985921,6.749999999608553,6.799999999739157
|
||||
1,8.374999999659849,8.300000000470027,8.325000000322689
|
||||
2,14.300000000048385,14.40000000007567,15.925000000233922
|
||||
3,15.899999999646752,22.425000000164438,23.249999999816282
|
||||
4,23.424999999633656,29.424999999771536,29.25000000012915
|
||||
5,30.75000000012551,37.12499999988504,30.949999999929787
|
||||
6,36.949999999933425,44.500000000023284,38.57500000011896
|
||||
7,45.90000000030159,52.17499999985885,45.89999999970132
|
||||
8,51.95000000026084,59.5000000003507,53.37500000004184
|
||||
9,59.449999999969805,61.07499999967113,59.82499999990068
|
||||
10,60.950000000275395,67.25000000011059,68.37499999945976
|
||||
11,68.55000000018663,74.80000000037543,74.62499999982356
|
||||
12,76.04999999989559,83.59999999998544,82.19999999945685
|
||||
13,85.27499999968313,90.12499999976862,83.82500000024265
|
||||
14,91.02499999994507,97.37500000033614,97.19999999978427
|
||||
15,97.07499999990432,104.77499999984283,98.70000000008986
|
||||
16,105.12500000027103,112.2249999999054,104.72499999977117
|
||||
17,112.12499999987813,113.97500000026193,112.47499999953106
|
||||
18,113.80000000031032,120.1499999997919,119.92499999959364
|
||||
19,121.19999999981701,127.55000000020809,127.52499999950487
|
||||
20,127.24999999977626,134.87499999979045,134.70000000014807
|
||||
21,136.1250000002201,137.0500000003245,136.47499999987303
|
||||
22,142.25000000010368,143.92500000036088,143.7999999994554
|
||||
23,149.80000000036853,157.50000000030704,149.94999999961692
|
||||
24,151.50000000016917,158.99999999970314,158.75000000013642
|
||||
25,160.44999999962783,165.0499999996624,164.9249999996664
|
||||
26,166.52499999986503,173.95000000038416,172.77499999962856
|
||||
27,174.00000000020555,180.30000000004074,179.92499999999382
|
||||
28,181.29999999950996,187.5749999999767,181.52499999959218
|
||||
29,187.4000000000251,194.99999999976134,188.85000000008404
|
||||
30,189.2499999996744,196.6499999999156,195.09999999953834
|
||||
31,196.40000000003965,204.22500000045838,202.79999999965185
|
||||
32,202.72500000032778,211.80000000009167,213.27499999969405
|
||||
33,211.5249999999378,219.10000000030558,219.1499999995267
|
||||
34,217.5499999996191,225.1749999996333,225.32499999996617
|
||||
35,225.37500000021282,232.79999999982246,232.67499999982647
|
||||
36,232.54999999994652,234.37500000005238,234.29999999970278
|
||||
37,234.24999999974716,247.77499999987194,241.70000000011896
|
||||
38,241.59999999960746,249.30000000045547,249.22500000010587
|
||||
39,247.749999999769,255.32500000013678,255.5499999994845
|
||||
40,256.5999999999349,263.0250000002503,264.20000000015534
|
||||
41,262.8500000002987,270.3499999998327,270.3749999996853
|
||||
42,270.3249999997297,272.1000000001892,271.90000000026885
|
||||
43,271.8999999999596,279.42499999977156,279.29999999977554
|
||||
44,279.27500000009786,286.9750000000364,286.7999999994845
|
||||
45,286.80000000008476,293.24999999976865,294.4000000003052
|
||||
46,294.2749999995158,300.5249999997046,300.3500000000622
|
||||
47,300.44999999995525,308.25000000009607,308.0999999998221
|
||||
48,303.69999999970787,315.70000000015864,315.400000000036
|
||||
49,315.4749999996511,323.05000000001894,317.174999999761
|
||||
50,317.0249999996031,324.5999999999709,324.5249999996213
|
||||
51,330.54999999990287,331.17500000031,331.9999999999618
|
||||
52,331.9999999996526,339.525000000374,339.42499999974643
|
||||
53,338.25000000001637,345.7749999998283,345.62499999955435
|
||||
54,346.8999999997777,354.65000000027214,353.32499999966785
|
||||
55,352.9750000000149,360.7000000002314,360.67499999952815
|
||||
56,354.7000000000935,368.19999999994036,362.17499999983374
|
||||
57,361.97500000002947,369.8000000004482,369.52499999969405
|
||||
58,369.675000000143,376.00000000025614,377.17500000016116
|
||||
59,377.30000000033215,384.8250000001441,384.6499999995922
|
||||
60,383.4499999995842,392.3999999997774,393.99999999985994
|
||||
61,392.100000000255,399.8250000004715,399.7749999994903
|
||||
62,398.5750000003918,406.0000000000015,405.8000000000811
|
||||
63,405.94999999962056,413.40000000041766,413.62499999976535
|
||||
64,407.44999999992615,415.25000000006696,420.7750000001306
|
||||
65,413.4999999998854,428.4749999997599,428.4000000003198
|
||||
66,422.45000000025357,430.0999999996362,429.8999999997159
|
||||
67,428.5999999995056,436.5250000001266,435.94999999967513
|
||||
68,437.3250000001008,443.5750000002896,444.9499999996897
|
||||
69,443.4750000002623,445.22500000044386,452.5499999996009
|
||||
70,452.30000000015025,452.62499999995055,459.8499999998148
|
||||
71,454.32499999992615,460.14999999993745,465.95000000032996
|
||||
72,460.1249999998345,466.22500000017465,467.6500000001306
|
||||
73,467.52500000025066,473.7750000004395,474.89999999978863
|
||||
74,473.6749999995027,481.14999999966824,482.59999999990214
|
||||
75,482.4750000000222,490.1499999996828,490.0000000003183
|
||||
76,488.74999999975444,,
|
||||
77,496.1500000001706,,
|
||||
|
|
@ -1,88 +1,76 @@
|
||||
,0,1,2
|
||||
0,18.92999999987338,2.57499999995375,20.395000000194614
|
||||
1,20.47999999982536,20.775000000387397,21.99499999979298
|
||||
2,22.05500000005528,23.249999999709278,23.595000000300843
|
||||
3,24.930000000186247,25.04999999971219,26.494999999800257
|
||||
4,26.655000000264828,28.474999999591407,29.519999999779884
|
||||
5,29.77999999953723,32.59999999997703,50.52000000042017
|
||||
6,49.204999999947596,50.474999999525934,52.120000000018536
|
||||
7,52.330000000129495,52.374999999731116,55.09500000035177
|
||||
8,55.07999999978025,55.100000000013424,56.645000000303746
|
||||
9,56.97999999998543,58.12499999999305,59.64500000000543
|
||||
10,61.27999999958816,80.59999999975149,80.6950000002921
|
||||
11,80.73000000027648,82.17499999998141,83.4700000002208
|
||||
12,82.3049999995969,85.1250000000367,85.14499999974349
|
||||
13,85.15500000035942,86.70000000026663,86.67000000032702
|
||||
14,86.85500000016006,88.57500000019387,89.56999999982644
|
||||
15,89.80500000021536,110.59999999949683,110.6699999997595
|
||||
16,110.90500000014842,112.24999999965108,112.31999999991375
|
||||
17,112.50499999974679,113.89999999980533,113.89500000014367
|
||||
18,115.20499999975115,116.65000000036558,116.7449999999967
|
||||
19,116.88000000018334,119.67500000034521,119.72000000032995
|
||||
20,118.45500000041326,140.77500000027825,140.74500000033868
|
||||
21,139.35499999994178,142.44999999980095,142.27000000001271
|
||||
22,142.30499999999708,143.95000000010654,143.84500000024263
|
||||
23,145.3299999999767,146.77499999968163,146.69500000009566
|
||||
24,147.0050000004089,149.67500000009053,149.844999999646
|
||||
25,150.22999999988357,152.99999999976748,171.04499999978134
|
||||
26,171.2549999998923,173.69999999980095,173.7950000003416
|
||||
27,173.90500000025028,175.3000000003088,175.369999999662
|
||||
28,175.50499999984865,176.92500000018512,177.16999999966492
|
||||
29,177.25500000020517,179.87500000024042,179.92000000022517
|
||||
30,181.52999999952996,183.24999999956376,200.9949999998803
|
||||
31,202.47999999961436,202.3750000002768,202.59500000038815
|
||||
32,204.0050000001979,203.97499999987517,205.41999999996324
|
||||
33,205.60499999979626,205.80000000015602,207.09500000039543
|
||||
34,207.40499999979917,208.47499999988244,209.99499999989484
|
||||
35,211.7050000003114,213.12499999973838,231.01999999990358
|
||||
36,229.9300000001135,231.15000000004542,232.67000000005783
|
||||
37,232.7050000000422,233.99999999989845,235.7200000003154
|
||||
38,235.6049999995416,235.75000000025497,237.37000000046964
|
||||
39,237.30500000025174,239.9499999996554,241.77000000027465
|
||||
40,238.9049999998501,241.89999999950697,261.22000000005346
|
||||
41,261.22999999975985,261.249999999993,262.89500000048565
|
||||
42,262.73000000006544,264.2000000000483,265.8699999999094
|
||||
43,265.6050000001964,267.04999999990133,267.6699999999123
|
||||
44,267.2300000000727,268.89999999955063,270.3200000002703
|
||||
45,268.9049999995954,290.09999999968596,291.1700000001524
|
||||
46,290.23000000021096,292.92500000017054,292.7200000001044
|
||||
47,292.70499999953284,295.7250000003772,294.2950000003343
|
||||
48,294.405000000243,297.3500000002535,297.26999999975806
|
||||
49,297.50500000014694,300.3000000003088,299.12000000031685
|
||||
50,299.42999999972056,321.52499999981256,321.39499999967074
|
||||
51,320.1050000003856,324.39999999994353,323.1199999997493
|
||||
52,322.92999999996067,326.0750000003757,325.79500000038524
|
||||
53,325.854999999738,329.0249999995215,327.5200000004638
|
||||
54,327.55499999953867,330.6749999996758,330.3450000000389
|
||||
55,329.22999999997086,351.67500000031606,351.3950000003256
|
||||
56,332.35500000015276,354.27500000011815,352.99499999992395
|
||||
57,352.95499999998395,355.94999999964085,354.6450000000782
|
||||
58,354.5549999995823,358.95000000025203,357.4200000000069
|
||||
59,356.12999999981224,361.09999999959865,359.1450000000855
|
||||
60,359.07999999986754,381.47499999965686,381.64500000012185
|
||||
61,362.20500000004944,383.09999999953317,383.14500000042744
|
||||
62,381.9799999998035,384.7499999996874,384.89499999987447
|
||||
63,384.5799999996056,387.5249999996161,387.6200000001568
|
||||
64,386.28000000031574,390.6000000001516,390.5199999996562
|
||||
65,389.13000000016876,411.5749999996045,392.47000000041726
|
||||
66,392.330000000275,413.100000000188,413.2200000000971
|
||||
67,413.1800000001571,414.69999999978637,414.69500000012476
|
||||
68,414.7799999997555,417.57499999991734,417.5449999999778
|
||||
69,416.2800000000611,420.6250000001749,419.27000000005637
|
||||
70,417.9799999998617,441.90000000023457,421.04499999978134
|
||||
71,422.22999999981806,444.6249999996074,441.7950000003707
|
||||
72,441.8800000000014,446.3000000000396,444.6199999999458
|
||||
73,443.380000000307,447.8249999997136,446.3700000003023
|
||||
74,446.23000000016003,450.84999999969324,448.14500000002727
|
||||
75,449.2299999998617,471.7749999994997,453.8950000002892
|
||||
76,451.10499999978896,473.4999999995783,471.8950000003183
|
||||
77,471.93000000030264,476.2999999997849,474.7949999998177
|
||||
78,473.42999999969874,477.99999999958555,476.4700000002499
|
||||
79,476.37999999975403,481.00000000019674,478.12000000040416
|
||||
80,478.00499999963034,,481.07000000045946
|
||||
81,482.45499999999123,,501.89500000006365
|
||||
82,500.6549999995153,,
|
||||
83,503.4799999999999,,
|
||||
84,505.35499999992714,,
|
||||
85,508.1550000001338,,
|
||||
86,509.88000000021236,,
|
||||
0,0.820000000122556,5.785000000208038,1.5349999994466095
|
||||
1,12.744999999914464,13.184999999714728,13.43499999987007
|
||||
2,18.719999999949387,19.135000000381208,18.035000000079616
|
||||
3,24.795000000186583,25.01000000021386,25.70999999991518
|
||||
4,30.869999999514285,31.33499999959249,36.21000000023532
|
||||
5,36.86999999982715,43.03499999961141,42.03499999951209
|
||||
6,48.79499999961906,44.81000000024587,48.2350000002295
|
||||
7,50.44499999977331,54.2599999998064,55.609999999458246
|
||||
8,56.49499999973256,61.235000000045055,61.90999999946843
|
||||
9,60.94500000009345,67.31000000028224,67.71000000028626
|
||||
10,67.27000000038159,77.71000000040011,73.68500000032118
|
||||
11,73.24499999950702,79.28499999972054,84.25999999965616
|
||||
12,79.24499999981988,85.38500000023568,90.23499999969108
|
||||
13,91.07000000031901,91.40999999991699,96.41000000013055
|
||||
14,97.020000000076,97.33500000030553,103.80999999963724
|
||||
15,98.8699999997253,107.85999999999412,109.80999999995011
|
||||
16,103.32000000008618,109.43500000022404,117.61000000026588
|
||||
17,115.09500000002943,120.03499999983696,122.08499999999522
|
||||
18,121.14499999998868,125.98499999959394,127.78499999970128
|
||||
19,127.22000000022588,127.68500000030409,133.88500000021642
|
||||
20,133.21999999962924,133.78499999990973,140.08500000002434
|
||||
21,140.8950000003743,145.4599999996507,150.41000000021788
|
||||
22,151.1950000002899,151.4850000002415,152.13500000029646
|
||||
23,157.2699999996176,162.28500000025898,162.5100000001364
|
||||
24,158.91999999977185,165.23500000031427,164.18499999965908
|
||||
25,169.2449999999654,175.53500000022987,174.53500000013057
|
||||
26,175.36999999984897,177.4599999998035,176.18500000028482
|
||||
27,181.62000000021277,187.7599999997191,186.5349999998468
|
||||
28,187.52000000032336,193.6599999998297,192.6599999997304
|
||||
29,193.4950000003583,198.3600000002415,200.15999999943935
|
||||
30,199.59499999996393,205.9349999998748,210.58499999983516
|
||||
31,205.49500000007453,211.73499999978313,212.16000000006508
|
||||
32,217.41999999986643,217.76000000037394,218.65999999957032
|
||||
33,219.11999999966707,228.58499999975984,224.36000000018586
|
||||
34,223.71999999987662,234.38499999966817,230.35999999958923
|
||||
35,235.49499999981987,236.03499999982242,236.21000000005344
|
||||
36,237.2450000001764,242.23499999963033,248.30999999997195
|
||||
37,241.67000000025934,252.55999999982387,256.08500000000976
|
||||
38,247.76999999986498,259.98499999960853,260.3349999999661
|
||||
39,259.6949999996569,265.95999999964346,270.8599999996547
|
||||
40,265.69499999996975,272.0099999996027,277.0099999998162
|
||||
41,271.7949999995754,278.46000000037105,283.03499999949753
|
||||
42,277.8200000001662,288.7350000000087,289.06000000008834
|
||||
43,283.8449999998475,296.2100000003492,298.2849999998759
|
||||
44,289.9200000000847,302.2099999997526,301.0599999998046
|
||||
45,295.97000000004397,308.2849999999898,308.63499999943787
|
||||
46,307.77000000026516,314.33499999994905,319.0850000001116
|
||||
47,309.57000000026807,321.73500000036523,320.70999999998793
|
||||
48,318.86999999997994,327.8349999999709,326.73499999966924
|
||||
49,325.9200000001429,336.86000000026337,337.1349999997871
|
||||
50,331.94499999982423,342.81000000002035,343.3100000002266
|
||||
51,337.8949999995812,350.3600000002852,350.68499999945533
|
||||
52,344.04499999974274,357.8349999997162,356.8100000002484
|
||||
53,350.07000000033355,362.3349999997235,367.30999999965906
|
||||
54,362.0200000004034,368.51000000016296,368.9599999998133
|
||||
55,368.07000000036265,378.9599999999272,375.0350000000505
|
||||
56,374.1699999999683,380.65999999972786,382.6600000002397
|
||||
57,380.17000000028116,391.4350000003769,393.0350000000796
|
||||
58,386.47000000029135,394.03500000017897,398.9350000001902
|
||||
59,398.1199999997544,400.11000000041616,404.85999999966924
|
||||
60,399.819999999555,404.66000000006983,410.9849999995528
|
||||
61,409.0699999996205,415.2350000003143,421.4350000002266
|
||||
62,416.44499999975875,422.5850000001746,423.1099999997493
|
||||
63,422.2449999996671,430.2349999997322,427.7099999999588
|
||||
64,428.31999999990427,434.80999999966383,439.5599999998264
|
||||
65,434.32000000021714,445.13499999985737,441.2350000002586
|
||||
66,440.39499999954484,446.6600000004409,447.3600000001422
|
||||
67,446.3450000002113,453.0100000000975,460.65999999975946
|
||||
68,458.34499999992755,458.78499999972786,463.7599999996634
|
||||
69,459.9449999995259,466.65999999996797,471.13499999980166
|
||||
70,464.64499999993774,475.5350000004118,475.609999999531
|
||||
71,472.21999999957103,483.0099999998428,477.3599999998875
|
||||
72,481.37000000034374,488.860000000307,487.8349999999297
|
||||
73,488.4700000001531,,495.21000000006796
|
||||
74,494.5950000000367,,
|
||||
|
|
BIN
motivation.pdf
BIN
motivation.png
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
@ -258,12 +258,7 @@ def motivation_all_small(dev_desired = '1',ylim=[-1.25, 1.25], c1=10, dfs=['m1',
|
||||
|
||||
time_array = time_array * 1000
|
||||
|
||||
color0 = 'green'
|
||||
color0_burst = 'darkgreen'
|
||||
color01 = 'green'
|
||||
color02 = 'red'
|
||||
color012 = 'orange'
|
||||
color01_2 = 'purple'
|
||||
color01, color012, color01_2, color02, color0_burst, color0 = colors_suscept_paper_dots()
|
||||
colors_am = ['black', 'black', 'black', 'black'] # color01, color02, color012]
|
||||
extracted = [False, True, True, True]
|
||||
extracted2 = [False, False, False, False]
|
||||
@ -347,7 +342,7 @@ def motivation_all_small(dev_desired = '1',ylim=[-1.25, 1.25], c1=10, dfs=['m1',
|
||||
array_chosen=array_chosen,
|
||||
color0_burst=color0_burst, mean_types=[mean_type],
|
||||
color01=color01, color02=color02,ylim_log=(-15, 3),
|
||||
color012=color012,color012_minus = 'pink',
|
||||
color012=color012,color012_minus = color01_2,color0=color0,
|
||||
color01_2=color01_2)
|
||||
|
||||
##########################################################################
|
||||
|
@ -491,7 +491,7 @@
|
||||
%In this work, the influence of nonlinearities on stimulus encoding in the primary sensory afferents of weakly electric fish of the species \lepto{} was investigated. These fish produce an electric organ discharge (EOD) with a fish-specific frequency. When the EOD of one fish interferes with the EOD of another fish, it results in a signal with a periodic amplitude modulation, called beat. The beat provides information about the sex and size of the encountered conspecific and is the basis for communication. The beat frequency is predicted as the difference between the EOD frequencies and the beat amplitude corresponds to the size of the smaller EOD field. Primary sensory afferents, the P-units, phase-lock to the EOD and encode beats with changes in their firing rate. In this work, the nonlinearities of primary electrosensory afferents, the P-units of weakly electric fish of the species \lepto{} and \eigen{} were addressed. Nonlinearities were characterized as the second-order susceptibility of P-units, in a setting where at least three fish were present. The nonlinear responses of P-units were especially strong in regular firing P-units. White noise stimulation was confirmed as a method to retrieve the socond-order suscepitbility in P-units.% with bursting being identified as a factor enhancing nonlinear interactions.
|
||||
%\end{abstract}
|
||||
|
||||
\end{frontmatter}
|
||||
%\end{frontmatter}
|
||||
|
||||
|
||||
|
||||
@ -578,18 +578,18 @@ The smaller \fdiff{} power spectral peak observed during pure sine-wave stimulat
|
||||
|
||||
\begin{figure*}[!ht]
|
||||
\includegraphics[width=\columnwidth]{data_overview_mod}
|
||||
\caption{\label{fig:data_overview_mod} Nonlinearity for a population of P-units (\panel{A, C}) and ampullary cells (\panel{B, D}). The nonlinearity index \nli{} is calculated as the maximal value in the range $\fbase{} \pm 5$\,Hz of the projected diagonal divided by its median (see \Eqnref{eq:nli_equation}). Each recorded neuron contributes at maximum with two stimulus contrasts. \figitem{A, B} There is a negative correlation between the CV during baseline and \nli. \figitem{C, D} The \nli{} is plotted against the response modulation, (see methods), an indicator of the subjective stimulus strength for a cell. There is a negative correlation between response modulation and \nli. Restricting the analysis to the weakest stimulus that was presented to each unique neuron, does not change the results. The number of unique neurons is 222 for P-units and 45 for ampullary cells.
|
||||
\caption{\label{fig:data_overview_mod} Nonlinearity for a population of P-units (\panel{A, C}) and ampullary cells (\panel{B, D}). The nonlinearity index \nli{} is calculated as the maximal value in the range $\fbase{} \pm 5$\,Hz of the projected diagonal divided by its median (see \Eqnref{eq:nli_equation}). Each recorded neuron contributes at maximum with two stimulus contrasts. \figitem{A, B} There is a negative correlation between the CV during baseline and \nli. \figitem{C, D} There is a negative correlation between the CV during stimulation and \nli. \figitem{E, F} The \nli{} is plotted against the response modulation, (see methods), an indicator of the subjective stimulus strength for a cell. There is a negative correlation between response modulation and \nli. Restricting the analysis to the weakest stimulus that was presented to each unique neuron, does not change the results. The number of unique neurons is 222 for P-units and 45 for ampullary cells.
|
||||
}
|
||||
\end{figure*}
|
||||
|
||||
%\Eqnref{response_modulation}
|
||||
|
||||
\subsection*{Low CVs and weak stimuli are associated with strong nonlinearity}
|
||||
The nonlinear effects shown for single cell examples above are supported by the analysis of the pool of 222 P-units and 45 ampullary afferents recorded in 71 specimen. To compare across cells we expressed the second-order susceptibility as the nonlinearity index \nli{}, see \Eqnref{eq:nli_equation}. The \nli{} characterizes the peakedness of the projections onto the diagonal of the \suscept{} matrices (e.g. \subfigref{fig:cells_suscept}{G} at \fbase{}). It assumes high values when the \fbase{} peak in the projected diagonal is pronounced relative to the median of the diagonal and is small when there is no distinct peak. The P-unit population \nli{} values depend weakly on the CV of the ISI distribution under baseline condition. Cells with lower baseline CVs have the tendency to exhibit a stronger nonlinearity than those that have high CVs (Pearson's $r=-0.16$, $p<0.01$). The two example P-units shown before (\figrefb{fig:cells_suscept} and \figrefb{fig:cells_suscept_high_CV}) are highlighted with dark circles in \subfigrefb{fig:data_overview_mod}{A, C}. The stimulus strength plays an important role. Several of the recorded neurons contribute with two dots to the data as their responses to the same RAM stimulus but with different contrasts were recorded. Higher stimulus contrasts lead to a stronger drive and thus stronger response modulations (see color code bar in \subfigref{fig:data_overview_mod}{A}, see methods). Since P-units are heterogeneous in their susceptibility to the stimulus\cite{Grewe2017}, their responses to the same stimulus intensity vary a lot. When replotting the \nli{} against the response modulation (\subfigrefb{fig:data_overview_mod}{C}) a negative correlation is observed showing that cells that are strongly driven by the stimulus show less nonlinearity while those that are only weakly driven show higher nonlinearities. Whether or not a cell responds nonlinearly thus depends on both, the baseline CV (i.e. the internal noise) and the response strength.
|
||||
%(Pearson's $r=-0.35$, $p<0.001$)
|
||||
The nonlinear effects shown for single cell examples above are supported by the analysis of the pool of 222 P-units and 47 ampullary afferents recorded in 71 specimen. To compare across cells we expressed the second-order susceptibility as the nonlinearity index \nli{}, see \Eqnref{eq:nli_equation}. The \nli{} characterizes the peakedness of the projections onto the diagonal of the \suscept{} matrices (e.g. \subfigref{fig:cells_suscept}{G} at \fbase{}). It assumes high values when the \fbase{} peak in the projected diagonal is pronounced relative to the median of the diagonal and is small when there is no distinct peak. The P-unit population \nli{} values depend weakly on the CV of the ISI distribution under baseline condition. Cells with lower baseline CVs have the tendency to exhibit a stronger nonlinearity than those that have high CVs during baseline (\subfigrefb{fig:data_overview_mod}{A}) or during stimulation (\subfigrefb{fig:data_overview_mod}{C}) . The two example P-units shown before (\figrefb{fig:cells_suscept} and \figrefb{fig:cells_suscept_high_CV}) are highlighted with dark circles in \subfigrefb{fig:data_overview_mod}{A, C, E}. The stimulus strength plays an important role. Several of the recorded neurons contribute with two dots to the data as their responses to the same RAM stimulus but with different contrasts were recorded. Higher stimulus contrasts lead to a stronger drive and thus stronger response modulations (see color code bar in \subfigref{fig:data_overview_mod}{A}, see methods). Since P-units are heterogeneous in their susceptibility to the stimulus\cite{Grewe2017}, their responses to the same stimulus intensity vary a lot. When replotting the \nli{} against the response modulation (\subfigrefb{fig:data_overview_mod}{E}) a negative correlation is observed showing that cells that are strongly driven by the stimulus show less nonlinearity while those that are only weakly driven show higher nonlinearities. Whether or not a cell responds nonlinearity thus depends on both, the baseline CV (i.e. the internal noise) and the response strength.
|
||||
%(Pearson's $r=-0.35$, $p<0.001$)222 P-units and 47 (Pearson's $r=-0.16$, $p<0.01$)
|
||||
%In a P-unit population where each cell is represented not by several contrasts but by the lowest recorded contrast, \nli{} significantly correlates with the CV during baseline ($r=-0.17$, $p=0.01$), the response modulation ($r=-0.35$, $p<0.001$) and \fbase{} ($r=-0.32$, $p<0.001$).%, $\n{}=221$*, $\n{}=221$******, $\n{}=221$
|
||||
|
||||
The population of ampullary cells is generally more homogeneous and have lower CVs than the P-units and show much higher \nli{} values (factor of 10). Overall, there is a negative correlation with the baseline CV. The example cell shown above (\figref{ampullary}) was recorded at two different stimulus intensities and the \nli{}s are highlighted with black circles. Again, we see that cells that are strongly driven by the stimulus cluster at the bottom of the distribution and have \nli{} values close to zero (\subfigrefb{fig:data_overview_mod}{B}). This is confirmed when the data is replotted against the response modulation, those cells that are strongly driven by the stimulus show weak nonlinearities while weakly driven neurons exhibit high values (\subfigrefb{fig:data_overview_mod}{D}).
|
||||
The population of ampullary cells is generally more homogeneous and have lower CVs than the P-units and show much higher \nli{} values (factor of 10). Overall, there is a negative correlation with the baseline CV. The example cell shown above (\figref{ampullary}) was recorded at two different stimulus intensities and the \nli{}s are highlighted with black circles. Again, we see that cells that are strongly driven by the stimulus cluster at the bottom of the distribution and have \nli{} values close to zero (\subfigrefb{fig:data_overview_mod}{B, D}). This is confirmed when the data is replotted against the response modulation, those cells that are strongly driven by the stimulus show weak nonlinearities while weakly driven neurons exhibit high values (\subfigrefb{fig:data_overview_mod}{F}).
|
||||
|
||||
%(Pearson's $r=-0.35$, $p < 0.01$) (Pearson's $r=-0.59$, $p < 0.0001$)
|
||||
|
||||
@ -635,7 +635,7 @@ auditory nerve fibers and such nonlinear effects might also be expected in the a
|
||||
\subsection*{Experimental subjects and procedures}
|
||||
|
||||
Within this project we re-evaluated datasets that were recorded between 2010 and 2023 at the Ludwig Maximilian University (LMU) M\"unchen and the Eberhard-Karls University T\"ubingen. All experimental protocols complied with national and European law and were approved by the respective Ethics Committees of the Ludwig-Maximilians Universität München (permit no. 55.2-1-54-2531-135-09) and the Eberhard-Karls Unversität Tübingen (permit no. ZP 1/13 and ZP 1/16).
|
||||
The final sample consisted of 221 P-units and 45 ampullary electroreceptor afferents recorded in 71 weakly electric fish of the species \lepto{}. The original electrophysiological recordings were performed on male and female weakly electric fish of the species \lepto{} that were obtained from a commercial supplier for tropical fish (Aquarium Glaser GmbH, Rodgau,
|
||||
The final sample consisted of 222 P-units and 47 ampullary electroreceptor afferents recorded in 71 weakly electric fish of the species \lepto{}. The original electrophysiological recordings were performed on male and female weakly electric fish of the species \lepto{} that were obtained from a commercial supplier for tropical fish (Aquarium Glaser GmbH, Rodgau,
|
||||
Germany). The fish were kept in tanks with a water temperature of $25\pm1\,^\circ$C and a conductivity of around $270\,\micro\siemens\per\centi\meter$ under a 12\,h:12\,h light-dark cycle.
|
||||
|
||||
Before surgery, the animals were deeply anesthetized via bath application with a solution of MS222 (120\,mg/l, PharmaQ, Fordingbridge, UK) buffered with Sodium Bicarbonate (120\,mg/l). The posterior anterior lateral line nerve (pALLN) was exposed by making a small cut into the skin covering the nerve. The cut was placed dorsal of the operculum just before the nerve descends towards the anterior lateral line ganglion (ALLNG). Those parts of the skin that were to be cut were locally anesthetized by cutaneous application of liquid lidocaine hydrochloride (20\,mg/ml, bela-pharm GmbH). During the surgery water supply was ensured by a mouthpiece to maintain anesthesia with a solution of MS222 (100\,mg/l) buffered with Sodium Bicarbonate (100\,mg/l). After surgery fish were immobilized by intramuscular injection of from 25\,$\micro$l to 50\,$\micro$l of tubocurarine (5\,mg/ml dissolved in fish saline; Sigma-Aldrich).
|
||||
|
BIN
trialnr.pdf
BIN
trialnr.png
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
43
trialnr.py
@ -101,6 +101,10 @@ def trialnr(eod_metrice = False, width=0.005, nffts=['whole'], powers=[1], cells
|
||||
perc95 = []
|
||||
perc05 = []
|
||||
median = []
|
||||
stacks_wo_norm = []
|
||||
perc95_wo_norm = []
|
||||
perc05_wo_norm = []
|
||||
median_wo_norm = []
|
||||
|
||||
for tr in trial_nrs_here:
|
||||
save_names = [
|
||||
@ -133,32 +137,61 @@ def trialnr(eod_metrice = False, width=0.005, nffts=['whole'], powers=[1], cells
|
||||
#
|
||||
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)
|
||||
model_show, stack_plot, stack_plot_wo_norm = 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))
|
||||
stacks_wo_norm.append(stack_plot_wo_norm)
|
||||
perc95_wo_norm.append(np.percentile(stack_plot_wo_norm,95))
|
||||
perc05_wo_norm.append(np.percentile(stack_plot_wo_norm, 5))
|
||||
median_wo_norm.append(np.percentile(stack_plot_wo_norm, 50))
|
||||
|
||||
else:
|
||||
stacks.append([])
|
||||
perc95.append(float('nan'))
|
||||
perc05.append(float('nan'))
|
||||
median.append(float('nan'))
|
||||
|
||||
stacks_wo_norm.append([])
|
||||
perc95_wo_norm.append(float('nan'))
|
||||
perc05_wo_norm.append(float('nan'))
|
||||
median_wo_norm.append(float('nan'))
|
||||
|
||||
ax = plt.subplot(1,1,1)
|
||||
ax.plot(trial_nrs_here, perc05, color = 'grey')
|
||||
ax.plot(trial_nrs_here, perc95, color = 'grey')
|
||||
ax.plot(trial_nrs_here, median, color = 'black', label = 'median')
|
||||
ax.fill_between(trial_nrs_here, perc05, perc95, color='grey')
|
||||
ax.scatter(trial_nrs_here, median, color='black', label='measured points')
|
||||
|
||||
ax.set_xscale('log')
|
||||
ax.set_yscale('log')
|
||||
|
||||
ax.set_xlabel('Trials')
|
||||
ax.set_ylabel('$\chi_{2}$\,[Hz]')
|
||||
|
||||
''' ax = plt.subplot(1,3,2)
|
||||
ax.plot(trial_nrs_here, perc05_wo_norm, color = 'grey')
|
||||
ax.plot(trial_nrs_here, perc95_wo_norm, color = 'grey')
|
||||
ax.plot(trial_nrs_here, median_wo_norm, color = 'black', label = 'median')
|
||||
ax.fill_between(trial_nrs_here, perc05_wo_norm, perc95_wo_norm, color='grey')
|
||||
#ax.scatter(trial_nrs_here, median, color='black', label='measured points')
|
||||
|
||||
ax = plt.subplot(1,3,3)
|
||||
ax.plot(trial_nrs_here, perc05_wo_norm, color = 'grey')
|
||||
ax.plot(trial_nrs_here, perc95_wo_norm, color = 'grey')
|
||||
ax.plot(trial_nrs_here, median_wo_norm, color = 'black', label = 'median')
|
||||
ax.fill_between(trial_nrs_here, perc05_wo_norm, perc95_wo_norm, color='grey')
|
||||
#ax.scatter(trial_nrs_here, median, color='black', label='measured points')
|
||||
|
||||
|
||||
|
||||
ax.legend()
|
||||
ax.set_xscale('log')
|
||||
ax.set_yscale('log')
|
||||
|
||||
ax.set_xlabel('Trial nr')
|
||||
ax.set_ylabel('$\chi_{2}$\,[Hz]')
|
||||
plt.subplots_adjust(left = 0.1, right = 0.9, bottom = 0.2)
|
||||
'''
|
||||
plt.subplots_adjust(left = 0.1, right = 0.9, bottom = 0.2, top = 0.95)
|
||||
#plt.set_scale
|
||||
#embed()
|
||||
#embed()
|
||||
|
@ -3369,76 +3369,7 @@ def RAM_norm_data(D_c_sig, stack_plot, trials_stim, abs=True, power=2, stack_her
|
||||
print('isf thing')
|
||||
embed()
|
||||
|
||||
##############################################
|
||||
# das ist ein power spectrum, ich nehme die Snippets und für jedes machen wir |fft|**2 und dann mitteln wir
|
||||
# daraus generieren wir im nächsten Schritt die Werte
|
||||
# also richtig ist es wenn power 2 ist
|
||||
|
||||
# todo: das mit den zweien noch überprüfen
|
||||
# also analog zu dem oberen muss hier wohl das noch mal zwei genommen werden
|
||||
# Die zwei da in norm_power ist richtig
|
||||
# das stimmt schon so
|
||||
# also hier mitteln wir über die power spectra
|
||||
# die beiden scheinen das gleiche zu machen aber wir können das auch so rum machen
|
||||
isf_mean = np.mean((np.abs(isf)) ** power, axis=0)
|
||||
# isf = get_isfs(stack_here)
|
||||
isf_mean = np.mean(isf * np.conj(isf), axis=0)
|
||||
# embed()
|
||||
# isf_mean = np.mean((2 * np.abs(isf)) ** power, axis=0)
|
||||
|
||||
norm_char2 = norm_power(isf_mean, stack_here, power=power)
|
||||
# norm_char2 = norm_power(isf_mean, stack_here)
|
||||
# norm_char22_dived = find_norm_susept(stack_here, isf_mean[f_range])
|
||||
# norm_char2 = 1 / norm_char22_dived
|
||||
# mats_all_here / norm_char2
|
||||
|
||||
# stack_here.isf
|
||||
# stack_here.freqs
|
||||
# stack_here.snippets #
|
||||
# f, restrict = restrict_freqs(f_orig, max_f)
|
||||
# norm_factor = 2*np.dot(D_c_sig[0])
|
||||
# stack_plot = ((np.abs((stack_plot) * norm)) ** power / trials_stim) #
|
||||
# stack_plot = ((np.abs((stack_plot) * norm)) ** 1 / trials_stim) #
|
||||
# mat_to_div = stack_here[keys[keys < ends_nr[e]]]
|
||||
# mat_to_div = mat_to_div.loc[mat_to_div.index < ends_nr[e]]
|
||||
|
||||
if abs: # DEFAULT! IMMER WAHR
|
||||
mat_complex = np.abs((stack_plot.astype('complex')))
|
||||
else:
|
||||
mat_complex = (stack_plot.astype('complex'))
|
||||
|
||||
reload = False
|
||||
# embed()
|
||||
stim_len = float(stack_here.nfft.iloc[0].split('sec')[0])
|
||||
if reload: # with the reload we can test if the presaved matrices are reproducable by the sole formula (they are)
|
||||
deltat = 1 / stack_here.sampling.iloc[0]
|
||||
osf = get_isfs(stack_here, isf_name='osf')
|
||||
scales, cross_norm, f_mat2, mats_all_here_orig, mats_all_here_norm, norm_char3 = find_norm_compars(isf,
|
||||
isf_mean,
|
||||
osf,
|
||||
deltat,
|
||||
stack_plot)
|
||||
# mat_cut = norm_char3[0:len(stack_plot), 0:len(stack_plot)]
|
||||
mats_all_here = pd.DataFrame(np.abs(mats_all_here_orig) * stim_len, index=mat_complex.index,
|
||||
columns=mat_complex.columns)
|
||||
|
||||
else:
|
||||
mats_all_here = (mat_complex * stim_len) / (trials_stim)
|
||||
# embed()
|
||||
|
||||
mat_cut = norm_char2[0:len(stack_plot), 0:len(stack_plot)]
|
||||
|
||||
test = False
|
||||
if test:
|
||||
test_complex()
|
||||
# todo:hier stimmt halt nochwas nicht
|
||||
# todo: hier noch die 0.5 sekunden einabuen
|
||||
# embed()
|
||||
try:
|
||||
stack_plot = mats_all_here / (mat_cut) # norm_char2
|
||||
except:
|
||||
print('stack something')
|
||||
embed()
|
||||
stack_plot = norm_suscept_whole(abs, isf, stack_here, stack_plot, trials_stim, power)
|
||||
|
||||
test = False
|
||||
if test:
|
||||
@ -3450,6 +3381,78 @@ def RAM_norm_data(D_c_sig, stack_plot, trials_stim, abs=True, power=2, stack_her
|
||||
return stack_plot
|
||||
|
||||
|
||||
def norm_suscept_whole(abs, isf, stack_here, stack_plot, trials_stim, power=2):
|
||||
mat_cut, mats_all_here = norm_suscept(abs, isf, stack_here, stack_plot, trials_stim, power)
|
||||
test = False
|
||||
if test:
|
||||
test_complex()
|
||||
# todo:hier stimmt halt nochwas nicht
|
||||
# todo: hier noch die 0.5 sekunden einabuen
|
||||
# embed()
|
||||
try:
|
||||
stack_plot = mats_all_here / (mat_cut) # norm_char2
|
||||
except:
|
||||
print('stack something')
|
||||
embed()
|
||||
return stack_plot
|
||||
|
||||
|
||||
def norm_suscept(abs, isf, stack_here, stack_plot, trials_stim, power=2):
|
||||
##############################################
|
||||
# das ist ein power spectrum, ich nehme die Snippets und für jedes machen wir |fft|**2 und dann mitteln wir
|
||||
# daraus generieren wir im nächsten Schritt die Werte
|
||||
# also richtig ist es wenn power 2 ist
|
||||
# todo: das mit den zweien noch überprüfen
|
||||
# also analog zu dem oberen muss hier wohl das noch mal zwei genommen werden
|
||||
# Die zwei da in norm_power ist richtig
|
||||
# das stimmt schon so
|
||||
# also hier mitteln wir über die power spectra
|
||||
# die beiden scheinen das gleiche zu machen aber wir können das auch so rum machen
|
||||
isf_mean = np.mean((np.abs(isf)) ** power, axis=0)
|
||||
# isf = get_isfs(stack_here)
|
||||
isf_mean = np.mean(isf * np.conj(isf), axis=0)
|
||||
# embed()
|
||||
# isf_mean = np.mean((2 * np.abs(isf)) ** power, axis=0)
|
||||
norm_char2 = norm_power(isf_mean, stack_here, power=power)
|
||||
# norm_char2 = norm_power(isf_mean, stack_here)
|
||||
# norm_char22_dived = find_norm_susept(stack_here, isf_mean[f_range])
|
||||
# norm_char2 = 1 / norm_char22_dived
|
||||
# mats_all_here / norm_char2
|
||||
# stack_here.isf
|
||||
# stack_here.freqs
|
||||
# stack_here.snippets #
|
||||
# f, restrict = restrict_freqs(f_orig, max_f)
|
||||
# norm_factor = 2*np.dot(D_c_sig[0])
|
||||
# stack_plot = ((np.abs((stack_plot) * norm)) ** power / trials_stim) #
|
||||
# stack_plot = ((np.abs((stack_plot) * norm)) ** 1 / trials_stim) #
|
||||
# mat_to_div = stack_here[keys[keys < ends_nr[e]]]
|
||||
# mat_to_div = mat_to_div.loc[mat_to_div.index < ends_nr[e]]
|
||||
if abs: # DEFAULT! IMMER WAHR
|
||||
mat_complex = np.abs((stack_plot.astype('complex')))
|
||||
else:
|
||||
mat_complex = (stack_plot.astype('complex'))
|
||||
reload = False
|
||||
# embed()
|
||||
stim_len = float(stack_here.nfft.iloc[0].split('sec')[0])
|
||||
if reload: # with the reload we can test if the presaved matrices are reproducable by the sole formula (they are)
|
||||
deltat = 1 / stack_here.sampling.iloc[0]
|
||||
osf = get_isfs(stack_here, isf_name='osf')
|
||||
scales, cross_norm, f_mat2, mats_all_here_orig, mats_all_here_norm, norm_char3 = find_norm_compars(isf,
|
||||
isf_mean,
|
||||
osf,
|
||||
deltat,
|
||||
stack_plot)
|
||||
# mat_cut = norm_char3[0:len(stack_plot), 0:len(stack_plot)]
|
||||
mats_all_here = pd.DataFrame(np.abs(mats_all_here_orig) * stim_len, index=mat_complex.index,
|
||||
columns=mat_complex.columns)
|
||||
|
||||
else:
|
||||
mats_all_here = (mat_complex * stim_len) / (trials_stim)
|
||||
# embed()
|
||||
mat_cut = norm_char2[0:len(stack_plot), 0:len(stack_plot)]
|
||||
return mat_cut, mats_all_here
|
||||
|
||||
|
||||
def norm_power(isf_mean, stack_here, power=2):
|
||||
f_range = np.arange(len(stack_here))
|
||||
power_isf_1, power_isf_2 = find_isf_matrices(stack_here, isf_mean[f_range])
|
||||
@ -4187,7 +4190,10 @@ def calc_base_reclassification(names: object = ['calc_base/calc_base_data-base_f
|
||||
'2022-02-08-ao-invivo-1': ' P-unit',
|
||||
'2022-02-08-aj-invivo-1': ' Pyramidal',
|
||||
'2022-02-10-ad-invivo-1': ' P-unit_problem',
|
||||
} #
|
||||
|
||||
} # '2018-08-14-af-invivo-1': ' P-unit_problem',
|
||||
#'2018-09-05-aj-invivo-1': ' P-unit_problem',
|
||||
#'2022-01-08-ah-invivo-1': ' P-unit_problem'todo: die letzten drei habe ich ausgeschlossen weil da etwas mit cv_stim nicht stimmt!
|
||||
# '2018-09-06-aq-invivo-1': ' P-unit_problem','2022-01-27-aa-invivo-1': Ok das doch rausnhemen einfach ein viel zu hoher CV!!!! '2013-04-16-ag-invivo-1'' P-unit_problem','2013-04-16-ag-invivo-1': ' P-unit_problem',
|
||||
for cell_change in cells_changed:
|
||||
indeces = frame[frame['cell'] == cell_change].index # ['cell_type_reclassified'] = [' Ampullary']*2
|
||||
@ -5543,7 +5549,7 @@ def load_cv_vals_susept(cells, names_keep=[], EOD_type='', path_sp='/calc_base_d
|
||||
frame_sp = load_cv_table(path_spikes)
|
||||
frame_spikes = frame_sp[frame_sp.cell.isin(cells)]
|
||||
# frame_spikes = frame_sp[frame_sp.cell.isin(cells)]
|
||||
# embed()
|
||||
#embed()
|
||||
keys_keep = frame.keys()[frame.memory_usage(index=False, deep=True) < 1000000]
|
||||
if names_keep == 'all':
|
||||
frame = frame[keys_keep]
|
||||
@ -9877,7 +9883,11 @@ def chose_mat_max_value(DF1_desired, DF2_desired, extract, mult_type, eodftype,
|
||||
try:
|
||||
DF1_desired = DF1_desired_here.iloc[np.argsort(np.abs(DF1_desired_here - (DF1_desired/df_contrast.EODf+1)))]
|
||||
except:
|
||||
DF1_desired = DF1_desired_here[np.argsort(np.abs(DF1_desired_here - (DF1_desired / df_contrast.EODf + 1)))]
|
||||
try:
|
||||
DF1_desired = DF1_desired_here[np.argsort(np.abs(DF1_desired_here - (DF1_desired / df_contrast.EODf + 1)))]
|
||||
except:
|
||||
print('df something')
|
||||
embed()
|
||||
try:
|
||||
DF2_desired = DF2_desired_here.iloc[np.argsort(np.abs(DF2_desired_here - (DF2_desired / df_contrast.EODf + 1)))]
|
||||
except:
|
||||
@ -11468,10 +11478,14 @@ def p_units_to_show(type_here='intro'):
|
||||
amp_ii, ]
|
||||
#
|
||||
# burst_cells[0], ,good_punits[0] '2010-08-27-ag-invivo-1''2010-06-21-av-invivo-1',
|
||||
elif type_here == 'intro_simple':
|
||||
elif type_here == 'intro_simple':#'2022-01-28-ad-invivo-1'
|
||||
cells_plot2 = [l_cv_ii]
|
||||
#
|
||||
# burst_cells[0], ,good_punits[0] '2010-08-27-ag-invivo-1''2010-06-21-av-invivo-1',
|
||||
elif type_here == 'intro_simple2':#'2022-01-28-ad-invivo-1'
|
||||
cells_plot2 = [l_cv_ii,b3]
|
||||
#
|
||||
# burst_cells[0], ,good_punits[0] '2010-08-27-ag-invivo-1''2010-06-21-av-invivo-1',
|
||||
elif type_here == 'contrasts':
|
||||
cells_plot2 = [l_cv,
|
||||
h_cv]
|
||||
@ -13033,8 +13047,7 @@ def setting_overview_score(frame, cell_type_here=' P-unit', burst_lim=-99, snipp
|
||||
frame_loaded = fname_with_smalles_amp(frame_loaded)
|
||||
|
||||
elif min_amp == 'range':
|
||||
# todo: das ist halt noch falsch implementiert
|
||||
frame_loaded = fname_with_smalles_big_amp(frame_loaded)
|
||||
frame_loaded = fname_with_range(frame_loaded)
|
||||
|
||||
#embed()
|
||||
test = False
|
||||
@ -13085,7 +13098,7 @@ def fname_amp_diff(cv_base, frame_loaded, score):
|
||||
return cvs, resp_diffs, score_diffs, cells
|
||||
|
||||
|
||||
def fname_with_smalles_big_amp(frame_loaded):
|
||||
def fname_with_range(frame_loaded):
|
||||
file_name1 = True
|
||||
cut_offs_all = []
|
||||
drops = 0
|
||||
@ -13093,6 +13106,15 @@ def fname_with_smalles_big_amp(frame_loaded):
|
||||
frame_loaded = frame_loaded.reset_index()
|
||||
except:
|
||||
print('no reset necessary')
|
||||
|
||||
#embed()#frame_loaded['max(diag5Hz)/med_diagonal_proj_fr']
|
||||
if 'level_0' in frame_loaded.keys():
|
||||
frame_loaded = frame_loaded.dropna(axis = 1, how = 'all')
|
||||
frame_loaded = frame_loaded.drop('level_0', axis=1)
|
||||
frame_loaded = frame_loaded.drop('index', axis=1)
|
||||
frame_loaded = frame_loaded.drop_duplicates()
|
||||
|
||||
#dublicates
|
||||
fil = []
|
||||
fil_true = []
|
||||
for c, cell in enumerate(np.array(np.unique(frame_loaded.cell))):
|
||||
@ -13100,12 +13122,14 @@ def fname_with_smalles_big_amp(frame_loaded):
|
||||
if len(fil[-1]) > 1:
|
||||
fil_true.append(True)
|
||||
cut_offs = []
|
||||
arg = np.argmin(fil[-1])
|
||||
argmin = np.argmin(fil[-1])
|
||||
argmax = np.argmax(fil[-1])
|
||||
file_to_cick = fil[-1][arg]
|
||||
file_to_cick = fil[-1][argmin]
|
||||
file_to_cickmax = fil[-1][argmax]
|
||||
# todo: as hier noch einbaune damit jede Zelle das maximal einmal hat
|
||||
file_cell = frame_loaded[frame_loaded.cell == cell]
|
||||
#if len(file_cell) > 2:
|
||||
# print('double cells')
|
||||
# embed()
|
||||
drop_idx = file_cell[(file_cell.amp != file_to_cick) & (file_cell.amp != file_to_cickmax)].index # [arg]
|
||||
drops += len(drop_idx)
|
||||
# embed()
|
||||
|
579
utils_paper.py
@ -1,5 +1,6 @@
|
||||
import ast
|
||||
import csv
|
||||
import time
|
||||
import warnings
|
||||
|
||||
import numpy
|
||||
@ -14,6 +15,9 @@ from thunderfish.eventdetection import hist_threshold
|
||||
#from utils_all import feature_extract, get_data_array_names, get_sampling, link_arrays_eod
|
||||
#from utils_all_down import load_folder_name
|
||||
#from utils_all import bolzmann
|
||||
from random import randint, sample
|
||||
|
||||
#from utils_all import correct_burstiness, find_tags_list, get_data_array_names, link_arrays_eod, link_arrays_spikes
|
||||
|
||||
warnings.filterwarnings("ignore", message="WARNING:root:MultiTag type relacs.stimulus.segment")
|
||||
from scipy import optimize, stats
|
||||
@ -2838,7 +2842,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):
|
||||
model_show, stack_plot = get_stack(cell, model)
|
||||
model_show, stack_plot, stack_plot_wo_norm = get_stack(cell, model)
|
||||
if resize:
|
||||
stack_plot, add_nonlin_title, resize_val = rescale_colorbar_and_values(stack_plot)
|
||||
else:
|
||||
@ -2890,9 +2894,9 @@ def get_stack(cell, model):
|
||||
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
|
||||
stack_plot_wo_norm = change_model_from_csv_to_plots(model_show)
|
||||
stack_plot = RAM_norm(stack_plot_wo_norm, model_show=model_show)
|
||||
return model_show, stack_plot, stack_plot_wo_norm
|
||||
|
||||
|
||||
#[1, 0, 0][1, 0, 0.4]
|
||||
@ -4260,10 +4264,10 @@ def find_eod(frame_cell, EOD='EOD', sp=0):
|
||||
|
||||
def plt_psds_in_one_squares_next(aa, add, amp, amps_defined, axds, axes, axis, axos, c, cells_plot, colors_b, eod_fr,
|
||||
file_name, grid_s1, ims, load_name, save_names, stack_file, wss, xlim = [], test_clim=False,
|
||||
power_type=False, peaks_extra=False, zorder=1, alpha=1, extra_input=False, fr=None,
|
||||
power_type=False, permuted = False, peaks_extra=False, zorder=1, alpha=1, extra_input=False, fr=None,
|
||||
title_square='', fr_diag = None, nr = 1, line_length=1 / 4, text_scalebar=False, xpos_xlabel=-0.2,
|
||||
add_nonlin_title=None,amp_give = True, color='grey', log_transfer=False, axo2=None, axd2=None,
|
||||
axi=None,eod_metrice = True, color_same = True, iterate_var=[0, 1], normval = 1):
|
||||
axi=None,eod_metrice = True, base_extra = False, color_same = True, iterate_var=[0, 1], normval = 1):
|
||||
# if aa == 0:
|
||||
if not fr_diag:
|
||||
fr_diag = fr
|
||||
@ -4279,15 +4283,19 @@ def plt_psds_in_one_squares_next(aa, add, amp, amps_defined, axds, axes, axis, a
|
||||
|
||||
test_limits = False
|
||||
norm_d = False
|
||||
new_keys, stack_plot = convert_csv_str_to_float(stack_final)
|
||||
|
||||
#embed()
|
||||
|
||||
new_keys, stack_plot = convert_csv_str_to_float(stack_final)
|
||||
|
||||
mat = RAM_norm_data(stack_final['isf'].iloc[0], stack_plot,
|
||||
stack_final['snippets'].unique()[0], stack_here=stack_final) #
|
||||
|
||||
|
||||
mat, add_nonlin_title, resize_val = rescale_colorbar_and_values(mat, add_nonlin_title=add_nonlin_title)
|
||||
|
||||
axis_d = axis_projection(mat, axis='')
|
||||
|
||||
|
||||
if power_type:
|
||||
axd, _, axo2 = plt_psds_all(axd2, axo2, aa, c, cells_plot, mat,
|
||||
stack_final, stack_osf, test_limits, xlim,
|
||||
@ -4299,7 +4307,10 @@ def plt_psds_in_one_squares_next(aa, add, amp, amps_defined, axds, axes, axis, a
|
||||
# das ist jetzt die default version
|
||||
# plot the diagonal
|
||||
|
||||
xmax, xmin, diagonals_prj_l = plt_diagonal(alpha, axd2, color, 'db', eod_fr, fr_diag, mat, peaks_extra, xlim, zorder, color_same = color_same,normval = normval)
|
||||
db_diag = 'db'#
|
||||
xmax, xmin, diagonals_prj_l = plt_diagonal(alpha, axd2, color, db_diag, eod_fr, fr_diag, mat, peaks_extra, xlim, zorder, color_same = color_same,normval = normval)
|
||||
|
||||
|
||||
|
||||
# print('transfer function now')
|
||||
|
||||
@ -4312,7 +4323,95 @@ def plt_psds_in_one_squares_next(aa, add, amp, amps_defined, axds, axes, axis, a
|
||||
f = find_f(stack_final)
|
||||
#f_axis = f[0:len(isf.iloc[0][0])]
|
||||
axo2.set_xlim(xmin, xmax/2)
|
||||
#
|
||||
|
||||
|
||||
###########################################
|
||||
# permutation part
|
||||
# do the reshuffling
|
||||
#permuted = True
|
||||
if permuted:
|
||||
isfs = get_isfs(stack_final, isf_name='isf')
|
||||
osfs = get_isfs(stack_final, isf_name='osf')
|
||||
|
||||
deltat = 1 / stack_final.sampling.iloc[0]
|
||||
f_range = np.arange(len(stack_final))
|
||||
# ranges = range
|
||||
mats_all = []
|
||||
mats_all_correct = []
|
||||
isfs_correct = []
|
||||
isfs_all = []
|
||||
for t in range(len(osfs)):
|
||||
for tt in range(len(osfs)):
|
||||
print('t' + str(t) + ' tt' + str(tt))
|
||||
f_mat1, f_mat2, f_idx_sum, mat_all = fft_matrix(deltat, osfs[t], f_range, isfs[tt],
|
||||
norm='') # stimulus,
|
||||
|
||||
|
||||
if t != tt:
|
||||
|
||||
# f_mat1, f_mat2, f_idx_sum, cross_norm = fft_matrix(deltat, osfs[t], f_range, isfs[tt]) # stimulus,
|
||||
mats_all.append(mat_all)
|
||||
isfs_all.append(isfs[tt])
|
||||
else:
|
||||
mats_all_correct.append(mat_all)
|
||||
isfs_correct.append(isfs[tt])
|
||||
|
||||
#########################
|
||||
# the corrected matrices
|
||||
mats_all_correct = np.array(mats_all_correct)
|
||||
mats_all_correct2 = np.sum(np.array(mats_all_correct), axis=0)
|
||||
# embed()
|
||||
#mat_cut, mats_all_correct2 = norm_suscept(abs, isfs_correct, stack_final, mats_all_correct2, len(isfs_correct))
|
||||
mats_all_correct2 = norm_suscept_whole(abs, isfs_correct, stack_final, mats_all_correct2, len(isfs_correct))
|
||||
mats_all_correct2, add_nonlin_title, resize_val = rescale_colorbar_and_values(mats_all_correct2,
|
||||
add_nonlin_title=add_nonlin_title)
|
||||
|
||||
diag, diagonals_prj_l_test = get_mat_diagonals(mats_all_correct2)
|
||||
if db_diag == 'db':
|
||||
diagonals_prj_l_test = 10 * np.log10(diagonals_prj_l_test) # / maxd
|
||||
|
||||
#nrs = np.arange(np.shape(mats_all)[1])
|
||||
# combinations = list(np.array(it.combinations(nrs,20)))
|
||||
# embed()
|
||||
# random_numbers = [randint(1, len(mats_all)) for _ in range(20)]
|
||||
# embed()
|
||||
#################
|
||||
# the permuted matrices
|
||||
mats_all = np.array(mats_all)
|
||||
lists = []
|
||||
diags_permuted = []
|
||||
isfs_all = np.array(isfs_all)
|
||||
for i in range(300):
|
||||
# print(ii)
|
||||
# lists.append(i)
|
||||
random_numbers = sample(range(1, len(mats_all)), 20)
|
||||
mean_matrix = np.sum(mats_all[random_numbers], axis=0)
|
||||
#mat_cut, mean_matrix2 = norm_suscept(abs, isfs_correct, stack_final, mean_matrix, len(isfs_correct))
|
||||
#embed()
|
||||
#isfs_all[random_numbers]
|
||||
mean_matrix2 = norm_suscept_whole(abs, isfs_all[random_numbers], stack_final, mean_matrix, len(isfs_correct))
|
||||
|
||||
mean_matrix2, add_nonlin_title, resize_val = rescale_colorbar_and_values(mean_matrix2,
|
||||
add_nonlin_title=add_nonlin_title)
|
||||
|
||||
diag, diagonals_prj_l_perm = get_mat_diagonals(np.array(mean_matrix2))
|
||||
if db_diag == 'db':
|
||||
diagonals_prj_l_perm = 10 * np.log10(diagonals_prj_l_perm)
|
||||
diags_permuted.append(diagonals_prj_l_perm)
|
||||
|
||||
diags_perm = np.transpose(diags_permuted)
|
||||
#embed()
|
||||
#plt.close()
|
||||
#axd2.plot(axis_d, diags_perm, color='lightgrey')
|
||||
#plt.plot(axis_d, diagonals_prj_l_test, color='black', linewidth = 1)
|
||||
#axd2.plot(axis_d, diagonals_prj_l, color='red', linewidth = 0.5)
|
||||
axd2.plot(axis_d, np.percentile(diags_perm, 95, axis=1), color='darkgrey')
|
||||
axd2.plot(axis_d, np.percentile(diags_perm, 5, axis=1), color='darkgrey')
|
||||
|
||||
#embed()
|
||||
# els = [list(x) for x in it.combinations(nrs,20)]
|
||||
|
||||
#
|
||||
#embed()
|
||||
|
||||
########################################
|
||||
@ -4338,7 +4437,7 @@ def plt_psds_in_one_squares_next(aa, add, amp, amps_defined, axds, axes, axis, a
|
||||
#embed()
|
||||
mat, test_limits, im, add_nonlin_title = plt_square_here(aa, amp, amps_defined, ax_square, c, cells_plot, ims,
|
||||
stack_final1, [], perc=False, cbar_true=cbar_true, xpos=0, ypos=1.05,
|
||||
color=color,fr = fr, eod_metrice = eod_metrice, nr = nr, amp_give = amp_give, title_square = title_square, line_length = line_length, ha='left',xpos_xlabel = xpos_xlabel , alpha=alpha, add_nonlin_title = add_nonlin_title )
|
||||
color=color,fr = fr, base_extra = base_extra, eod_metrice = eod_metrice, nr = nr, amp_give = amp_give, title_square = title_square, line_length = line_length, ha='left',xpos_xlabel = xpos_xlabel , alpha=alpha, add_nonlin_title = add_nonlin_title )
|
||||
|
||||
ims.append(im)
|
||||
|
||||
@ -4784,7 +4883,7 @@ def burst_data(plus=1, ax3=[], xlim=[], burst_corr='_burst_corr_individual'):
|
||||
def plt_cellbody_eigen(grid1, frame, amps_desired, save_names, cells_plot, cell_type_type, plus=1, ax3=[], xlim=[],
|
||||
burst_corr='_burst_corr_individual',
|
||||
titles=['Baseline \n Susceptibility', 'Half EODf \n Susceptibility'],
|
||||
peaks_extra=[False, False, False]):
|
||||
peaks_extra=[False, False, False], base_extra = False):
|
||||
colors = colors_overview()
|
||||
# axos = []
|
||||
axis = []
|
||||
@ -5011,7 +5110,7 @@ def plt_cellbody_eigen(grid1, frame, amps_desired, save_names, cells_plot, cell_
|
||||
ax_p = plt.subplot(grid_p[1])
|
||||
#embed()
|
||||
ax_isi = base_cells_susept(ax_isi, ax_p, c, cell, cell_type, cells_plot, colors, eod_fr, frame,
|
||||
isi, right, spikes_base, stack,xlim,texts_left = [90,0],titles = titles, peaks = True, xlim_i = [0, 4])
|
||||
isi, right, spikes_base, stack,xlim,base_extra = base_extra,texts_left = [90,0],titles = titles, peaks = True, xlim_i = [0, 4])
|
||||
|
||||
#ax_isi.set_title(titles[c], color=colors[str(cell_type)])
|
||||
#remove_xticks(ax_p)
|
||||
@ -5046,9 +5145,9 @@ def plt_cellbody_eigen(grid1, frame, amps_desired, save_names, cells_plot, cell_
|
||||
|
||||
# plt_cellbody_singlecell
|
||||
def plt_cellbody_singlecell(grid1, frame, amps_desired, save_names, cells_plot, cell_type_type, plus=1, ax3=[], xlim=[],
|
||||
burst_corr='_burst_corr_individual', RAM=True,isi_delta = None,
|
||||
burst_corr='_burst_corr_individual', permuted = False, RAM=True,isi_delta = None,
|
||||
titles=['Low CV P-unit', 'High CV P-unit', 'Ampullary cell'],
|
||||
peaks_extra=[False, False, False], color_same = True, fr_name = '$f_{Base}$', eod_metrice = True, tags_individual = False, xlim_p = [0,1.1], add_texts = [0.25,0], scale_val = False):
|
||||
peaks_extra=[False, False, False], base_extra = False,color_same = True, fr_name = '$f_{Base}$', eod_metrice = True, tags_individual = False, xlim_p = [0,1.1], add_texts = [0.25,0], scale_val = False):
|
||||
colors = colors_overview()
|
||||
# axos = []
|
||||
axis = []
|
||||
@ -5146,7 +5245,7 @@ def plt_cellbody_singlecell(grid1, frame, amps_desired, save_names, cells_plot,
|
||||
eod_fr, file_name, grid_lower, ims, load_name, save_names, stack_file, wss, xlim,
|
||||
power_type=power_type,fr = fr, peaks_extra=peaks_extra[c], zorder=zorders[aa], alpha=alpha,
|
||||
extra_input=extra_input, xpos_xlabel=xpos_xlabel, add_nonlin_title=add_nonlin_title,
|
||||
color=colors[cell_type], color_same = color_same, axo2=axo2, axd2=axd2, axi=axi, iterate_var=amps_defined, normval = normval, eod_metrice = eod_metrice)
|
||||
color=colors[cell_type], permuted = permuted, base_extra = base_extra,color_same = color_same, axo2=axo2, axd2=axd2, axi=axi, iterate_var=amps_defined, normval = normval, eod_metrice = eod_metrice)
|
||||
diag_vals.append(np.median(diagonals_prj_l))
|
||||
mats.append(mat)
|
||||
else:
|
||||
@ -5276,7 +5375,7 @@ def plt_cellbody_singlecell(grid1, frame, amps_desired, save_names, cells_plot,
|
||||
ax_p = plt.subplot(grid_p[1])
|
||||
|
||||
ax_isi = base_cells_susept(ax_isi, ax_p, c, cell, cell_type, cells_plot, colors, eod_fr, frame,
|
||||
isi, right, spikes_base, stack,xlim_p,add_texts =add_texts, titles = titles, peaks = True, fr_name = fr_name)
|
||||
isi, right, spikes_base, stack,xlim_p,base_extra = base_extra, add_texts =add_texts, titles = titles, peaks = True, fr_name = fr_name)
|
||||
|
||||
if isi_delta:
|
||||
ax_isi.set_xticks_delta(isi_delta)
|
||||
@ -5317,7 +5416,7 @@ def plt_cellbody_singlecell(grid1, frame, amps_desired, save_names, cells_plot,
|
||||
|
||||
|
||||
def base_cells_susept(ax_isi, ax_p, c, cell, cell_type, cells_plot, colors, eod_fr, frame, isi, right, spikes_base,
|
||||
stack, xlim,texts_left = [0.25,0], add_texts = [0.25,0], titles=['', '', '', '', ''], pos = -0.25, peaks = False, fr_name = '$f_{Base}$',xlim_i = [0, 16]):
|
||||
stack, xlim,texts_left = [0.25,0], add_texts = [0.25,0],base_extra = False, titles=['', '', '', '', ''], pos = -0.25, peaks = False, fr_name = '$f_{Base}$',xlim_i = [0, 16]):
|
||||
|
||||
|
||||
#ax_isi.text(-0.2, 0.5, 'Baseline', rotation=90, ha='center', va='center', transform=ax_isi.transAxes)
|
||||
@ -5339,8 +5438,20 @@ def base_cells_susept(ax_isi, ax_p, c, cell, cell_type, cells_plot, colors, eod_
|
||||
cvs = True
|
||||
#embed()
|
||||
if cvs:
|
||||
cv = str(np.round(frame[frame.cell == cell].cv.iloc[0], 2))# color=colors[str(cell_type)],
|
||||
ax_isi.text(pos, 1.25, titles[c] + r' $\rm{CV}=%s$' %cv, transform=ax_isi.transAxes) # str(np.std(isi) / np.mean(isi))
|
||||
cv = frame[frame.cell == cell].cv.iloc[0]#str(np.round(frame[frame.cell == cell].cv.iloc[0], 2))# color=colors[str(cell_type)],
|
||||
fr = frame[frame.cell == cell].fr.iloc[
|
||||
0] # str(np.round(frame[frame.cell == cell].cv.iloc[0], 2))# color=colors[str(cell_type)],
|
||||
|
||||
if base_extra:
|
||||
if titles[c] == '':
|
||||
add_nrs = r'$\mathrm{f}_{base}=%.0f$\,Hz,' % fr+ r' $\mathrm{CV}_{base}=%.2f$' % cv
|
||||
else:
|
||||
add_nrs = r' $\mathrm{f}_{base}=%.0f$\,Hz,' % fr + r' $\mathrm{CV}_{base}=%.2f$' % cv
|
||||
ax_isi.text(pos, 1.25, titles[c] + add_nrs,
|
||||
transform=ax_isi.transAxes) # str(np.std(isi) / np.mean(isi))
|
||||
|
||||
else:
|
||||
ax_isi.text(pos, 1.25, titles[c] + r' $\rm{CV}=%.2f$' %cv, transform=ax_isi.transAxes) # str(np.std(isi) / np.mean(isi))
|
||||
|
||||
else:
|
||||
ax_isi.text(pos, 1.2, titles[c], color=colors[str(cell_type)], transform=ax_isi.transAxes)
|
||||
@ -5610,7 +5721,8 @@ def labels_for_psds(axd2, axi, axo2, extra_input, right='middle', chi_pos = -0.3
|
||||
else:
|
||||
|
||||
#nonlin_title(add_nonlin_title)
|
||||
axd2.text(chi_pos, 0.5, r'$|\chi_2|$', rotation=90, va='center', transform=axd2.transAxes)
|
||||
#overline
|
||||
axd2.text(chi_pos, 0.5, r'$|\bar{\chi_2}|$', rotation=90, va='center', transform=axd2.transAxes)
|
||||
axd2.yscalebar(1.1, 0.5, 10, 'dB', va='center', ha='right')
|
||||
axd2.show_spines('b')#-0.23
|
||||
if normval != 1:
|
||||
@ -5926,7 +6038,7 @@ def get_max_several_amp_squares(add, amp, amps_defined, files, load_name, stack_
|
||||
|
||||
|
||||
def plt_square_here(aa, amp, amps_defined, ax_square, c, cells_plot, ims, stack_final1, xlim, line_length = 1 / 4, alpha=1, cbar_true=True,
|
||||
perc=True, amp_give = True, eod_metrice = True, ha='right',nr = 3, fr = None, title_square = '', xpos_xlabel =-0.2, ypos=0.05, xpos=0.1, color='white', add_nonlin_title = None):
|
||||
perc=True, amp_give = True, base_extra = False, eod_metrice = True, ha='right',nr = 3, fr = None, title_square = '', xpos_xlabel =-0.2, ypos=0.05, xpos=0.1, color='white', add_nonlin_title = None):
|
||||
if aa == len(amps_defined) - 1:
|
||||
cbar_do = False
|
||||
else:
|
||||
@ -5969,10 +6081,15 @@ def plt_square_here(aa, amp, amps_defined, ax_square, c, cells_plot, ims, stack_
|
||||
|
||||
if cvs:#$\mathcal{X}_{2}
|
||||
|
||||
ax_square.text(xpos, ypos, title_square+amp_val + r'$\rm{CV}=%s$' %(
|
||||
np.round(stack_final1.cv_stim.iloc[0], 2)), ha=ha,
|
||||
transform=ax_square.transAxes, color=color,
|
||||
alpha=alpha) # 'white' files[0] + ' l ' + str(length)chi_name()+
|
||||
if base_extra:
|
||||
ax_square.text(xpos, ypos, title_square+amp_val + r'$\mathrm{CV}_{stim}=%.2f$' %(stack_final1.cv_stim.iloc[0]), ha=ha,
|
||||
transform=ax_square.transAxes, color=color,
|
||||
alpha=alpha) # (np.round(stack_final1.cv_stim.iloc[0], 2))'white' files[0] + ' l ' + str(length)chi_name()+
|
||||
|
||||
else:
|
||||
ax_square.text(xpos, ypos, title_square+amp_val + r'$\rm{CV}=%.2f$' %(stack_final1.cv_stim.iloc[0]), ha=ha,
|
||||
transform=ax_square.transAxes, color=color,
|
||||
alpha=alpha) # (np.round(stack_final1.cv_stim.iloc[0], 2))'white' files[0] + ' l ' + str(length)chi_name()+
|
||||
|
||||
else:
|
||||
ax_square.text(xpos, ypos, title_square+chi_name()+'$($' + str(int(amp_name)) + '$\%$)', ha=ha,
|
||||
@ -6265,7 +6382,10 @@ def plt_stimulus(eod_fr, axe, stack_final1, xlim_e, RAM=True, file_name=None, ad
|
||||
axe.plot(time_eod_interp * 1000 - neuronal_delay, eod_interp * size_fake_am + 1 + add, color='red', linewidth=1)
|
||||
|
||||
axe.set_xlim(xlim_e)
|
||||
|
||||
ylim_e = axe.get_ylim()
|
||||
ylim_e = np.array(ylim_e)*1.05
|
||||
#embed()
|
||||
axe.set_ylim(ylim_e)
|
||||
remove_xticks(axe)
|
||||
|
||||
|
||||
@ -7008,7 +7128,7 @@ def do_hist(grid1, c, colors, cell_type, hists_both, cell, cells_plot):
|
||||
axi.set_xlabel('isi')
|
||||
|
||||
|
||||
def cells_eigen(amp_desired=[0.5, 1, 5], xlim=[0, 1.1], cell_class=' Ampullary', cells_plot2=[], show=False,
|
||||
def cells_eigen(base_extra = False,amp_desired=[0.5, 1, 5], xlim=[0, 1.1], cell_class=' Ampullary', cells_plot2=[], show=False,
|
||||
annotate=False, titles=['Baseline \n Susceptibility', 'Half EODf \n Susceptibility'],
|
||||
peaks_extra=[False, False, False]):
|
||||
plot_style()
|
||||
@ -7055,12 +7175,12 @@ def cells_eigen(amp_desired=[0.5, 1, 5], xlim=[0, 1.1], cell_class=' Ampullary',
|
||||
# wspace=0.35) # ,
|
||||
|
||||
plt_cellbody_eigen(grid1, frame, amps_desired, save_names, cells_plot, cell_type_type, xlim=xlim, plus=1,
|
||||
burst_corr='_burst_corr_individual', titles=titles, peaks_extra=peaks_extra)
|
||||
burst_corr='_burst_corr_individual',base_extra = base_extra, titles=titles, peaks_extra=peaks_extra)
|
||||
|
||||
save_visualization(pdf=True)
|
||||
|
||||
|
||||
def ampullary_punit(eod_metrice = True,color_same = True, fr_name = '$f_{Base}$', amp_desired = [5,20], isi_delta = None, xlim_p = [0, 1.1], tags_individual = False, xlim=[],add_texts = [0.25,0], cells_plot2=[], RAM=True,scale_val = False,
|
||||
def ampullary_punit(permuted = False,eod_metrice = True,base_extra = False, color_same = True, fr_name = '$f_{Base}$', amp_desired = [5,20], isi_delta = None, xlim_p = [0, 1.1], tags_individual = False, xlim=[],add_texts = [0.25,0], cells_plot2=[], RAM=True,scale_val = False,
|
||||
titles=['Low-CV P-unit,', 'High-CV P-unit', 'Ampullary cell,'], peaks_extra=[True, True, True]):#[0, 1.1]
|
||||
plot_style()
|
||||
|
||||
@ -7101,7 +7221,7 @@ def ampullary_punit(eod_metrice = True,color_same = True, fr_name = '$f_{Base}
|
||||
grid1 = big_grid_susept_pics(cells_plot2, bottom=0.065)
|
||||
|
||||
plt_cellbody_singlecell(grid1, frame, amps_desired, save_names, cells_plot2, cell_type_type, xlim=xlim, plus=1,
|
||||
burst_corr='_burst_corr_individual',color_same = color_same, fr_name = fr_name, eod_metrice = eod_metrice, isi_delta = isi_delta, tags_individual = tags_individual, RAM=RAM,add_texts = add_texts, titles=titles, xlim_p = xlim_p, peaks_extra=peaks_extra,scale_val = scale_val, )
|
||||
burst_corr='_burst_corr_individual', permuted = permuted,base_extra = base_extra, color_same = color_same, fr_name = fr_name, eod_metrice = eod_metrice, isi_delta = isi_delta, tags_individual = tags_individual, RAM=RAM,add_texts = add_texts, titles=titles, xlim_p = xlim_p, peaks_extra=peaks_extra,scale_val = scale_val, )
|
||||
|
||||
# plt.show()
|
||||
save_visualization(pdf=True, individual_tag = cells_plot2[0])
|
||||
@ -10001,7 +10121,6 @@ def plot_arrays_ROC_psd_single(arrays, arrays_original, spikes_pure, fr, cell, g
|
||||
|
||||
return fr_isi, ax_ps, ax_as
|
||||
|
||||
|
||||
def plot_arrays_ROC_psd_single3(arrays, arrays_original, spikes_pure, fr, cell, grid0, chirps, extract, mean_type,
|
||||
group_mean, b, devs, plot_group=0,names = ['0', '02', '01', '012'],
|
||||
rocextra=False, xlim=[0, 100], row=4, subdevision_nr=3, way='absolut', datapoints=1000,
|
||||
@ -10067,9 +10186,9 @@ def plot_arrays_ROC_psd_single3(arrays, arrays_original, spikes_pure, fr, cell,
|
||||
# plot the psds
|
||||
ps = {}
|
||||
p_means = {}
|
||||
ax00, fr_isi = plt_psds_ROC(arrays, ax00, ax_ps, cell, grid0, group_mean, nfft, p_means, ps, row, spikes_pure,
|
||||
time_array, names, add_burst_corr, color_psd, p_means_all, f, colors_p, xlim_psd,
|
||||
ylim_log, ylim_psd, log=log)
|
||||
ax00, fr_isi = plt_psds_ROC(arrays, ax00, ax_ps, cell, colors_p, f, grid0, group_mean, nfft, p_means,p_means_all, ps, row, spikes_pure,
|
||||
time_array, names = names, color_psd = color_psd, add_burst_corr = add_burst_corr, xlim_psd = xlim_psd,
|
||||
ylim_log = ylim_log, ylim_psd = ylim_psd, log=log)
|
||||
|
||||
ax00.get_shared_y_axes().join(*ax_ps)
|
||||
# embed()
|
||||
@ -10106,14 +10225,17 @@ def plt_spikes_ROC(ax0, colors, spikes_pure, xlim, lw = None, key_names=[''], j
|
||||
# array_chosen=1,color012_minus = 'purple', mean_types=[], color012='orange', color01_2='purple', log='log'
|
||||
def plt_psds_ROC(arrays, ax00, ax_ps, cell, colors_p, f, grid0, group_mean, nfft, p_means, p_means_all, ps, row,
|
||||
spikes_pure, time_array, names=['0', '02', '01', '012'], color_psd='black', add_burst_corr=False,
|
||||
xlim_psd=[0, 235], ylim_log=(-15, 3), ylim_psd=[], log='log'):
|
||||
xlim_psd=[0, 235], clip_on = True, choice = [], labels = [], text_extra = True, alphas = [], range_plot = [], ylim_log=(-15, 3), ylim_psd=[], log='log', ax01 = None):
|
||||
psd_type = 'mean_freq'
|
||||
for j in range(len(arrays)):
|
||||
if not range_plot:
|
||||
range_plot = range(len(arrays))
|
||||
for j in range_plot:
|
||||
# '' # 'log'#''#'log'#''#
|
||||
#embed()
|
||||
try:
|
||||
ref, ax00 = plt_single_pds(nfft, f, p_means, p_means_all[names[j]], ylim_psd, xlim_psd, color_psd, names,
|
||||
ps,
|
||||
arrays, ax_ps, grid0, row + 1, j, p_means_all, psd_type='mean_freq', log=log)
|
||||
arrays, ax_ps, grid0, row + 1, j, p_means_all, ax00 = ax01, psd_type='mean_freq', log=log)
|
||||
except:
|
||||
print('ref not working')
|
||||
embed()
|
||||
@ -10146,51 +10268,45 @@ def plt_psds_ROC(arrays, ax00, ax_ps, cell, colors_p, f, grid0, group_mean, nfft
|
||||
np.abs(DF1) + np.abs(DF2), 2 * np.abs(DF2), 2 * np.abs(DF1),
|
||||
np.abs(np.abs(DF1) - np.abs(DF2)), ]
|
||||
try:
|
||||
if j == 3:
|
||||
labels = ['',
|
||||
'',
|
||||
'',
|
||||
fsum_core(DF1, DF2),
|
||||
'',
|
||||
'',
|
||||
fdiff_core(DF1, DF2),
|
||||
'fr_bc',
|
||||
'fr_given_burst_corr_individual', 'highest_fr_burst_corr_individual', 'fr', 'fr_given',
|
||||
'highest_fr'] # '$|$DF1-DF2$|$=' + str(np.abs(np.abs(DF1) - np.abs(DF2))) + 'Hz',
|
||||
elif j == 2:
|
||||
labels = ['',
|
||||
df1_core(DF2),
|
||||
df2_core(DF1),
|
||||
fsum_core(DF1, DF2),
|
||||
f1_core(DF2),
|
||||
f2_core(DF1),
|
||||
fdiff_core(DF1, DF2),
|
||||
'fr_bc',
|
||||
'fr_given_burst_corr_individual', 'highest_fr_burst_corr_individual', 'fr', 'fr_given',
|
||||
'highest_fr'] # '$|$DF1-DF2$|$=' + str(np.abs(np.abs(DF1) - np.abs(DF2))) + 'Hz',
|
||||
if not labels:
|
||||
if j == 3:
|
||||
labels = ['',
|
||||
'',
|
||||
'',
|
||||
fsum_core(DF1, DF2),
|
||||
'',
|
||||
'',
|
||||
fdiff_core(DF1, DF2),
|
||||
'fr_bc',
|
||||
'fr_given_burst_corr_individual', 'highest_fr_burst_corr_individual', 'fr', 'fr_given',
|
||||
'highest_fr'] # '$|$DF1-DF2$|$=' + str(np.abs(np.abs(DF1) - np.abs(DF2))) + 'Hz',
|
||||
elif j == 2:
|
||||
labels = ['',
|
||||
df1_core(DF2),
|
||||
df2_core(DF1),
|
||||
fsum_core(DF1, DF2),
|
||||
f1_core(DF2),
|
||||
f2_core(DF1),
|
||||
fdiff_core(DF1, DF2),
|
||||
'fr_bc',
|
||||
'fr_given_burst_corr_individual', 'highest_fr_burst_corr_individual', 'fr', 'fr_given',
|
||||
'highest_fr'] # '$|$DF1-DF2$|$=' + str(np.abs(np.abs(DF1) - np.abs(DF2))) + 'Hz',
|
||||
|
||||
else:
|
||||
labels = ['$f_{base}=%s$' %(int(np.round(fr_isi))) + '\,Hz',
|
||||
df1_core(DF2),
|
||||
df2_core(DF1),
|
||||
fsum_core(DF1, DF2),
|
||||
f1_core(DF2),
|
||||
f2_core(DF1),
|
||||
fdiff_core(DF1, DF2),
|
||||
'fr_bc',
|
||||
'fr_given_burst_corr_individual', 'highest_fr_burst_corr_individual', 'fr', 'fr_given',
|
||||
'highest_fr'] # '$|$DF1-DF2$|$=' + str(np.abs(np.abs(DF1) - np.abs(DF2))) + 'Hz',
|
||||
else:
|
||||
labels = labels_all_motivation(DF1, DF2, fr_isi)
|
||||
|
||||
except:
|
||||
print('label thing')
|
||||
embed()
|
||||
if add_burst_corr:
|
||||
choice = update_burst_corr_peaks(colors_p, freqs, frs_burst_corr, labels)
|
||||
if not choice:
|
||||
choice = update_burst_corr_peaks(colors_p, freqs, frs_burst_corr, labels)
|
||||
rots = [[45], [45, 45], [45], [45, 45, 45, 45, 45, 45]]
|
||||
extra = []
|
||||
left = 40
|
||||
else:
|
||||
choice = [[0], [1, 4], [0,2], [0, 1, 2, 3, 4, 6]]
|
||||
if not choice:
|
||||
choice = [[0], [1, 4], [0,2], [0, 1, 2, 3, 4, 6]]
|
||||
|
||||
rots = [[0], [0, 0], [0,0], [55, 55, 57, 45, 45, 45]]#45
|
||||
lefts = [[10], [25, 3], [0,105], [10, 10, 10, 13, 12, 40]]#40
|
||||
@ -10207,22 +10323,37 @@ def plt_psds_ROC(arrays, ax00, ax_ps, cell, colors_p, f, grid0, group_mean, nfft
|
||||
# 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,
|
||||
ax00, pp_mean, np.array(colors_p)[choice[j]], f, texts_left=left, add_log=1.5, text_extra=True,
|
||||
ax00, pp_mean, np.array(colors_p)[choice[j]], f, texts_left=left, add_log=1.5, text_extra=text_extra,
|
||||
exact=False, add_texts=extra, rots=np.array(rots)[j], ms=14, perc=0.08, log=log,
|
||||
clip_on=True) # True
|
||||
clip_on=clip_on, alphas = alphas) # True
|
||||
except:
|
||||
print('peaks thing')
|
||||
print('peaks thing2')
|
||||
embed()
|
||||
# embed()
|
||||
if log == 'log':
|
||||
ax00.set_ylim(ylim_log)
|
||||
ax00.show_spines('b')
|
||||
if j == 0:
|
||||
ax00.yscalebar(-0.02, 0.5, 10, 'dB', va='center', ha='left')
|
||||
#embed()
|
||||
if log == 'log':
|
||||
if j == 0:
|
||||
ax00.yscalebar(-0.02, 0.5, 10, 'dB', va='center', ha='left')
|
||||
|
||||
return ax00, fr_isi
|
||||
|
||||
|
||||
def labels_all_motivation(DF1, DF2, fr_isi):
|
||||
labels = ['$f_{base}=%s$' % (int(np.round(fr_isi))) + '\,Hz',
|
||||
df1_core(DF2),
|
||||
df2_core(DF1),
|
||||
fsum_core(DF1, DF2),
|
||||
f1_core(DF2),
|
||||
f2_core(DF1),
|
||||
fdiff_core(DF1, DF2),
|
||||
'fr_bc',
|
||||
'fr_given_burst_corr_individual', 'highest_fr_burst_corr_individual', 'fr', 'fr_given',
|
||||
'highest_fr'] # '$|$DF1-DF2$|$=' + str(np.abs(np.abs(DF1) - np.abs(DF2))) + 'Hz',
|
||||
return labels
|
||||
|
||||
|
||||
def df2_core(DF1):
|
||||
return '$|\Delta f_{2}|=|f_{2}-f_{EOD}|=%s$' %(np.abs(DF1)) + '\,Hz'
|
||||
|
||||
@ -10289,8 +10420,8 @@ def get_burst_corr_peak(cell, fr_isis, group_mean, spikes_pure):
|
||||
return frs_burst_corr
|
||||
|
||||
|
||||
def get_psds_ROC(array_chosen, arrays, arrays_original, j, mean_type, names, p_means_all):
|
||||
nfft = 2 ** 13 # 2 ** 18 # 17#16
|
||||
def get_psds_ROC(array_chosen, arrays, arrays_original, j, mean_type, names, p_means_all, nfft = 2 ** 13 ):
|
||||
# 2 ** 18 # 17#16
|
||||
p_mean_all_here = []
|
||||
if 'AllTrialsIndex' in mean_type: # AllTrialsIndex
|
||||
range_here = [array_chosen]
|
||||
@ -10311,7 +10442,11 @@ def get_psds_ROC(array_chosen, arrays, arrays_original, j, mean_type, names, p_m
|
||||
p_mean_all, f = ml.psd(arrays[j][i] - np.mean(arrays[j][i]), Fs=40000, NFFT=nfft,
|
||||
noverlap=nfft // 2) #
|
||||
p_mean_all_here.append(p_mean_all)
|
||||
p_means_all[names[j]] = p_mean_all_here
|
||||
try:
|
||||
p_means_all[names[j]] = p_mean_all_here
|
||||
except:
|
||||
print('assign p problem')
|
||||
embed()
|
||||
return f, nfft
|
||||
|
||||
|
||||
@ -10588,13 +10723,14 @@ def find_nix_full_path(c, cell, data_dir):
|
||||
# , cut, delays_length, delays_length_m, effective_duration, frame,
|
||||
|
||||
def plt_single_pds(nfft, f, p_means, p_mean_all_here, ylim_psd, xlim_psd, color_psd, names, ps, arrays, ax_ps, grid0,
|
||||
row, j, p_means_all, psd_type='mean_freq', log='log'):
|
||||
row, j, p_means_all, psd_type='mean_freq', log='log', ax00 = None):
|
||||
# embed()
|
||||
|
||||
if psd_type == 'single':
|
||||
ref = np.max([p_means_all['012'][0], p_means_all['01'][0], p_means_all['02'][0], p_means_all['0'][0]])
|
||||
|
||||
ax00 = plt.subplot(grid0[row + 2, j])
|
||||
if not ax00:
|
||||
ax00 = plt.subplot(grid0[row + 2, j])
|
||||
ax_ps.append(ax00)
|
||||
nfft = 2 ** 16
|
||||
p, f = ml.psd(arrays[j][0] - np.mean(arrays[j][0]), Fs=40000, NFFT=nfft,
|
||||
@ -10619,7 +10755,8 @@ def plt_single_pds(nfft, f, p_means, p_mean_all_here, ylim_psd, xlim_psd, color_
|
||||
# hier mache ich nur einen trial
|
||||
elif psd_type == 'mean_temporal':
|
||||
|
||||
ax00 = plt.subplot(grid0[row + 2, j])
|
||||
if not ax00:
|
||||
ax00 = plt.subplot(grid0[row + 2, j])
|
||||
ax_ps.append(ax00)
|
||||
# hier mache ich noch den temporal mean
|
||||
p_mean, f_mean = ml.psd(np.mean(arrays[j], axis=0) - np.mean(np.mean(arrays[j], axis=0)), Fs=40000, NFFT=nfft,
|
||||
@ -10641,7 +10778,8 @@ def plt_single_pds(nfft, f, p_means, p_mean_all_here, ylim_psd, xlim_psd, color_
|
||||
|
||||
|
||||
elif psd_type == 'all':
|
||||
ax00 = plt.subplot(grid0[row + 2, j])
|
||||
if not ax00:
|
||||
ax00 = plt.subplot(grid0[row + 2, j])
|
||||
ax_ps.append(ax00)
|
||||
|
||||
for p in p_mean_all_here:
|
||||
@ -10656,16 +10794,21 @@ def plt_single_pds(nfft, f, p_means, p_mean_all_here, ylim_psd, xlim_psd, color_
|
||||
|
||||
elif psd_type == 'mean_freq':
|
||||
# try:
|
||||
# embed()
|
||||
ref = np.max([np.mean(p_means_all['012'], axis=0), np.mean(p_means_all['01'], axis=0),
|
||||
np.mean(p_means_all['02'], axis=0), np.mean(p_means_all['0'], axis=0)])
|
||||
#embed()
|
||||
array_here = []
|
||||
for name in names:
|
||||
array_here.append(np.mean(p_means_all[name], axis=0))
|
||||
ref = np.max(array_here)
|
||||
#ref = np.max([np.mean(p_means_all['012'], axis=0), np.mean(p_means_all['01'], axis=0),
|
||||
# np.mean(p_means_all['02'], axis=0), np.mean(p_means_all['0'], axis=0)])
|
||||
# except:
|
||||
# print('ref something')
|
||||
# embed()
|
||||
ref = np.max([np.mean(p_means_all['012'], axis=0), np.mean(p_means_all['01'], axis=0),
|
||||
np.mean(p_means_all['02'], axis=0), np.mean(p_means_all['0'], axis=0)])
|
||||
#ref = np.max([np.mean(p_means_all['012'], axis=0), np.mean(p_means_all['01'], axis=0),
|
||||
# np.mean(p_means_all['02'], axis=0), np.mean(p_means_all['0'], axis=0)])
|
||||
|
||||
ax00 = plt.subplot(grid0[row + 2, j])
|
||||
if not ax00:
|
||||
ax00 = plt.subplot(grid0[row + 2, j])
|
||||
ax_ps.append(ax00)
|
||||
# embed()
|
||||
# embed()
|
||||
@ -15534,11 +15677,11 @@ def chose_class_cells(cell_types_sort=[' P-unit_problem', 'unkown', ' unknown_pr
|
||||
return cell_sorted, cell_type_type, cell_types, cells, frame
|
||||
|
||||
|
||||
def kernel_scatter(axl, cell_types, axk, axs, ax_j, c, cell_type_here, colors, cv_n, cv_name, frame_file, grid, max_val,
|
||||
score, xmin='no', alpha = 1, ymin='no', n = True, log=True):
|
||||
def kernel_scatter(axy, cell_types, axx, axs, ax_j, c, cell_type_here, colors, cv_n, cv_name, frame_file, grid, max_val,
|
||||
score, xmin='no', alpha = 1, ymin='no', n = True, log=True):
|
||||
###########################
|
||||
# version comparison with all cells, and no modulation
|
||||
x_axis = plot_kernels_on_side(axk, axl, cell_type_here, colors[str(cell_type_here)], cv_name, frame_file, score,
|
||||
x_axis = plot_kernels_on_side(axx, axy, cell_type_here, colors[str(cell_type_here)], cv_name, frame_file, score,
|
||||
xmin=xmin, ymin=ymin)
|
||||
|
||||
# todo: hier noch das andere seiteliche histogram machen
|
||||
@ -15548,18 +15691,22 @@ def kernel_scatter(axl, cell_types, axk, axs, ax_j, c, cell_type_here, colors, c
|
||||
x_axis = plt_overview_scatter(axs, c, cell_type_here, colors, cv_name, frame_file,
|
||||
score, alpha = alpha, n = n, color_text=colors[str(cell_type_here)])
|
||||
if log:
|
||||
axl.set_yscale('log')
|
||||
axy.set_yscale('log')
|
||||
axs.set_yscale('log')
|
||||
# remove_yticks(axl)
|
||||
axl.set_yticks_blank()
|
||||
axl.minorticks_off()
|
||||
|
||||
axs.get_shared_y_axes().join(*[axs, axl])
|
||||
axk.get_shared_x_axes().join(*[axs, axk])
|
||||
axy.set_yticks_blank()
|
||||
axy.minorticks_off()
|
||||
|
||||
#axs.get_shared_y_axes().join(*[axs, axy])
|
||||
#axx.get_shared_x_axes().join(*[axs, axx])
|
||||
join_x([axs, axx])
|
||||
join_y([axy,axs])
|
||||
#axy.set_ylim(0,6)
|
||||
#embed()
|
||||
if log:
|
||||
make_log_ticks([axl, axs])
|
||||
remove_yticks(axl)
|
||||
axl.minorticks_off()
|
||||
make_log_ticks([axy, axs])
|
||||
remove_yticks(axy)
|
||||
axy.minorticks_off()
|
||||
return axs, x_axis
|
||||
|
||||
|
||||
@ -15646,7 +15793,7 @@ def plt_eigen(cv_name, ax, c, cell_type_here, cells_extra, colors, frame_file, m
|
||||
str(cell_type_here)], clip_on=False, marker='D', edgecolor='black')
|
||||
|
||||
|
||||
def plt_overview_scatter(ax, c, cell_type_here, colors, cv_name, frame_file, score, x_pos=0, n = True, alpha = 1, color_text='black', ha = 'left'):
|
||||
def plt_overview_scatter(ax, c, cell_type_here, colors, cv_name, frame_file, score, x_pos=0, labelpad = 0, n = True, alpha = 1, color_text='black', ha = 'left'):
|
||||
x_axis, y_axis = x_axis_wo_c(cv_name, frame_file, score)
|
||||
try:
|
||||
x = x_axis # [x_axis < max_val]
|
||||
@ -15672,7 +15819,7 @@ def plt_overview_scatter(ax, c, cell_type_here, colors, cv_name, frame_file, sco
|
||||
# #text = legend.texts[-1]
|
||||
# text.set_color(colors[cell_types[c]])
|
||||
|
||||
ax.set_xlabel(cv_name)
|
||||
ax.set_xlabel(cv_name, labelpad = labelpad)
|
||||
|
||||
return x_axis
|
||||
|
||||
@ -15707,7 +15854,7 @@ def get_axis(cv_name, frame_file, score):
|
||||
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', max_x=None, n=True, xlim=None, x_pos=0, burst_fraction=1,
|
||||
var_item='response_modulation', labelpad = 0, max_x=None, n=True, xlim=None, x_pos=0, burst_fraction=1,
|
||||
ha='left'):
|
||||
cmap = []
|
||||
x_axis = []
|
||||
@ -15812,7 +15959,7 @@ def plt_burst_modulation_hists(axk, axl, var_item_name, ax, cell_type_here, cv_n
|
||||
cbar.set_label(var_item_name) ##+cell_type_here rotation=270,, labelpad=100
|
||||
else:
|
||||
colors = colors_overview()
|
||||
x_axis = plt_overview_scatter(ax, 0, cell_type_here, colors, cv_name, frame_file, score, x_pos=x_pos, ha = ha)
|
||||
x_axis = plt_overview_scatter(ax, 0, cell_type_here, colors, cv_name, frame_file, score, x_pos=x_pos, ha = ha, labelpad = labelpad)
|
||||
axl.get_shared_y_axes().join(*[ax, axl])
|
||||
axk.get_shared_x_axes().join(*[ax, axk])
|
||||
axk.show_spines('')
|
||||
@ -18661,6 +18808,13 @@ def join_x(axts_all):
|
||||
|
||||
def join_y(axts_all):
|
||||
axts_all[0].get_shared_y_axes().join(*axts_all)
|
||||
if axts_all[0].get_ylim()[-1] != axts_all[1].get_ylim()[-1]:
|
||||
first = axts_all[0].get_ylim()[-1]
|
||||
second = axts_all[1].get_ylim()[-1]
|
||||
starting_val = np.min([first[0], second[0]])
|
||||
end_val = np.max([first[1], second[1]])
|
||||
axts_all[0].set_ylim(starting_val,end_val)
|
||||
axts_all[1].set_ylim(starting_val,end_val)
|
||||
|
||||
|
||||
def find_peaks_simple(eodf, freq1,freq2, name, color1, color2):
|
||||
@ -24365,6 +24519,7 @@ def plt_show_nonlin_effect_didactic_final2(min=0.2, cells=[], add_pp=50,
|
||||
ax[2].eventplot(np.array(spikes), color='black')
|
||||
ax[3].plot((time_array - min) * 1000, mat05, color='black')
|
||||
# embed()
|
||||
|
||||
pp, f = ml.psd(mat05 - np.mean(mat05), Fs=1 / deltat, NFFT=nfft,
|
||||
noverlap=nfft // 2)
|
||||
ref = (np.max(pp))
|
||||
@ -24417,7 +24572,7 @@ def plt_show_nonlin_effect_didactic_final2(min=0.2, cells=[], add_pp=50,
|
||||
save_visualization(individual_tag, show, counter_contrast=0, savename='')
|
||||
|
||||
|
||||
def outputmodel(a_fr, add_half, cell, model_cells, single_wave, trials_nr):
|
||||
def outputmodel(a_fr, add_half, cell, model_cells, single_wave, trials_nr, freqs_mult1 = None, freqs_mult2 = None):
|
||||
try:
|
||||
model_params = model_cells[model_cells['cell'] == cell].iloc[0]
|
||||
except:
|
||||
@ -24489,16 +24644,23 @@ def outputmodel(a_fr, add_half, cell, model_cells, single_wave, trials_nr):
|
||||
fr = np.mean(base_cut)
|
||||
freq1 = [eod_fr / 2]
|
||||
titles = ['']
|
||||
if 'Several' in single_wave:
|
||||
# f1 is the smaller frequency
|
||||
if 'Sum' in single_wave:
|
||||
freqs1 = [eod_fr + fr * 0.3]
|
||||
freqs2 = [eod_fr + fr * 0.7]
|
||||
if freqs_mult1:
|
||||
#fr_relative = fr / eod_fr
|
||||
freqs1 = [eod_fr + fr * freqs_mult1]
|
||||
freqs2 = [eod_fr + fr * freqs_mult2]
|
||||
#embed()
|
||||
else:
|
||||
freqs1 = [eod_fr - fr / 2 + add_half]
|
||||
freqs2 = [0] * len(freqs1)
|
||||
if 'Several' in single_wave:
|
||||
# f1 is the smaller frequency
|
||||
if 'Sum' in single_wave:
|
||||
freqs1 = [eod_fr + fr * 0.3]
|
||||
freqs2 = [eod_fr + fr * 0.7]
|
||||
else:
|
||||
freqs1 = [eod_fr - fr / 2 + add_half]
|
||||
freqs2 = [0] * len(freqs1)
|
||||
|
||||
sampling_rate = 1 / deltat
|
||||
# ax[0, 1].get_shared_x_axes().join(*ax[0, :])
|
||||
|
||||
return SAM, cell, damping, damping_type, deltat, eod_fish_r, eod_fr, f1, f2, freqs1, freqs2, model_params, offset, phase_right, phaseshift_fr, rate_adapted, rate_baseline_after, rate_baseline_before, sampling, spike_adapted, spikes, stimuli, stimulus_altered, stimulus_length, time_array, v_dent_output, v_mem_output
|
||||
|
||||
|
||||
@ -39267,10 +39429,10 @@ def phaselocking_loss2(show=True):
|
||||
print('finished plotting')
|
||||
|
||||
|
||||
def plt_model_big(ax, ls = '--', lw = 0.5):
|
||||
def plt_model_big(ax, ls = '--', lw = 0.5, cell = '2012-07-03-ak-invivo-1'):
|
||||
trial_nr = 1000000
|
||||
cell = '2013-01-08-aa-invivo-1'
|
||||
cell = '2012-07-03-ak-invivo-1'
|
||||
#cell = '2013-01-08-aa-invivo-1'
|
||||
|
||||
cells_given = [cell]
|
||||
#'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_1000000_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_' + str(trial_nr) + '_a_fr_1__trans1s__TrialsNr_1_fft_o_forward_fft_i_forward_Hz_mV'
|
||||
@ -40014,4 +40176,179 @@ def end_fi_s():
|
||||
|
||||
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
|
||||
return trial_nrs_here
|
||||
|
||||
|
||||
def colors_suscept_paper_dots():
|
||||
color0 = 'blue'
|
||||
color0_burst = 'darkgreen'
|
||||
color01 = 'green'
|
||||
color02 = 'purple'
|
||||
color012 = 'orange'
|
||||
color01_2 = 'red' ##
|
||||
return color01, color012, color01_2, color02, color0_burst, color0
|
||||
|
||||
|
||||
def plt_voltage_trace(cell, eod_fr, frame_cell, axs, lim_here, test, spikes_plotted = True, dir = '', scaling_factor = 1):
|
||||
|
||||
spike_times_all = []
|
||||
spike_times_all_full = []
|
||||
#embed()
|
||||
if os.path.exists(dir+'../data/cells/' + cell + '/' + cell + '.nix'):
|
||||
f, nix_exists, nix_missing = load_f(['cells'], 0, cell, dir = dir)
|
||||
# if nix exists
|
||||
|
||||
#embed()
|
||||
if nix_exists:
|
||||
b = f.blocks[0]
|
||||
cont_baseline, nix_missing, ts = find_tags_baseline(b, nix_missing)
|
||||
#tags_all = find_tags_all(b)
|
||||
# alternativ halt hier die Filestimuli laden oder
|
||||
position = frame_cell.index[0]
|
||||
# embed()
|
||||
# name_pkl = load_folder_name('calc_base') + '/calc_base_data-base_frame.pkl'
|
||||
|
||||
# embed()
|
||||
if cont_baseline & (len(ts) > 0):
|
||||
# cont_baseline = False
|
||||
# if rlx_needed == False:
|
||||
spike_times_all = []
|
||||
data_array_names = get_data_array_names(b)
|
||||
if 'eod' in ''.join(data_array_names).lower():
|
||||
lengths = []
|
||||
for t in ts:
|
||||
lengths.append(t.extent[:][0])
|
||||
tag = ts[np.argmax(lengths)]
|
||||
# if tag.extent[0] * sampling_spikes > nfft:
|
||||
# embed()
|
||||
add_mt = False
|
||||
# for mt_add in mts_do:
|
||||
# if mt_add in tag.name.lower():
|
||||
add_mt = True
|
||||
if add_mt:
|
||||
if 'base' in tag.name.lower():
|
||||
print(tag.name)
|
||||
# eod_fr = align_eodfrorig_and_calc(eod_fr, eod_frs_orig)
|
||||
# if np.abs(eod_fr - eod_frs_orig) > 40:
|
||||
# print('eod_fr diff3')
|
||||
# embed()
|
||||
t1 = time.time()
|
||||
|
||||
# b = f.blocks[0]
|
||||
tag_here = b.tags[tag.name] # 2/3
|
||||
# try:
|
||||
# spike_times = tag.retrieve_data('Spikes-1')[:] - tag.position[:][0]
|
||||
# except:
|
||||
# spike_times = tag.retrieve_data('spikes-1')[:] - tag.position[:][0]
|
||||
|
||||
# embed()
|
||||
|
||||
#############################################
|
||||
# hier führen wir eine maximale Länge ein, weil es Zellen gibt die man zu lange mit der Basleine gemessen hat?
|
||||
# try:
|
||||
# tag.extent[:][0]
|
||||
# except:
|
||||
# print('tag problem')
|
||||
# embed()
|
||||
if len(tag_here.extent[:]) > 0:
|
||||
duration = restrict_base_durationts(tag_here.extent[:][0])
|
||||
|
||||
xlim = 0.400
|
||||
if duration < xlim:
|
||||
duration_base = xlim
|
||||
else:
|
||||
duration_base = xlim
|
||||
spike_times = link_arrays_spikes(b, first=tag.position[:][0],
|
||||
second=duration_base,
|
||||
minus_spikes=tag.position[:][0])
|
||||
spike_times_full = link_arrays_spikes(b, first=tag.position[:][0],
|
||||
second=tag.extent[:][0],
|
||||
minus_spikes=tag.position[:][0])
|
||||
spike_times_all.append(spike_times)
|
||||
spike_times_all_full.append(spike_times_full)
|
||||
# embed()
|
||||
# names = get_data_array_names(b)
|
||||
# baseline_voltage = tag.retrieve_data('V-1')[:]
|
||||
|
||||
eods_g, sampling = link_arrays_eod(b, first=tag.position[:][0],
|
||||
second=duration_base,
|
||||
array_name='V-1')
|
||||
|
||||
#embed()
|
||||
axs.plot(np.arange(0, len(eods_g) / sampling, 1 / sampling)*scaling_factor,
|
||||
eods_g, color='grey')
|
||||
if spikes_plotted:
|
||||
if len(spike_times) > 0:
|
||||
axs.scatter(spike_times*scaling_factor, np.percentile(eods_g, 90) * np.ones(len(spike_times)),
|
||||
color='black')
|
||||
axs.scatter(spike_times*scaling_factor,
|
||||
np.percentile(eods_g, 100) * np.ones(len(spike_times)),
|
||||
color='black')
|
||||
|
||||
hists2 = [(np.diff(spike_times) / (1 / eod_fr))]
|
||||
# embed()
|
||||
if len(hists2[0]) > 0:
|
||||
try:
|
||||
np.min(hists2) < 1.5
|
||||
except:
|
||||
print('hist thing')
|
||||
embed()
|
||||
|
||||
if np.min(hists2[0]) < 1.5:
|
||||
burst_corr = '_burstIndividual_'
|
||||
hists2, spikes_ex, frs_calc2 = correct_burstiness(hists2, [spike_times],
|
||||
[eod_fr] * len(
|
||||
[spike_times]),
|
||||
[eod_fr] * len(
|
||||
[spike_times]),
|
||||
lim=lim_here,
|
||||
burst_corr=burst_corr)
|
||||
if spikes_plotted:
|
||||
try:
|
||||
axs.scatter(spikes_ex[0]*scaling_factor,
|
||||
np.percentile(eods_g, 90) * np.ones(len(spikes_ex[0])),
|
||||
color='blue')
|
||||
axs.scatter(spikes_ex[0]*scaling_factor,
|
||||
np.percentile(eods_g, 100) * np.ones(len(spikes_ex[0])),
|
||||
color='blue')
|
||||
except:
|
||||
print('scatter thing')
|
||||
embed()
|
||||
axs.set_xlim(0, xlim)
|
||||
if test:
|
||||
plt.plot(np.arange(0, len(eods_g) / sampling, 1 / sampling)*scaling_factor,
|
||||
eods_g, color='black')
|
||||
plt.scatter(spike_times*scaling_factor,
|
||||
np.percentile(eods_g, 90) * np.ones(len(spike_times)),
|
||||
color='black')
|
||||
if (len(ts) < 1):
|
||||
axs.set_title('no nix')
|
||||
return spike_times_all_full
|
||||
|
||||
|
||||
def find_tags_baseline(b, cont_rlx):
|
||||
try:
|
||||
ts = find_tags_list(b, names='baseline')
|
||||
cont_baseline = True
|
||||
except:
|
||||
print('ts problem')
|
||||
try:
|
||||
ts = find_tags_list(b, names='baseline')
|
||||
cont_baseline = True
|
||||
except:
|
||||
cont_baseline = False
|
||||
cont_rlx = True
|
||||
ts = []
|
||||
return cont_baseline, cont_rlx, ts
|
||||
|
||||
|
||||
def load_f(data_dir, c, cell, dir = ''):
|
||||
cont_rlx = False
|
||||
try:
|
||||
f = nix.File.open(dir +'../data/' + data_dir[c] + '/' + cell + '/' + cell + '.nix', nix.FileMode.ReadOnly)
|
||||
cont_here = True
|
||||
except:
|
||||
f = []
|
||||
cont_here = False
|
||||
cont_rlx = True
|
||||
return f, cont_here, cont_rlx
|