From d9d9ac6cc333f9b49557a97e9fe45c30ebe92adc Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 18 Jan 2013 23:08:03 -0500 Subject: [PATCH] calibcant-plot.py: Plot the stepper approach curve --- bin/calibcant-plot.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bin/calibcant-plot.py b/bin/calibcant-plot.py index ba959f4..acf9c48 100755 --- a/bin/calibcant-plot.py +++ b/bin/calibcant-plot.py @@ -22,7 +22,9 @@ from optparse import OptionParser +import h5py as _h5py from matplotlib.pyplot import close, get_fignums, figure, show + from calibcant.calibrate import load_all from calibcant.analyze import analyze_all @@ -45,6 +47,18 @@ def main(args): options,args = p.parse_args(args) filename = args[0] + with _h5py.File(filename) as f: + if options.group in f: + g = f[options.group] + if 'approach' in g: + position = g['approach/position'][...] + deflection = g['approach/deflection'][...] + fig = figure() + axes = fig.add_subplot(1, 1, 1) + axes.plot(position, deflection) + axes.set_title('Stepper approach') + axes.set_xlabel('position (steps)') + axes.set_ylabel('deflection (bits)') calibrator,data,raw_data = load_all(filename=filename, group=options.group) if not options.bumps: raw_data['bump'] = [] -- 2.26.2