added white theme, some features to processing and saving

This commit is contained in:
Ayzen
2026-04-13 10:44:01 +03:00
parent 61685d7a4d
commit 5d2f95f959
20 changed files with 295 additions and 48 deletions
@@ -39,6 +39,8 @@ def _result_tail(
def build_bscan_signature(
live_config: ProcessingLiveConfig,
*,
subtract_mean_ascan_enabled: bool,
result_history: list[ResultCollection],
history_limit: int,
floor_collection_id: int,
@@ -57,11 +59,25 @@ def build_bscan_signature(
float(live_config.bscan_gain),
float(live_config.bscan_start_freq_mhz),
float(live_config.bscan_stop_freq_mhz),
bool(subtract_mean_ascan_enabled),
int(floor_collection_id),
tuple((int(collection.collection_id), int(collection.monotonic_ns), len(collection.blocks)) for collection in result_tail),
)
def apply_mean_ascan_subtraction(
history: deque[np.ndarray],
*,
enabled: bool,
) -> np.ndarray:
"""Subtract mean A-scan across sweeps when enabled."""
sweeps = np.vstack(history).astype(np.float32, copy=False)
if not enabled:
return sweeps
mean_trace = np.mean(sweeps, axis=0, dtype=np.float32)
return sweeps - mean_trace
def rebuild_bscan_history_from_results(
result_history: list[ResultCollection],
history_limit: int,
@@ -183,7 +199,10 @@ class AppWindowBscanPlotMixin:
if not history or depth_axis is None:
return False
sweeps = np.vstack(history).astype(np.float32, copy=False)
sweeps = apply_mean_ascan_subtraction(
history,
enabled=bool(self._bscan_subtract_mean_ascan.isChecked()),
)
if sweeps.size == 0:
return False
@@ -229,6 +248,7 @@ class AppWindowBscanPlotMixin:
result_history = list(self._result_history)
return build_bscan_signature(
live_config=live_config,
subtract_mean_ascan_enabled=bool(self._bscan_subtract_mean_ascan.isChecked()),
result_history=result_history,
history_limit=self._bscan_history_limit,
floor_collection_id=self._bscan_history_floor_collection_id,