fix warning

This commit is contained in:
awe
2026-04-29 18:27:00 +03:00
parent 9ff97bf737
commit ecd05568c6

View File

@ -3172,11 +3172,14 @@ def run_pyqtgraph(args) -> None:
levels = compute_background_subtracted_bscan_levels(disp_fft_lin, disp_fft)
if levels is None:
try:
mean_spec = np.nanmean(disp_fft, axis=1)
vmin_v = float(np.nanmin(mean_spec))
vmax_v = float(np.nanmax(mean_spec))
if np.isfinite(vmin_v) and np.isfinite(vmax_v) and vmin_v != vmax_v:
levels = (vmin_v, vmax_v)
finite_rows = np.any(np.isfinite(disp_fft), axis=1)
if np.any(finite_rows):
mean_spec = np.nanmean(disp_fft[finite_rows], axis=1)
if mean_spec.size > 0:
vmin_v = float(np.nanmin(mean_spec))
vmax_v = float(np.nanmax(mean_spec))
if np.isfinite(vmin_v) and np.isfinite(vmax_v) and vmin_v != vmax_v:
levels = (vmin_v, vmax_v)
except Exception:
levels = None
if levels is None and spec_clip is not None: