From: W. Trevor King Date: Sat, 19 Jan 2013 04:08:03 +0000 (-0500) Subject: calibcant-plot.py: Plot the stepper approach curve X-Git-Tag: 0.9~6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d9d9ac6cc333f9b49557a97e9fe45c30ebe92adc;p=calibcant.git calibcant-plot.py: Plot the stepper approach curve --- 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'] = []