dark mode toggle + enhancements
This commit is contained in:
@@ -1239,13 +1239,16 @@ def calculate_peak_power(data: BaseRaw, time_window: int = 3, threshold: float =
|
||||
psp = scores.mean(axis=1)
|
||||
bad_channels = list(compress(cast(list[str], data.ch_names), psp < threshold))
|
||||
|
||||
plot_data = data.copy()
|
||||
plot_data.info["bads"] = bad_channels
|
||||
|
||||
existing_bads = set(data.info.get("bads", []))
|
||||
data.info["bads"] = list(existing_bads | set(bad_channels))
|
||||
|
||||
# Determine the colors based on the threshold, and create the figures
|
||||
color_stops = ([0.0, threshold, threshold+0.1, threshold+0.2, 1.0], [0.0, threshold, threshold, 1.0])
|
||||
psp1, psp2 = plot_timechannel_quality_metrics(data, scores, times, color_stops, threshold, "Peak Spectral Power")
|
||||
|
||||
psp1, psp2 = plot_timechannel_quality_metrics(plot_data, scores, times, color_stops, threshold, "Peak Spectral Power")
|
||||
print(f"thresh: {threshold}")
|
||||
|
||||
return list(compress(cast(list[str], getattr(data, "ch_names")), psp < threshold)), psp1, psp2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user