Browse Source

Output optimized parameters

Matthias Vogelgesang 7 years ago
parent
commit
7837fb6f01
1 changed files with 9 additions and 3 deletions
  1. 9 3
      cockpit

+ 9 - 3
cockpit

@@ -2,6 +2,7 @@
 
 import os
 import re
+import json
 import shlex
 import collections
 import datetime
@@ -348,10 +349,15 @@ class Application(object):
                ' --params-filename params.json'
                .format(opt_params=opt_params, params=params, prefix=self.prefix))
 
-        with open('log.txt', 'w') as f:
-            f.write(cmd)
+        result = self.run_command(cmd)
 
-        return self.run_command(cmd)
+        if result == 0:
+            with open('params.json') as f:
+                opt = json.load(f)
+                self.log.highlight(" Optimal axis: {}".format(opt['lamino-angle']['value']))
+                self.log.highlight(" Optimal center: {}".format(opt['x-center']['value']))
+
+        return result
 
     def do_nothing(self):
         return True