Convert calibcant-analyze.py to work with load_all and analyze_all.
authorW. Trevor King <wking@tremily.us>
Fri, 20 Apr 2012 17:11:55 +0000 (13:11 -0400)
committerW. Trevor King <wking@tremily.us>
Fri, 20 Apr 2012 17:15:56 +0000 (13:15 -0400)
This catches that script up with

  commit 560f9f94abbdf396b9f624e03bdb2a1f6d840bd1
  Author: W. Trevor King <wking@drexel.edu>
  Date:   Fri Mar 16 10:02:37 2012 -0400

    Get calibcant working with the new load_from_config-based pyafm.

bin/calibcant-analyze.py

index 0735b256f358421bbb09ace3a3a0fb7550a8d68c..1d71579d6e00529dd5688e7019c262cf4957c69f 100755 (executable)
@@ -22,8 +22,8 @@
 
 from optparse import OptionParser
 
-from matplotlib.pyplot import show
-from calibcant.analyze import calib_analyze_all
+from calibcant.calibrate import load_all
+from calibcant.analyze import analyze_all
 
 
 def main(args):
@@ -38,8 +38,11 @@ def main(args):
     options,args = p.parse_args(args)
     filename = args[0]
 
-    k,k_s = calib_analyze_all(
-        filename=filename, group=options.group, dry_run=options.dry_run)
+    calibrator,data,raw_data = load_all(filename=filename, group=options.group)
+    k,k_s = analyze_all(
+        config=calibrator.config, data=data, raw_data=raw_data,
+        filename=filename, group=options.group, plot=False,
+        dry_run=options.dry_run)
     print "New spring constant:"
     print "%g +/- %g N/m" % (k, k_s)