improved logging
This commit is contained in:
@@ -11,6 +11,7 @@ from python_app.models.run_config_model import RadarSweepModel
|
||||
|
||||
|
||||
def _parse_args() -> argparse.Namespace:
|
||||
"""Parse command-line options for the local K209 VISA smoke test."""
|
||||
parser = argparse.ArgumentParser(description="Acquire one K209 sweep through VISA HiSLIP")
|
||||
parser.add_argument(
|
||||
"--resource",
|
||||
@@ -36,6 +37,7 @@ def _parse_args() -> argparse.Namespace:
|
||||
|
||||
|
||||
def _validate_result(result, expected_points: int) -> None:
|
||||
"""Raise RuntimeError unless the sweep has the expected point count, monotonic axis, and finite S11/S21."""
|
||||
if result.x.shape != (expected_points,):
|
||||
raise RuntimeError(f"Unexpected frequency shape: {result.x.shape}")
|
||||
s11 = result.trace("s11")
|
||||
@@ -53,6 +55,11 @@ def _validate_result(result, expected_points: int) -> None:
|
||||
|
||||
|
||||
def main() -> int:
|
||||
"""Acquire one sweep from a locally connected K209 and validate it end to end.
|
||||
|
||||
Opens the VISA session, configures the sweep, validates the result, checks the SCPI
|
||||
error queue, and prints a summary; raises on any validation or SCPI failure.
|
||||
"""
|
||||
args = _parse_args()
|
||||
sweep = RadarSweepModel(
|
||||
start_hz=args.start_hz,
|
||||
|
||||
Reference in New Issue
Block a user