added notch toggle

This commit is contained in:
sad-santa
2026-04-30 14:23:15 +03:00
parent 6c1a1151bc
commit 63138d8d9c
2 changed files with 11 additions and 0 deletions
@@ -3,6 +3,7 @@
"ach_norm_enabled": false,
"s11_norm_enabled": false,
"subtract_mean_ascan": false,
"hardcoded_notch_enabled": false,
"axis": "abs",
"cut": 0.0,
"max": 12.0,
@@ -84,6 +84,7 @@ class BScanProcessor(BaseProcessor):
"ach_norm_enabled": False, # Toggle ACH normalization from JSON
"s11_norm_enabled": False, # Toggle S21 normalization using two S11 files
"subtract_mean_ascan": False, # Subtract mean A-scan from each sweep in B-scan
"hardcoded_notch_enabled": True, # Enable/disable hardcoded notch filtering
"axis": "abs", # "real", "abs", or "phase"
# "data_limitation": None, # None, "ph_only_1", "ph_only_2"
"cut": 0.824, # Cut parameter (meters)
@@ -131,6 +132,12 @@ class BScanProcessor(BaseProcessor):
type="toggle",
value=cfg["subtract_mean_ascan"],
),
UIParameter(
name="hardcoded_notch_enabled",
label="Notch filter",
type="toggle",
value=cfg["hardcoded_notch_enabled"],
),
UIParameter(
name="axis",
label="Ось",
@@ -978,6 +985,9 @@ class BScanProcessor(BaseProcessor):
mask = np.ones_like(freq_hz, dtype=float)
bands = _HARDCODED_NOTCH_BANDS_HZ
if not bool(self._config.get("hardcoded_notch_enabled", True)):
return s_complex, mask
if not bands:
return s_complex, mask