changed example punit
This commit is contained in:
@@ -7,9 +7,8 @@ from punitexamplecell import load_baseline, load_noise, load_spectra
|
||||
from punitexamplecell import plot_colorbar
|
||||
|
||||
|
||||
cell_name = '2012-05-15-ac'
|
||||
run1 = 3 # 4
|
||||
run2 = 1
|
||||
example_cell = [['2012-05-15-ac', 3],
|
||||
['2012-05-15-ac', 1]]
|
||||
|
||||
example_cells = [
|
||||
['2010-11-26-an', 0],
|
||||
@@ -37,9 +36,10 @@ def plot_isih2(ax, s, rate, cv, isis, pdf):
|
||||
ax.show_spines('b')
|
||||
ax.fill_between(1000*isis, pdf, facecolor=s.cell_color1)
|
||||
ax.set_xlim(0, 20)
|
||||
ax.set_xticks_delta(5)
|
||||
ax.set_xticks_blank()
|
||||
#ax.set_xlabel('ISI', 'ms')
|
||||
#ax.set_xticks_delta(5)
|
||||
#ax.set_xticks_blank()
|
||||
#ax.set_xticks_fixed([0, 5, 10, 15, 20], ['0', '', '', '', '20\\,ms'])
|
||||
ax.set_xticks_fixed([0, 5, 10, 15, 20], ['0', '5', '10', '15', '20\\,ms'])
|
||||
ax.text(1, 1.1, f'CV$_{{\\rm base}}$={cv:.2f}', ha='right',
|
||||
transform=ax.transAxes)
|
||||
ax.text(1, 0.6, f'$r={rate:.0f}$Hz', ha='right', transform=ax.transAxes)
|
||||
@@ -154,26 +154,33 @@ def plot_diagonals(ax, s, fbase, contrast1, freqs1, chi21, contrast2, freqs2, ch
|
||||
if __name__ == '__main__':
|
||||
"""
|
||||
from thunderlab.tabledata import TableData
|
||||
data = TableData('Apteronotus_leptorhynchus-Ampullary-data.csv')
|
||||
data = data[(data('fcutoff') > 140) & (data('fcutoff') < 160), :]
|
||||
data = data[(data('nli') > 2) & (data('nli') < 2.5), :]
|
||||
data = data[(data('respmod2') > 20) & (data('respmod2') < 100), :]
|
||||
data = data[(data('cvbase') > 0.05) & (data('cvbase') < 0.2), :]
|
||||
data = data[(data('ratebase') > 100) & (data('ratebase') < 180), :]
|
||||
data = TableData('data/Apteronotus_leptorhynchus-Ampullary-data.csv')
|
||||
data = data[(data['fcutoff'] > 140) & (data['fcutoff'] < 160), :]
|
||||
data = data[(data['nli'] > 2) & (data['nli'] < 2.5), :]
|
||||
data = data[(data['respmod2'] > 20) & (data['respmod2'] < 100), :]
|
||||
data = data[(data['cvbase'] > 0.05) & (data['cvbase'] < 0.2), :]
|
||||
data = data[(data['ratebase'] > 100) & (data['ratebase'] < 180), :]
|
||||
for k in range(data.rows()):
|
||||
print(f'{data[k, "cell"]:<22s} s{data[k, "stimindex"]:02.0f}: {100*data[k, "contrast"]:3g}%, {data[k, "respmod2"]:3.0f}Hz, nli={data[k, "nli"]:5.2f}')
|
||||
print(f'{data[k, "cell"]:<22s} s{data[k, "stimindex"]:02.0f}: '
|
||||
f'{100*data[k, "contrast"]:3g}%, {data[k, "respmod2"]:3.0f}Hz, '
|
||||
f'nli={data[k, "nli"]:5.2f}')
|
||||
print()
|
||||
#exit()
|
||||
exit()
|
||||
"""
|
||||
|
||||
cell_name = example_cell[0][0]
|
||||
print('Example Ampullary cell:', cell_name)
|
||||
eodf, rate, cv, isis, pdf, freqs, prr = load_baseline(data_path, cell_name)
|
||||
print(f' baseline firing rate: {rate:.0f}Hz')
|
||||
print(f' baseline firing CV : {cv:.2f}')
|
||||
contrast1, time1, stimulus1, spikes1 = load_noise(data_path, cell_name, run1)
|
||||
contrast2, time2, stimulus2, spikes2 = load_noise(data_path, cell_name, run2)
|
||||
fcutoff1, contrast1, freqs1, gain1, chi21 = load_spectra(data_path, cell_name, run1)
|
||||
fcutoff2, contrast2, freqs2, gain2, chi22 = load_spectra(data_path, cell_name, run2)
|
||||
contrast1, time1, stimulus1, spikes1 = load_noise(data_path,
|
||||
*example_cell[0])
|
||||
contrast2, time2, stimulus2, spikes2 = load_noise(data_path,
|
||||
*example_cell[1])
|
||||
fcutoff1, contrast1, freqs1, gain1, chi21 = load_spectra(data_path,
|
||||
*example_cell[0])
|
||||
fcutoff2, contrast2, freqs2, gain2, chi22 = load_spectra(data_path,
|
||||
*example_cell[1])
|
||||
|
||||
s = plot_style()
|
||||
s.cell_color1 = s.ampul_color1
|
||||
@@ -183,7 +190,7 @@ if __name__ == '__main__':
|
||||
s.psC1 = s.psA1
|
||||
s.psC2 = s.psA2
|
||||
fig, (ax1, ax2, ax3) = \
|
||||
plt.subplots(3, 1, height_ratios=[3, 0, 3, 0.2, 4.5],
|
||||
plt.subplots(3, 1, height_ratios=[3, 0, 3, 0.2, 4.7],
|
||||
cmsize=(s.plot_width, 0.85*s.plot_width))
|
||||
fig.subplots_adjust(leftm=8, rightm=9, topm=2, bottomm=4,
|
||||
wspace=0.4, hspace=0.4)
|
||||
@@ -191,7 +198,7 @@ if __name__ == '__main__':
|
||||
axg, axc1, axc2, axd = ax2.subplots(1, 4, wspace=0.4)
|
||||
axg = axg.subplots(1, 1, width_ratios=[1, 0.1])
|
||||
axd = axd.subplots(1, 1, width_ratios=[0.2, 1])
|
||||
axs = ax3.subplots(2, 4, wspace=0.4, hspace=0.2, height_ratios=[1, 4])
|
||||
axs = ax3.subplots(2, 4, wspace=0.4, hspace=0.35, height_ratios=[1, 4])
|
||||
|
||||
plot_isih(axi, s, rate, cv, isis, pdf)
|
||||
plot_response_spectrum(axp, s, eodf, rate, freqs, prr)
|
||||
@@ -232,8 +239,8 @@ if __name__ == '__main__':
|
||||
axs[0, 0].text(0, 1.6, 'Ampullary cells:', transform=axs[0, 0].transAxes,
|
||||
color=s.cell_color1,
|
||||
fontsize='large')
|
||||
axs[0, -1].text(0.97, -0.45, '5\\,ms', ha='right',
|
||||
transform=axs[0, -1].transAxes)
|
||||
#axs[0, -1].text(0.97, -0.45, '5\\,ms', ha='right',
|
||||
# transform=axs[0, -1].transAxes)
|
||||
plot_colorbar(axs[1, -1], pc, 0.4)
|
||||
fig.common_yticks(axs[1, :])
|
||||
fig.tag([axs[0, :]], xoffs=-3, yoffs=1)
|
||||
|
||||
Reference in New Issue
Block a user