From: W. Trevor King Date: Sun, 19 Aug 2012 21:42:08 +0000 (-0400) Subject: Don't plot missing surface detection regions in analyze_surface_position_data. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=38c97d9e260e336e936258c126e742e7ab22afa5;p=pypiezo.git 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'. --- 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