Skip to content

Commit

Permalink
viz utils
Browse files Browse the repository at this point in the history
  • Loading branch information
Rama Vasudevan committed Nov 13, 2023
1 parent 4d8cfc2 commit a5385fb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions BGlib/be/viz/be_viz_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ def jupyter_visualize_be_spectrograms(pc_main, cmap=None):
x_size = pos_dims[-1]
y_size = pos_dims[-2]

spatial_map = np.abs(np.reshape(pc_main[:, 0][spatial_slice], (y_size, x_size)))
spatial_map = np.abs(np.reshape(pc_main[spatial_slice, 0], (y_size, x_size)))
spectrogram = np.reshape(pc_main[0], (num_udvs_steps, -1))
fig, axes = plt.subplots(ncols=3, figsize=(12, 4), subplot_kw={'adjustable': 'box'})
Expand Down Expand Up @@ -605,7 +606,7 @@ def spec_index_unpacker(step):

spatial_slice, _ = pc_main._get_pos_spec_slices(slice_dict=spatial_slice_dict)

spatial_map = np.abs(np.reshape(pc_main[spatial_slice, step], (x_size, y_size)))
spatial_map = np.abs(np.reshape(pc_main[:, step][spatial_slice], (x_size, y_size)))
spatial_img.set_data(spatial_map)
spat_mean = np.mean(spatial_map)
spat_std = np.std(spatial_map)
Expand Down Expand Up @@ -637,7 +638,8 @@ def pos_picker(event):
axes[2].set_title('Phase \n' + pos_heading)

spectrogram = np.reshape(pc_main[spatial_slice, :], (num_udvs_steps, -1))

print('spectrogram shape is {}'.format(spectrogram.shape))
print(spectrogram)
if len(spec_dims) > 1:
amp_map = np.abs(spectrogram)
amp_img.set_data(np.abs(spectrogram))
Expand Down

0 comments on commit a5385fb

Please sign in to comment.