From 38c97d9e260e336e936258c126e742e7ab22afa5 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 19 Aug 2012 17:42:08 -0400 Subject: [PATCH] Don't plot missing surface detection regions in analyze_surface_position_data. This allows us to use the surface-matplotlib option to debug the surface-position algorithm even when it's used on phony data that only contains 'approach'. --- pypiezo/surface.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pypiezo/surface.py b/pypiezo/surface.py index 4cea70d..be696f4 100644 --- a/pypiezo/surface.py +++ b/pypiezo/surface.py @@ -222,7 +222,8 @@ def analyze_surface_position_data( ('ret2', 'second retract'), ('approach', 'main approach'), ('ret3', 'return to start')]: - axes.plot(ddict[n]['z'], ddict[n]['deflection'], label=name) + if n in ddict: + axes.plot(ddict[n]['z'], ddict[n]['deflection'], label=name) def fit_fn(x, params): if x <= params[2]: return params[0] + params[1]*x -- 2.26.2