From 8a5b45046a5b23f923399c36de7072df87ad3ad7 Mon Sep 17 00:00:00 2001 From: dylansdaniels-berkeley Date: Tue, 26 Nov 2024 17:56:49 -0500 Subject: [PATCH] add templates for layer-specific PSD and update the Drive-Dipole-Spectrogram (3x1) tempate to point to the layer-specific PSDs --- hnn_core/gui/_viz_manager.py | 39 ++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/hnn_core/gui/_viz_manager.py b/hnn_core/gui/_viz_manager.py index 34748b636..29e28417f 100644 --- a/hnn_core/gui/_viz_manager.py +++ b/hnn_core/gui/_viz_manager.py @@ -26,6 +26,8 @@ 'input histogram', 'spikes', 'PSD', + 'layer 2 PSD', + 'layer 5 PSD', 'spectrogram', 'network', ] @@ -130,8 +132,11 @@ "gridspec_kw": {"height_ratios": [1, 1, 1]} }, "mosaic": "0\n1\n2", - "ax_plots": [("ax0", "layer2 dipole"), ("ax1", "layer5 dipole"), - ("ax2", "PSD")] + "ax_plots": [ + ("ax0", "layer 2 PSD"), + ("ax1", "layer 5 PSD"), + ("ax2", "PSD"), + ] } } @@ -296,6 +301,36 @@ def _update_ax(fig, ax, single_simulation, sim_name, plot_type, plot_config): dpls_copied[0].plot_psd(fmin=min_f, fmax=max_f, ax=ax, color=color, label=sim_name, show=False) + elif plot_type == 'layer 2 PSD': + if len(dpls_copied) > 0: + min_f = plot_config['min_spectral_frequency'] + max_f = plot_config['max_spectral_frequency'] + color = ax._get_lines.get_next_color() + dpls_copied[0].plot_psd( + fmin=min_f, + fmax=max_f, + layer='L2', + color=color, + label=sim_name, + ax=ax, + show=False + ) + + elif plot_type == 'layer 5 PSD': + if len(dpls_copied) > 0: + min_f = plot_config['min_spectral_frequency'] + max_f = plot_config['max_spectral_frequency'] + color = ax._get_lines.get_next_color() + dpls_copied[0].plot_psd( + fmin=min_f, + fmax=max_f, + layer='L5', + color=color, + label=sim_name, + ax=ax, + show=False + ) + elif plot_type == 'spectrogram': if len(dpls_copied) > 0: min_f = plot_config['min_spectral_frequency']