added simulation data

This commit is contained in:
2025-05-16 09:41:11 +02:00
parent 273b7a04ae
commit f1883a834b
239 changed files with 69 additions and 22 deletions

View File

@@ -6,7 +6,8 @@ from pathlib import Path
from plotstyle import plot_style, labels_params, significance_str
data_path = Path('newdata3')
data_path = Path('data')
sims_path = data_path / 'simulations'
def sort_files(cell_name, all_files, n):
@@ -71,11 +72,11 @@ def plot_chi2(ax, s, data_file):
def plot_chi2_contrasts(axs, s, cell_name):
print(cell_name)
files, nums = sort_files(cell_name,
data_path.glob(f'chi2-split-{cell_name}-*.npz'), 1)
sims_path.glob(f'chi2-split-{cell_name}-*.npz'), 1)
plot_chi2(axs[0], s, files[-1])
for k, alphastr in enumerate(['010', '030', '100']):
files, nums = sort_files(cell_name,
data_path.glob(f'chi2-noisen-{cell_name}-{alphastr}-*.npz'), 2)
sims_path.glob(f'chi2-noisen-{cell_name}-{alphastr}-*.npz'), 2)
plot_chi2(axs[k + 1], s, files[-1])
@@ -114,9 +115,9 @@ def plot_nli_cv(ax, s, data, alpha, cells):
ax.set_xlabel('CV$_{\\rm base}$')
ax.set_ylabel('SI')
ax.set_yticks_delta(4)
ax.text(1, 0.9, f'$r={r:.2f}$', transform=ax.transAxes,
ax.text(1, 0.9, f'$R={r:.2f}$', transform=ax.transAxes,
ha='right', fontsize='small')
ax.text(1, 0.7, significance_str(p), transform=ax.transAxes,
ax.text(1, 0.75, significance_str(p), transform=ax.transAxes,
ha='right', fontsize='small')
if alpha == 0:
ax.legend(loc='upper left', bbox_to_anchor=(1.15, 1.05),
@@ -134,7 +135,7 @@ def plot_nli_cv(ax, s, data, alpha, cells):
def plot_summary_contrasts(axs, s, cells):
nli_thresh = 1.2
data = TableData('summarychi2noise.csv')
data = TableData(data_path / 'Apteronotus_leptorhynchus-Punit-models.csv')
plot_nli_cv(axs[0], s, data, 0, cells)
print('split:')
nli_split = data[data('contrast') == 0, 'dnli']
@@ -168,7 +169,7 @@ if __name__ == '__main__':
#labels_params(xlabelloc='right', ylabelloc='top')
fig, axs = plt.subplots(6, 4, cmsize=(s.plot_width, 0.95*s.plot_width),
height_ratios=[1, 1, 1, 1, 0, 1])
fig.subplots_adjust(leftm=7, rightm=8, topm=2, bottomm=3.5,
fig.subplots_adjust(leftm=7, rightm=9, topm=2, bottomm=3.5,
wspace=1, hspace=0.7)
for ax in axs.flat:
ax.set_visible(False)