|
@@ -23,6 +23,7 @@ def plot_tuning_curve(traj, direction_idx):
|
|
|
|
|
|
fig, ax = plt.subplots(1, 1)
|
|
|
for run_idx, run_name in enumerate(traj.f_get_run_names()):
|
|
|
+ label = traj.derived_parameters.runs[run_name].morphology.morph_label
|
|
|
|
|
|
ex_tunings = traj.results.runs[run_name].ex_tunings
|
|
|
# ex_positions = traj.f_get('ex_positions')
|
|
@@ -33,9 +34,6 @@ def plot_tuning_curve(traj, direction_idx):
|
|
|
sort_ids = ex_tunings_plt.argsort()
|
|
|
ex_tunings_plt = ex_tunings_plt[sort_ids]
|
|
|
|
|
|
- #TODO: label
|
|
|
- label = 'still to be done'
|
|
|
-
|
|
|
firing_rate_array = traj.results[run_name].firing_rate_array
|
|
|
# firing_rate_array = traj.f_get('firing_rate_array')
|
|
|
|
|
@@ -52,36 +50,39 @@ def plot_tuning_curve(traj, direction_idx):
|
|
|
ax.legend()
|
|
|
ax.set_xlabel("Angles (rad)")
|
|
|
ax.set_ylabel("f (Hz)")
|
|
|
-
|
|
|
- plt.show()
|
|
|
+ ax.set_title('tuning curves', fontsize=16)
|
|
|
|
|
|
def plot_firing_rate_map(traj, direction_idx):
|
|
|
|
|
|
fig, axes = plt.subplots(1, 2, figsize=(13.5, 4.5))
|
|
|
for ax, run_name in zip(axes,traj.f_get_run_names()):
|
|
|
+ label = traj.derived_parameters.runs[run_name].morphology.morph_label
|
|
|
+
|
|
|
X, Y = get_position_mesh(traj.results.runs[run_name].ex_positions)
|
|
|
firing_rate_array = traj.results[run_name].firing_rate_array
|
|
|
number_of_excitatory_neurons_per_row = int(np.sqrt(traj.N_E))
|
|
|
c = ax.pcolor(X, Y, np.reshape(firing_rate_array[:, direction_idx], (number_of_excitatory_neurons_per_row,
|
|
|
number_of_excitatory_neurons_per_row)), vmin=0, cmap='hot')
|
|
|
- ax.set_title('to be done')
|
|
|
+ ax.set_title(label)
|
|
|
fig.colorbar(c, ax=ax, label="f (Hz)")
|
|
|
+ fig.suptitle('spatial firing rate map', fontsize=16)
|
|
|
|
|
|
- plt.show()
|
|
|
|
|
|
def plot_spatial_hdi_map(traj):
|
|
|
|
|
|
fig, axes = plt.subplots(1, 2, figsize=(13.5, 4.5))
|
|
|
for ax, run_name in zip(axes,traj.f_get_run_names()):
|
|
|
+ label = traj.derived_parameters.runs[run_name].morphology.morph_label
|
|
|
+
|
|
|
X, Y = get_position_mesh(traj.results.runs[run_name].ex_positions)
|
|
|
head_direction_indices = traj.results[run_name].head_direction_indices
|
|
|
number_of_excitatory_neurons_per_row = int(np.sqrt(traj.N_E))
|
|
|
c = ax.pcolor(X, Y, np.reshape(head_direction_indices, (number_of_excitatory_neurons_per_row,
|
|
|
number_of_excitatory_neurons_per_row)), vmin=0, cmap='hot')
|
|
|
- ax.set_title('to be done')
|
|
|
+ ax.set_title(label)
|
|
|
fig.colorbar(c, ax=ax, label="f (Hz)")
|
|
|
+ fig.suptitle('spatial HDI map', fontsize=16)
|
|
|
|
|
|
- plt.show()
|
|
|
|
|
|
def plot_neural_sheet(traj):
|
|
|
|
|
@@ -91,6 +92,8 @@ def plot_neural_sheet(traj):
|
|
|
for ax, run_name in zip(axes, traj.f_get_run_names()):
|
|
|
traj.f_set_crun(run_name)
|
|
|
|
|
|
+ label = traj.derived_parameters.runs[run_name].morphology.morph_label
|
|
|
+
|
|
|
X, Y = get_position_mesh(traj.results.runs[run_name].ex_positions)
|
|
|
|
|
|
inhibitory_axonal_cloud_array = traj.results.runs[run_name].inhibitory_axonal_cloud_array
|
|
@@ -99,7 +102,7 @@ def plot_neural_sheet(traj):
|
|
|
|
|
|
head_dir_preference = np.array(traj.results.runs[run_name].ex_tunings).reshape((n_ex, n_ex))
|
|
|
c = ax.pcolor(X, Y, head_dir_preference.T, vmin=-np.pi, vmax=np.pi, cmap='twilight')
|
|
|
- ax.set_title('to be done')
|
|
|
+ ax.set_title(label)
|
|
|
fig.colorbar(c, ax=ax, label="Tuning")
|
|
|
|
|
|
|
|
@@ -107,7 +110,7 @@ def plot_neural_sheet(traj):
|
|
|
for i, p in enumerate(axonal_clouds):
|
|
|
ell = p.get_ellipse()
|
|
|
ax.add_artist(ell)
|
|
|
- plt.show()
|
|
|
+ fig.suptitle('axonal cloud', fontsize=16)
|
|
|
|
|
|
def plot_degree_on_sheet(traj):
|
|
|
n_ex = int(np.sqrt(traj.N_E))
|
|
@@ -116,19 +119,18 @@ def plot_degree_on_sheet(traj):
|
|
|
for ax, run_name in zip(axes, traj.f_get_run_names()):
|
|
|
traj.f_set_crun(run_name)
|
|
|
|
|
|
+ label = traj.derived_parameters.runs[run_name].morphology.morph_label
|
|
|
X, Y = get_position_mesh(traj.results.runs[run_name].ex_positions)
|
|
|
|
|
|
number_of_excitatory_neurons_per_row = int(np.sqrt(traj.N_E))
|
|
|
ie_adjacency = traj.results.runs[run_name].ie_adjacency
|
|
|
- print(ie_adjacency.shape)
|
|
|
exc_degree = np.sum(ie_adjacency,axis=0)
|
|
|
- print(exc_degree)
|
|
|
c = ax.pcolor(X, Y, np.reshape(exc_degree, (number_of_excitatory_neurons_per_row,
|
|
|
number_of_excitatory_neurons_per_row)), cmap='twilight')
|
|
|
- ax.set_title('to be done')
|
|
|
+ ax.set_title(label)
|
|
|
fig.colorbar(c, ax=ax, label="Tuning")
|
|
|
+ fig.suptitle('in/out-degree', fontsize=16)
|
|
|
|
|
|
- plt.show()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
traj = Trajectory(TRAJ_NAME, add_time=False, dynamic_imports=Brian2MonitorResult)
|
|
@@ -139,14 +141,16 @@ if __name__ == "__main__":
|
|
|
|
|
|
direction_idx = 6
|
|
|
|
|
|
- # plot_tuning_curve(traj, direction_idx)
|
|
|
+ plot_tuning_curve(traj, direction_idx)
|
|
|
|
|
|
- # plot_firing_rate_map(traj, direction_idx)
|
|
|
+ plot_firing_rate_map(traj, direction_idx)
|
|
|
|
|
|
- # plot_spatial_hdi_map(traj)
|
|
|
+ plot_spatial_hdi_map(traj)
|
|
|
|
|
|
- # plot_neural_sheet(traj)
|
|
|
+ plot_neural_sheet(traj)
|
|
|
|
|
|
plot_degree_on_sheet(traj)
|
|
|
|
|
|
+ plt.show()
|
|
|
+
|
|
|
traj.f_restore_default()
|