Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions synapse/cli/offline_hdf5_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,11 @@ def plot(plot_data, console):
plot_single.showGrid(x=True, y=True)

# Create a curve for the single channel
initial_data = plot_data.data.iloc[:, 0].to_numpy()
initial_data_centered = initial_data - np.mean(initial_data)
curve_single = plot_single.plot(
time_arr,
plot_data.data.iloc[:, 0].to_numpy(),
initial_data_centered,
pen=pg.intColor(0, hues=plot_data.num_channels),
name=f"Ch {plot_data.channel_ids[0]}",
)
Expand Down Expand Up @@ -280,13 +282,15 @@ def update_single_channel(channel_id):
return

# Update time domain plot
curve_single.setData(time_arr, plot_data.data.iloc[:, channel_index].to_numpy())
channel_data = plot_data.data.iloc[:, channel_index].to_numpy()
channel_data_centered = channel_data - np.mean(channel_data)
curve_single.setData(time_arr, channel_data_centered)
curve_single.setPen(pg.intColor(channel_index, hues=plot_data.num_channels))

# Update FFT plot
fft_plot.clear()
fft_freq, fft_magnitude = compute_fft(
plot_data.data.iloc[:, channel_index].to_numpy(), plot_data.sample_rate
channel_data_centered, plot_data.sample_rate
)

# Plot FFT with improved visibility
Expand Down
3 changes: 3 additions & 0 deletions synapse/cli/offline_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ def plot(args):
console.print(
"[yellow bold]Legacy plotting is deprecated, please use the hdf5 files going forward[/yellow bold]"
)
console.print(
"[yellow bold]Use --data <path_to_hdf5_file> to plot hdf5 files[/yellow bold]"
)

app = QtWidgets.QApplication.instance()
if not app:
Expand Down
Loading