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):
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)