Keep stored row-averaged caches eligible on the fallback compute path

ComputeWorker dropped row_avg_n, so a stored row-averaged cache was
ineligible whenever the fallback compute served the image instead of the
DC precompute path. Thread the viewer's precomputed_row_avg_n through
ComputeWorker and the batch export worker's compute_rf_image call.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Thomas Ales [M S E]
2026-08-12 10:17:16 -05:00
parent ec0d322871
commit efecc154fe
3 changed files with 74 additions and 3 deletions
+6 -3
View File
@@ -119,7 +119,8 @@ class ComputeWorker(CancellableWorker):
apply_bg_sub: bool = True, n_fft: int | None = None,
dc_threshold_mv: float = 0.0,
dc4_mv: np.ndarray | None = None,
is_fft_mode: bool = False):
is_fft_mode: bool = False,
row_avg_n: int = 0):
super().__init__()
self._sras = sras
self._angle = angle_idx
@@ -129,6 +130,7 @@ class ComputeWorker(CancellableWorker):
self._dc_threshold = dc_threshold_mv
self._dc4_mv = dc4_mv
self._is_fft_mode = is_fft_mode
self._row_avg_n = row_avg_n
def run(self):
try:
@@ -136,7 +138,8 @@ class ComputeWorker(CancellableWorker):
img = compute_rf_image(
self._sras, self._angle, dc_threshold_mv=self._dc_threshold,
apply_bg_sub=self._apply_bg_sub, n_fft=self._n_fft,
dc4_mv=self._dc4_mv, should_stop=self._stopped)
dc4_mv=self._dc4_mv, should_stop=self._stopped,
row_avg_n=self._row_avg_n)
else:
img = dc_image_mv(self._sras, self._angle, self._ch,
should_stop=self._stopped)
@@ -412,7 +415,7 @@ class BatchExportWorker(CancellableWorker):
freq_mhz = compute_rf_image(
s, angle_idx, dc_threshold_mv=self._dc_threshold_mv,
apply_bg_sub=self._apply_bg_sub, n_fft=self._n_fft,
should_stop=self._stopped)
should_stop=self._stopped, row_avg_n=s.precomputed_row_avg_n)
for channel in self._channels:
if self._stop: