from pypiezo import surface as _pypiezo_surface
-def load_yang_curves(basedir):
+def load_yang_curves(basedir, single=False):
for series in sorted(_os.listdir(basedir)):
if series.endswith('.ibw'):
path = _os.path.join(basedir, series)
for curve in _gyang_curve.load_all_traces(path):
yield curve
+ if single:
+ return
-def load_king_curves(basedir):
+def load_king_curves(basedir, single=False):
for path in sorted(_os.listdir(basedir)):
if path.endswith('.h5'):
curve = _os.path.join(basedir, path)
yield _crunch.load_pull(filename=curve)
+ if single:
+ return
-
-def plot_comparison(yang_dir, king_dir):
- yang = load_yang_curves(yang_dir)
- king = load_king_curves(king_dir)
+def plot_comparison(yang_dir, king_dir, single=False):
+ yang = load_yang_curves(yang_dir, single=single)
+ king = load_king_curves(king_dir, single=single)
figure = _pylab.figure()
axes = figure.add_subplot(1, 1, 1)
axes.set_title('velocity clamp unfolding')
(curve.piezo_expanded + 2**15, curve.deflection + 2**15, 'b'))
for curve in king:
xyc.append((curve['alpha_v'], curve['alpha_f'], 'r'))
+
for x, y, c in xyc:
ddict = {
'approach': { # for _analyze_surface_position_data
import argparse
parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument(
+ '--single', action='store_const', const=True,
+ help='compare only a single curve of each type')
parser.add_argument(
'yang', metavar='DIR',
help="directory for data taken with Prof. Yang's LabVIEW program")
plot_comparison(
yang_dir=_os.path.expanduser(args.yang),
- king_dir=_os.path.expanduser(args.king))
+ king_dir=_os.path.expanduser(args.king),
+ single=args.single)
_pylab.show()