updating figure
This commit is contained in:
parent
169158ae76
commit
0523bb73a4
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 40 KiB |
@ -105,14 +105,14 @@ def nonlin_regime(yposs=[450, 450, 450], freqs=[(39.5, -210.5)], printing=False,
|
||||
|
||||
|
||||
c_grouped = ['c1'] # , 'c2']
|
||||
c_nrs_orig = [0.01,0.025, 0.04, 0.1] # 0.0002, 0.05, 0.5
|
||||
c_nrs_orig = [0.01,0.04, 0.1, 0.2] # 0.0002, 0.05, 0.5
|
||||
trials_nr = 20 # 20
|
||||
redo = False # True
|
||||
log = 'log' # 'log'
|
||||
grid0 = gridspec.GridSpec(1, 1, bottom=0.15, top=0.88, left=0.11,
|
||||
grid0 = gridspec.GridSpec(1, 1, bottom=0.13, top=0.88, left=0.11,
|
||||
right=0.95, wspace=0.04) #
|
||||
grid00 = gridspec.GridSpecFromSubplotSpec(2, 1,
|
||||
wspace=0.04, hspace=0.45,
|
||||
wspace=0.04, hspace=0.75,
|
||||
subplot_spec=grid0[0], height_ratios=[1.5,1],) # height_ratios=[2,1],
|
||||
|
||||
grid_up = gridspec.GridSpecFromSubplotSpec(1, len(c_nrs_orig),
|
||||
@ -219,6 +219,7 @@ def nonlin_regime(yposs=[450, 450, 450], freqs=[(39.5, -210.5)], printing=False,
|
||||
(frame_cell_orig.df1 == freq1) & (frame_cell_orig.df2 == freq2)]
|
||||
c1 = c_dist_recalc_here(c_dist_recalc, frame_cell)
|
||||
ax_u1.set_xlim(0, 25)
|
||||
ax_u1.legend(ncol = 2, loc = (0,1.2))
|
||||
if i != 0:
|
||||
ax_u1.set_ylabel('')
|
||||
remove_yticks(ax_u1)
|
||||
@ -269,7 +270,7 @@ def nonlin_regime(yposs=[450, 450, 450], freqs=[(39.5, -210.5)], printing=False,
|
||||
stimulus_length_here = 0.5
|
||||
stimulus_length_here = values_stimuluslength_model_full()
|
||||
nfft_here = 32768
|
||||
nfft_here = values_nfft_full_model()
|
||||
nfft_here = stimulus_length_here*20000#values_nfft_full_model()
|
||||
else:
|
||||
stimulus_length_here = 50
|
||||
stimulus_length_here = values_stimuluslength_model_full()
|
||||
@ -280,16 +281,21 @@ def nonlin_regime(yposs=[450, 450, 450], freqs=[(39.5, -210.5)], printing=False,
|
||||
nfft_here = 2 ** 14
|
||||
stimulus_length_here = 0.5
|
||||
|
||||
stimulus_length_here = values_stimuluslength_model_full()
|
||||
trials_nr = 1
|
||||
stimulus_length_here = 10#values_stimuluslength_model_full()
|
||||
trials_nr = 10
|
||||
nfft_here = values_nfft_full_model()
|
||||
|
||||
nfft_here = stimulus_length_here * 20000
|
||||
|
||||
# #
|
||||
#
|
||||
|
||||
############################
|
||||
# spikes generierung
|
||||
trials_nr = 10
|
||||
nfft_here = values_nfft_full_model()
|
||||
stimulus_length_here = 1 # values_stimuluslength_model_full()
|
||||
nfft_here = stimulus_length_here * 20000
|
||||
a_f2s = [c_nrs_orig[c_nn]]
|
||||
_, arrays_spikes, arrays_stim, results_diff, position_diff, auci_wo, auci_w, arrays, names, p_arrays_p, ff_p = calc_roc_amp_core_cocktail(
|
||||
_, arrays_spikes, _, _, _, _, _, _, _, _, _ = calc_roc_amp_core_cocktail(
|
||||
[freq1 + eodf], [freq2 + eodf], datapoints, auci_wo, auci_w, results_diff,
|
||||
a_f2s,
|
||||
fish_jammer, trials_nr, nfft_here, us_name, gain, runs, a_fr, nfft_for_morph,
|
||||
@ -299,10 +305,33 @@ def nonlin_regime(yposs=[450, 450, 450], freqs=[(39.5, -210.5)], printing=False,
|
||||
model_cells, position_diff, dev, cell_here, dev_name=dev_name,
|
||||
a_f1s=[c_nrs_orig[c_nn]],
|
||||
n=n,
|
||||
reshuffled=reshuffled, min_amps=min_amps)
|
||||
reshuffled=reshuffled, min_amps=min_amps, mean_choice = '')
|
||||
|
||||
###########################
|
||||
# psd generierung
|
||||
trials_nr = 1
|
||||
nfft_here = values_nfft_full_model()
|
||||
stimulus_length_here = 100 # values_stimuluslength_model_full()
|
||||
nfft_here = stimulus_length_here * 20000
|
||||
a_f2s = [c_nrs_orig[c_nn]]
|
||||
a_f2s = [c_nrs_orig[c_nn]]
|
||||
_, _, arrays_stim, results_diff, position_diff, auci_wo, auci_w, arrays, names, p_arrays_p, ff_p = calc_roc_amp_core_cocktail(
|
||||
[freq1 + eodf], [freq2 + eodf], datapoints, auci_wo, auci_w, results_diff,
|
||||
a_f2s,
|
||||
fish_jammer, trials_nr, nfft_here, us_name, gain, runs, a_fr, nfft_for_morph,
|
||||
beat,
|
||||
printing,
|
||||
stimulus_length_here,
|
||||
model_cells, position_diff, dev, cell_here, dev_name=dev_name,
|
||||
a_f1s=[c_nrs_orig[c_nn]],
|
||||
n=n,
|
||||
reshuffled=reshuffled, min_amps=min_amps, mean_choice = 'first')
|
||||
|
||||
##################################################################
|
||||
# ff_p, arrays, names, p_arrays_p, arrays_spikes, arrays_stim,
|
||||
p_arrays_here = [p_arrays_p[3]]
|
||||
xlimp = (0, 300)
|
||||
#embed()
|
||||
for p in range(len(p_arrays_here)):
|
||||
p_arrays_here[p][0] = p_arrays_here[p][0][ff_p < xlimp[1]]
|
||||
|
||||
@ -330,9 +359,9 @@ def nonlin_regime(yposs=[450, 450, 450], freqs=[(39.5, -210.5)], printing=False,
|
||||
else:
|
||||
freqs = [np.abs(freq1), np.abs(freq2)]
|
||||
grid_pt = gridspec.GridSpecFromSubplotSpec(2, 1,
|
||||
hspace=0.3,
|
||||
hspace=0.2,
|
||||
wspace=0.2,
|
||||
subplot_spec=grid_up[a, c_nn],
|
||||
subplot_spec=grid_up[a, c_nn], height_ratios = [1,2]
|
||||
) # hspace=0.4,wspace=0.2,len(chirps)
|
||||
|
||||
stim = False
|
||||
@ -355,7 +384,7 @@ def nonlin_regime(yposs=[450, 450, 450], freqs=[(39.5, -210.5)], printing=False,
|
||||
int(np.round(c_nrs[c_nn]))) + '$\%$' + ',\,$c_{2}=%s$' % (
|
||||
int(np.round(a_f2_cm[0]))) + '$\%$' # +'$'
|
||||
|
||||
plt.suptitle(f_vary_name(freq=int(freq1), delta=True)+f_stable_name(freq=int(freq2), delta=True))
|
||||
plt.suptitle(f_vary_name(freq=int(freq1), delta=True)+' '+f_stable_name(freq=int(freq2), delta=True))
|
||||
title_name = beat_here # fish + '\n' + +c1+c2#twobeat_cond(big=True, double=True,cond=False)
|
||||
|
||||
|
||||
@ -367,7 +396,7 @@ def nonlin_regime(yposs=[450, 450, 450], freqs=[(39.5, -210.5)], printing=False,
|
||||
plt_spikes_ROC(axs, 'grey', np.array(arrays_sp[a]) * 1000, xlim, lw=1)
|
||||
|
||||
axs.text(1, 1.1, title_name, va='bottom', ha='right',
|
||||
transform=axt.transAxes)
|
||||
transform=axs.transAxes)
|
||||
|
||||
spikes = False
|
||||
if spikes:
|
||||
@ -377,15 +406,15 @@ def nonlin_regime(yposs=[450, 450, 450], freqs=[(39.5, -210.5)], printing=False,
|
||||
plt_vmem_saturation(a, arrays_sp, arrays_time, axt, colors_array_here, f,
|
||||
time, xlim=xlim)
|
||||
|
||||
|
||||
if c_nn == 0:
|
||||
axt.show_spines('')
|
||||
axt.xscalebar(0.1, -0.1, 30, 'ms', va='right', ha='bottom')
|
||||
axt.yscalebar(-0.02, 0.35, 200, 'Hz', va='left', ha='top')
|
||||
|
||||
axp = plt.subplot(grid_pt[-1])
|
||||
axps.append(axp)
|
||||
|
||||
if c_nn == 0:
|
||||
axt.show_spines('')
|
||||
axt.xscalebar(0.1, -0.1, 30, 'ms', va='right', ha='bottom')
|
||||
axt.yscalebar(-0.02, 0.35, 200, 'Hz', va='left', ha='top')
|
||||
|
||||
|
||||
f_counter += 1
|
||||
|
||||
@ -396,6 +425,7 @@ def nonlin_regime(yposs=[450, 450, 450], freqs=[(39.5, -210.5)], printing=False,
|
||||
ff_p = np.load(name_psd_f) # p_arrays_p
|
||||
p_arrays_all = np.load(name_psd) # p_arrays_p'''
|
||||
|
||||
pps = []
|
||||
for c_nn, c_nr in enumerate(c_nrs):
|
||||
for a in range(len(arrays_here)):
|
||||
|
||||
@ -403,6 +433,7 @@ def nonlin_regime(yposs=[450, 450, 450], freqs=[(39.5, -210.5)], printing=False,
|
||||
axp = axps_here[a][c_nn]
|
||||
pp = log_calc_psd(log, p_arrays_all[c_nn][a][0],
|
||||
np.nanmax(p_arrays_all))
|
||||
pps.append(pp)
|
||||
|
||||
colors_peaks = [color01, color02, color012, color01_2]
|
||||
markeredgecolors = [color01, color02, color012, color01_2]
|
||||
@ -433,24 +464,27 @@ def nonlin_regime(yposs=[450, 450, 450], freqs=[(39.5, -210.5)], printing=False,
|
||||
else:
|
||||
axp.set_ylabel(power_spectrum_name())
|
||||
axp.set_xlabel('Frequency [Hz]')
|
||||
|
||||
#if c_nn == 0:
|
||||
# axp.legend(ncol = 4, loc = (0, 1))#ncols = 4
|
||||
#a#xts_all.extend(axts)
|
||||
#axps_all.extend(axps)
|
||||
|
||||
#embed()
|
||||
#ax_us[-1].legend(loc=(-2.22, 1.2), ncol=2, handlelength=2.5) # -0.07loc=(0.4,1)
|
||||
|
||||
#axts_all[0].get_shared_y_axes().join(*axts_all)
|
||||
#axts_all[0].get_shared_x_axes().join(*axts_all)
|
||||
#axps_all[0].get_shared_y_axes().join(*axps_all)
|
||||
#axps_all[0].get_shared_x_axes().join(*axps_all)
|
||||
axts[0].get_shared_y_axes().join(*axts)
|
||||
axts[0].get_shared_x_axes().join(*axts)
|
||||
#axts[0].get_shared_y_axes().join(*axts)
|
||||
#axts[0].get_shared_x_axes().join(*axts)
|
||||
axps[0].get_shared_y_axes().join(*axps)
|
||||
axps[0].get_shared_x_axes().join(*axps)
|
||||
join_y(axts)
|
||||
set_same_ylim(axts)
|
||||
#join_y(axts)
|
||||
#set_same_ylim(axts)
|
||||
set_same_ylim(axps)
|
||||
join_x(axts)
|
||||
|
||||
#join_x(axts)
|
||||
#join_x(ax_us)
|
||||
#join_y(ax_us)
|
||||
fig = plt.gcf()
|
||||
|
@ -441,7 +441,7 @@ Theoretical work on leaky integrate-and-fire and conductance-based models sugges
|
||||
|
||||
\begin{figure*}[t]
|
||||
\includegraphics[width=\columnwidth]{nonlin_regime}
|
||||
\caption{\label{fig:nonlin_regime} }
|
||||
\caption{\label{fig:nonlin_regime} The model used has the identifier 2013-01-08-aa.}
|
||||
\end{figure*}
|
||||
|
||||
Without any external stimulation, a P-unit fires action potentials at a spontaneous baseline rate \fbase{} to the fish's own EOD of frequency \feod{}. Accordingly, a peak at \fbase{} is present in the power spectrum of this baseline activity (\subfigrefb{fig:motivation}{A}). Superposition of the receiver's EOD with an EOD of another fish with frequency $f_1$ results in a beat, a periodic amplitude modulation of the receiver's EOD. The frequency of the beat is given by the difference frequency $\Delta f_1 = f_1 - \feod$ between the two fish. P-units encode this beat in their firing rate \citep{Bastian1981a,Barayeu2023} and consequently a peak at this beat frequency appears the the power spectrum of the response (\subfigrefb{fig:motivation}{B}). A second peak at the first harmonic indicates a nonlinear response that here is easily identified by the clipping of the P-unit's firing rate at zero. Pairing the fish with another fish with a higher beat frequency $\Delta f_2 = f_2 - \feod$ results in a weaker response with a single peak in the response power spectrum (\subfigrefb{fig:motivation}{C}). Note that $\Delta f_2$ has been choosen to match the P-unit's baseline firing rate.
|
||||
|
@ -441,7 +441,7 @@ Theoretical work on leaky integrate-and-fire and conductance-based models sugges
|
||||
|
||||
\begin{figure*}[t]
|
||||
\includegraphics[width=\columnwidth]{nonlin_regime}
|
||||
\caption{\label{fig:nonlin_regime} }
|
||||
\caption{\label{fig:nonlin_regime} The model used has the identifier 2013-01-08-aa.}
|
||||
\end{figure*}
|
||||
|
||||
Without any external stimulation, a P-unit fires action potentials at a spontaneous baseline rate \fbase{} to the fish's own EOD of frequency \feod{}. Accordingly, a peak at \fbase{} is present in the power spectrum of this baseline activity (\subfigrefb{fig:motivation}{A}). Superposition of the receiver's EOD with an EOD of another fish with frequency $f_1$ results in a beat, a periodic amplitude modulation of the receiver's EOD. The frequency of the beat is given by the difference frequency $\Delta f_1 = f_1 - \feod$ between the two fish. P-units encode this beat in their firing rate \citep{Bastian1981a,Barayeu2023} and consequently a peak at this beat frequency appears the the power spectrum of the response (\subfigrefb{fig:motivation}{B}). A second peak at the first harmonic indicates a nonlinear response that here is easily identified by the clipping of the P-unit's firing rate at zero. Pairing the fish with another fish with a higher beat frequency $\Delta f_2 = f_2 - \feod$ results in a weaker response with a single peak in the response power spectrum (\subfigrefb{fig:motivation}{C}). Note that $\Delta f_2$ has been choosen to match the P-unit's baseline firing rate.
|
||||
@ -508,7 +508,7 @@ We estimated the second-order susceptibility of P-unit responses using RAM stimu
|
||||
\notejb{add tick at 100Hz in E \& F}
|
||||
\notejb{C-F tags a bit lower, D\&F tag closer to yaxis}
|
||||
\notejb{What do we want in B? square or linear or dB, noise split as in A, or stimulus as in C-F }
|
||||
\caption{\label{fig:model_full} Using second-order susceptibility to predict responses to sine-wave stimuli. \figitem[]{A} Absolute value of the second-order susceptibility, \Eqnref{eq:susceptibility}, for both positive and negative frequencies. \susceptf{} was estimated from $N=10^6$ trials of model simulations in the noise-split condition (cell 2012-07-03-ak, see table~\ref{modelparams} for model parameters). White lines indicate zero frequencies. Nonlinear responses at \fsum{} are quantified in the upper right and lower left quadrants. Nonlinear responses at \fdiff{} are quantified in the upper left and lower right quadrants. Baseline firing rate of this cell was at $\fbase=120$\,Hz. The position of the orange/red letters correspond to the beat frequencies used for the stimulation with pure sine-waves in the subsequent panels and indicate the sum/difference of those beat frequencies. \figitem[]{B} Absolute value of the first-order susceptibility. \figitem{C--F} Black line -- power spectral density of model simulations in response to stimulation with two pure sine waves, \fone{} and \ftwo, in addition to the receiving fish's own EOD (three fish scenario). The contrasts of beat beats is 0.0065. Colored circles highlight the height of selected peaks in the power spectrum. Black circles highlight the peak height that can be predicted from \panel{A, B}. Grey line -- power spectral density of model in the baseline condition. \figitem{B} The sum of the two beat frequencies match \fbase{}. \figitem{C} The difference of \fone{} and \ftwo{} match \fbase{}. \figitem{D} Only the first beat frequency matches \fbase{}. \figitem{C} None of the two beat frequencies matches \fbase{}. \noteab{Für die Transfer Funktion habe ich jetzt einen Faktor 1, für die Nichtlinearität einen Faktor 30, aber vielleicht wenn ich über mehrere Punkte mitteln muss und das alles so noisy ist das eben noch keine Gute Abschätzung in der Stauration?}}
|
||||
\caption{\label{fig:model_full} Using second-order susceptibility to predict responses to sine-wave stimuli. \figitem[]{A} Absolute value of the second-order susceptibility, \Eqnref{eq:susceptibility}, for both positive and negative frequencies. \susceptf{} was estimated from $N=10^6$ trials of model simulations in the noise-split condition (cell 2013-01-08-aa, see table~\ref{modelparams} for model parameters). White lines indicate zero frequencies. Nonlinear responses at \fsum{} are quantified in the upper right and lower left quadrants. Nonlinear responses at \fdiff{} are quantified in the upper left and lower right quadrants. Baseline firing rate of this cell was at $\fbase=120$\,Hz. The position of the orange/red letters correspond to the beat frequencies used for the stimulation with pure sine-waves in the subsequent panels and indicate the sum/difference of those beat frequencies. \figitem[]{B} Absolute value of the first-order susceptibility. \figitem{C--F} Black line -- power spectral density of model simulations in response to stimulation with two pure sine waves, \fone{} and \ftwo, in addition to the receiving fish's own EOD (three fish scenario). The contrasts of beat beats is 0.0065. Colored circles highlight the height of selected peaks in the power spectrum. Black circles highlight the peak height that can be predicted from \panel{A, B}. Grey line -- power spectral density of model in the baseline condition. \figitem{B} The sum of the two beat frequencies match \fbase{}. \figitem{C} The difference of \fone{} and \ftwo{} match \fbase{}. \figitem{D} Only the first beat frequency matches \fbase{}. \figitem{C} None of the two beat frequencies matches \fbase{}. \noteab{Für die Transfer Funktion habe ich jetzt einen Faktor 1, für die Nichtlinearität einen Faktor 30, aber vielleicht wenn ich über mehrere Punkte mitteln muss und das alles so noisy ist das eben noch keine Gute Abschätzung in der Stauration?}}
|
||||
\end{figure*}
|
||||
|
||||
However, the second-order susceptibility \Eqnref{eq:susceptibility} is a spectral measure that is based on Fourier transforms and thus is also defined for negative stimulus frequencies. The full \susceptf{} matrix is symmetric with respect to the origin. In the upper-right and lower-left quadrants of \susceptf{}, stimulus-evoked responses at \fsum{} are shown, whereas in the lower-right and upper-left quadrants nonlinear responses at the difference \fdiff{} are shown (\figref{fig:model_full}). The vertical and horizontal lines at \foneb{} and \ftwob{} are very pronounced in the upper-right quadrant of \subfigrefb{fig:model_full}{A} for nonlinear responses at \fsum{} and extend into the upper-left quadrant (representing \fdiff) where they fade out towards more negative $f_1$ frequencies. The peak in the response power-spectrum at \fdiff{} evoked by pure sine-wave stimulation (\subfigrefb{fig:motivation}{D}) is predicted by the horizontal line in the upper-left quadrant (\subfigrefb{fig:model_full}{A}, \citep{Schlungbaum2023}).
|
||||
@ -893,7 +893,7 @@ CVs in P-units can range up to 1.5 \citep{Grewe2017, Hladnik2023}. We show the s
|
||||
\notejb{sort the legend labels!}
|
||||
\notejb{one of the 99.99\% percentiles is enough}
|
||||
\notejb{add $10^7$ tick on x-axis}
|
||||
\caption{\label{fig:trialnr} Dependence of the estimate of the second-order susceptibility on the number of trials $\n$. While the estimate of the noise floor (10th and 90th percentile) of the $|\chi_2(f_1, f_2)|$ matrix does not saturate yet, the estimates of the high values in the matrix that make up the characteristic ridges saturate for $N>10^6$.
|
||||
\caption{\label{fig:trialnr} Dependence of the estimate of the second-order susceptibility on the number of trials $\n$. While the estimate of the noise floor (10th and 90th percentile) of the $|\chi_2(f_1, f_2)|$ matrix does not saturate yet, the estimates of the high values in the matrix that make up the characteristic ridges saturate for $N>10^6$. The model used has the identifier 2013-01-08-aa.
|
||||
}
|
||||
\end{figure*}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user