bscan now does not process S21 mode
This commit is contained in:
@ -354,11 +354,21 @@ class BaseProcessor:
|
|||||||
latest["vna_config"],
|
latest["vna_config"],
|
||||||
)
|
)
|
||||||
|
|
||||||
def _process_data(self, sweep_data: Any, calibrated_data: Any, vna_config: dict[str, Any]) -> ProcessedResult:
|
def _process_data(self, sweep_data: Any, calibrated_data: Any, vna_config: dict[str, Any]) -> ProcessedResult | None:
|
||||||
"""
|
"""
|
||||||
Internal: compute processed data, build a Plotly config, and wrap into `ProcessedResult`.
|
Internal: compute processed data, build a Plotly config, and wrap into `ProcessedResult`.
|
||||||
|
|
||||||
|
Returns None if processing resulted in an error (indicated by {"error": ...} dict).
|
||||||
"""
|
"""
|
||||||
processed = self.process_sweep(sweep_data, calibrated_data, vna_config)
|
processed = self.process_sweep(sweep_data, calibrated_data, vna_config)
|
||||||
|
|
||||||
|
# Skip result creation if processing returned an error
|
||||||
|
if isinstance(processed, dict) and "error" in processed:
|
||||||
|
logger.debug("Processing returned error; skipping result",
|
||||||
|
processor_id=self.processor_id,
|
||||||
|
error=processed.get("error"))
|
||||||
|
return None
|
||||||
|
|
||||||
plotly_conf = self.generate_plotly_config(processed, vna_config)
|
plotly_conf = self.generate_plotly_config(processed, vna_config)
|
||||||
ui_params = self.get_ui_parameters()
|
ui_params = self.get_ui_parameters()
|
||||||
|
|
||||||
|
|||||||
@ -165,6 +165,10 @@ class BScanProcessor(BaseProcessor):
|
|||||||
Or: {"error": "..."} on failure.
|
Or: {"error": "..."} on failure.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
|
# Skip B-scan processing for S21 mode - only works with S11
|
||||||
|
if vna_config and vna_config.get("mode") == "s21":
|
||||||
|
return {"error": "B-scan only available in S11 mode"}
|
||||||
|
|
||||||
# Choose calibrated data when provided
|
# Choose calibrated data when provided
|
||||||
data_to_process = calibrated_data or sweep_data
|
data_to_process = calibrated_data or sweep_data
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user