forked from M-Labs/artiq
master,run: automatically call analyze function
This commit is contained in:
parent
5bb6a3d8a6
commit
9ffc370416
|
@ -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")
|
||||||
|
|
|
@ -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",
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue