master,run: automatically call analyze function

This commit is contained in:
Sebastien Bourdeauducq 2015-02-19 09:40:15 -07:00
parent 5bb6a3d8a6
commit 9ffc370416
3 changed files with 4 additions and 1 deletions

View File

@ -113,6 +113,8 @@ def main():
unit_inst = unit(dbh, **arguments) unit_inst = unit(dbh, **arguments)
unit_inst.run() unit_inst.run()
if hasattr(unit_inst, "analyze"):
unit_inst.analyze()
if args.hdf5 is not None: if args.hdf5 is not None:
f = h5py.File(args.hdf5, "w") f = h5py.File(args.hdf5, "w")

View File

@ -94,6 +94,8 @@ def run(obj):
try: try:
unit_inst = unit(dbh, **obj["arguments"]) unit_inst = unit(dbh, **obj["arguments"])
unit_inst.run() unit_inst.run()
if hasattr(unit_inst, "analyze"):
unit_inst.analyze()
except Exception: except Exception:
put_object({"action": "report_completed", put_object({"action": "report_completed",
"status": "failed", "status": "failed",

View File

@ -52,7 +52,6 @@ class FloppingF(AutoDB):
self.frequency.append(frequency) self.frequency.append(frequency)
self.brightness.append(brightness) self.brightness.append(brightness)
time.sleep(0.1) time.sleep(0.1)
self.analyze()
def analyze(self): def analyze(self):
popt, pcov = curve_fit(model_numpy, popt, pcov = curve_fit(model_numpy,