def main(base): try: ucontrol.hirate = [] ucontrol.record(True) while True: ucontrol.delay(1) except KeyboardInterrupt: data = ucontrol.hirate[:] raw = [l[1] for l in data] raw = e_sphyg_bpc.crop(raw) print util.blood_pressure(raw) show() finally: ext = raw_input('sys_dia:') pickle.dump(data, open('%s_%s.uct' % (base, ext), 'w')) ucontrol.abort()
def is_complete(self): Mode.start(self) data = array(hirate) raw = data[:, 1] bp_result = 'BP:' map_result = 'MAP:' hr_result = 'HR:' error = True if len(raw) < 5 * 200: # 5 seconds of data bp_result = 'Data QTY Error' else: try: sys, dia, map, hr = util.blood_pressure(raw) error = False except IndexError, e: bp_result = str(e) error = True except ValueError, e: bp_result = str(e) error = True
def main(filename): raw = array(pickle.load(open(filename)))[:,1] raw = crop(raw) bp = util.blood_pressure(raw) return bp
def main(filename): raw = array(pickle.load(open(filename)))[:, 1] raw = crop(raw) bp = util.blood_pressure(raw) return bp