From 157d31b08f4627da1dae764ba6fa196335f488be Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Mon, 21 Jul 2014 13:54:07 +0300 Subject: [PATCH] calibration should not fail on saturation --- calib.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/calib.py b/calib.py index 960c141..f44f143 100755 --- a/calib.py +++ b/calib.py @@ -25,7 +25,11 @@ def recv(): data = out.read(len(sig_dump)) if len(data) < len(sig_dump): return - x = common.loads(data) + try: + x = common.loads(data) + except common.SaturationError as e: + print('saturation: {}'.format(e)) + continue x = x - np.mean(x) c = np.abs(np.dot(x, sig)) / (np.sqrt(0.5 * len(x)) * sigproc.norm(x))