Пример #1
0
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()
Пример #2
0
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()
Пример #3
0
    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
Пример #4
0
def main(filename):
    raw = array(pickle.load(open(filename)))[:,1]
    raw = crop(raw)
    bp = util.blood_pressure(raw)
    return bp
Пример #5
0
def main(filename):
    raw = array(pickle.load(open(filename)))[:, 1]
    raw = crop(raw)
    bp = util.blood_pressure(raw)
    return bp