Esempio n. 1
0
    def run(self):
        global args, events, hist
        p = Parse(args.infile)
        data = None

        while True:
            if self._abort_flag:
                print("Worker aborted")
                return

            if self._pause_flag:
                time.sleep(0.1)
                continue

            try:
                data = p.next()

            except StopIteration:
                time.sleep(0.5)
                continue

            vals = integrate(data)
            e_summ, e_baseline = vals.summ, vals.bl

            if self._notify_window.ready:
                self._notify_window.ready = False
                wx.PostEvent(self._notify_window, DataReadyEvent(data))
                sys.stderr.write("progress: %2.3f%%\n" %
                                 (100.0 * p.progress()))

            events.append(data)

            #TODO: if hist:

            hist.append(e_summ)
Esempio n. 2
0
	def run(self):
		global args, events, hist
		p = Parse(args.infile, ('chan','raw') )
		data = None
		
		while True:
			if self._abort_flag:
				print("Worker aborted")
				return
				
			if self._pause_flag:
				time.sleep(0.1)
				continue
			
			try:
				data = p.next()
			except StopIteration:
				time.sleep(1)
				continue
			
			if self._notify_window.ready:
				self._notify_window.ready = False
				wx.PostEvent(self._notify_window, DataReadyEvent(data))
			
			events.append(data)
			
			
			#TODO: if hist:
			e_ts, e_chan, e_summ, e_baseline, e_dbaseline =  integrate(data)[0:5]
			hist.append(e_summ)