예제 #1
0
파일: ptrsparc.py 프로젝트: Tommos0/ptrdaq
    def run(self):
        signal.signal(signal.SIGINT, signal.SIG_IGN)
        logger.addHandler(pipeHandler(self.pipe))
        logger.setLevel(logging.INFO)
        logger.info("Searching for HiSPARC III Master...")
        device = self.get_device()
        if not device:
            logger.error("HiSPARC III Master not found")
            return
        logger.info("Master found: %s" % device.serial)
        self.device = device
        self.device_buffer = bytearray()
        self.config = Config(self)

        self.send_message(messages.ResetMessage(True))
        self.send_message(messages.InitializeMessage(False))

        align_adcs = AlignADCs(self)
        align_adcs.set_align_brent()
        self.send_message(messages.TriggerConditionMessage(0x0))
        self.send_message(messages.CoincidenceTimeMessage(1))  #*5ns
        #self.send_message(messages.PreCoincidenceTimeMessage(200))#100 voor labtests,200 @ KVI
        #self.send_message(messages.PostCoincidenceTime(500))#900, proton
        self.send_message(messages.PreCoincidenceTimeMessage(PRECOIN))
        self.send_message(messages.PostCoincidenceTime(POSTCOIN))  #900, proton
        self.send_message(messages.TriggerConditionMessage(0x40))
        self.dw = dataWriter(self.filename, (PRECOIN + POSTCOIN) * 2 + 2)
        self.counter = 0

        self.device.flush_input()
        time.sleep(8)
        logger.info("HiSPARC III Master initialized")
        self.mainLoop()
예제 #2
0
파일: ptrsparc.py 프로젝트: Tommos0/ptrdaq
    def run(self):
        signal.signal(signal.SIGINT, signal.SIG_IGN)
        logger.addHandler(pipeHandler(self.pipe))
        logger.setLevel(logging.INFO)
        logger.info("Searching for HiSPARC III Master...")
        device = self.get_device()
        if not device:
            logger.error("HiSPARC III Master not found")
            return
        logger.info("Master found: %s" % device.serial)
        self.device = device
        self.device_buffer = bytearray()
        self.config = Config(self)

        self.send_message(messages.ResetMessage(True))
        self.send_message(messages.InitializeMessage(False))

        align_adcs = AlignADCs(self)
        align_adcs.set_align_brent()
        self.send_message(messages.TriggerConditionMessage(0x0))
        self.send_message(messages.CoincidenceTimeMessage(1))#*5ns
        #self.send_message(messages.PreCoincidenceTimeMessage(200))#100 voor labtests,200 @ KVI
        #self.send_message(messages.PostCoincidenceTime(500))#900, proton 
        self.send_message(messages.PreCoincidenceTimeMessage(PRECOIN))
        self.send_message(messages.PostCoincidenceTime(POSTCOIN))#900, proton 
        self.send_message(messages.TriggerConditionMessage(0x40))
        self.dw = dataWriter(self.filename,(PRECOIN+POSTCOIN)*2+2)
        self.counter = 0

        self.device.flush_input()
        time.sleep(8)
        logger.info("HiSPARC III Master initialized")
        self.mainLoop()
예제 #3
0
    def run(self):
  #  def __iffnit__(self,pipe,event_set,events_wait,event_hisparc,filename,id,hw):
        self.hw = [self.useConfig,self.bpc,self.dacs,self.hwdacs]
        signal.signal(signal.SIGINT, signal.SIG_IGN)
#        self.event_set = event_set
#        self.events_wait = events_wait
#        self.event_hisparc = event_hisparc
        self.counter = 0
        logger.addHandler(pipeHandler(self.pipe))
        logger.setLevel(logging.INFO)

        self.mpx=sd.setdet(self.id,self.hw)
        if not self.mpx:
            return
        self.data = numpy.empty([512,256], dtype=numpy.int16)
        sd.exttrigger(self.mpx)
        self.dw = dataWriter(self.filename,self.id,self.display)
        logger.info("Initialized")
        self.mainLoop()