Skip to content

Commit

Permalink
add templates for layer-specific PSD and update the Drive-Dipole-Spec…
Browse files Browse the repository at this point in the history
…trogram (3x1) tempate to point to the layer-specific PSDs
  • Loading branch information
dylansdaniels committed Nov 26, 2024
1 parent b988c7f commit 8a5b450
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions hnn_core/gui/_viz_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
'input histogram',
'spikes',
'PSD',
'layer 2 PSD',
'layer 5 PSD',
'spectrogram',
'network',
]
Expand Down Expand Up @@ -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"),
]
}
}

Expand Down Expand Up @@ -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']
Expand Down

0 comments on commit 8a5b450

Please sign in to comment.