コード例 #1
0
 def SW_init(self):
     """Initialises Swabian counter and NIBox for sync pulse measurement"""
     self.listener = TrigReceiver('/Weetabix/port1/line0')
     self.tag = createTimeTagger()
     self.tag.setTriggerLevel(0, 0.1)
     self.tag.setTriggerLevel(1, 0.1)
     self.tag.autoCalibration()
コード例 #2
0
    def SW_run(self):
        """Runs in own thread - reads data via Swabian box"""
        self.measure_data = pl.zeros((50, ))
        try:
            self.tag = createTimeTagger()
            self.tag.setTriggerLevel(0, 0.15)
            self.tag.setTriggerLevel(1, 0.15)
            self.ctr = Counter(self.tag, [0, 1], int(1e9), int(self.dt))
            while self.running:
                time.sleep(self.dt / 1000.)
                rates = self.ctr.getData()
                if self.detID == 0:
                    newCount = pl.mean(rates[0]) * 1000
                elif self.detID == 1:
                    newCount = pl.mean(rates[1]) * 1000
                else:
                    newCount = (pl.mean(rates[0]) + pl.mean(rates[1])) * 1000
                self.measure_data[0] = newCount
                self.measure_data = pl.roll(self.measure_data, -1)
                print self.measure_data
                self.gotdata = True

        finally:
            self.ctr.stop()
            self.tag.reset()
            self.running = False
            self.btn.setEnabled(True)
コード例 #3
0
 def SW_run(self):
     """Runs in own thread - reads data via Swabian box"""
     
     self.v_step = pl.array([pl.linspace(self.v_i, self.v_f, self.no_of_steps) for i in range(self.repeats)]).flatten()
     try:
         
         self.tag = createTimeTagger()
         self.tag.setTriggerLevel(0, 0.2)
         self.tag.setTriggerLevel(1, 0.2)
         self.ctr = Counter(self.tag, [0,1], int(1e9), int(self.dt))
         self.tag.sync()
         for v in self.v_step:
             if self.running:
                 self.voltT.setDACvoltage(voltage=float(v) / 1000, outputId=2)
                 time.sleep(self.dt/1000.)
                 rates = self.ctr.getData()
                 newCount = (pl.mean(rates[0]) + pl.mean(rates[1]))*1000
                 self.buff.append(newCount)
                 # print self.measure_data
                 self.gotdata = True
             
     finally:
         self.ctr.stop()
         self.tag.reset()
         self.running = False
         self.btn.setEnabled(True)        
コード例 #4
0
    def __init__(self, parameters, runTest=False):
        self.__dict__.update(parameters)
        try:
            self.tagger = createTimeTagger()
            self.tagger.reset()
            print(
                f"Tagger initialization successful: {self.tagger.getSerial()}")
        except RuntimeError:
            print(
                f"\nCheck if the TimeTagger device is being used by another instance."
            )
            sys.exit()

        if runTest:
            print("RUNNING WITH TEST SIGNAL!")
            for i in self.testSignals:
                self.tagger.setTestSignal(i, True)

        for idx, delay_t in enumerate(self.delayTimes):
            if delay_t != 0:
                self.tagger.setInputDelay(delay=delay_t, channel=idx + 1)

        self.hist_1 = Histogram(self.tagger, self.currentChan1[0],
                                self.trigChans[0], self.binWidth1,
                                self.numBins1)

        self.hist_2 = Histogram(self.tagger, self.currentChan2[0],
                                self.trigChans[0], self.binWidth2,
                                self.numBins2)

        self.virtChannel_start = DelayedChannel(
            self.tagger,
            input_channel=self.trigChans[0],
            delay=self.gate_delay[0])

        self.virtChannel_end = DelayedChannel(self.tagger,
                                              input_channel=self.trigChans[0],
                                              delay=self.gate_delay[1])

        self.gated_channel = GatedChannel(
            self.tagger,
            input_channel=self.gatedChan[0],
            gate_start_channel=self.virtChannel_start.getChannel(),
            gate_stop_channel=self.virtChannel_end.getChannel())

        g2_start, g2_end = self.combiner_channels(self.g2_channels_start,
                                                  self.g2_channels_end)

        self.corr = Correlation(self.tagger, g2_start, g2_end, self.binWidth1,
                                self.numBins1)

        self.counter = Counter(self.tagger, self.counter_channels,
                               self.binWidthCounter, self.numBinsCounter)
コード例 #5
0
 def startSelectedInstrument(self, counterDevice):
     if counterDevice == self.NI_BOX:
         self.NI_init_ctr(intTime=self.dt)
     elif counterDevice == self.MULTIMETER:
         self.multi = AgilentMultimeter(r'GPIB0::23::INSTR')
     elif counterDevice == self.PICOHARP:
         self.ph = ph.PicoHarp()
     else:
         self.tag = createTimeTagger()
         self.tag.setTriggerLevel(0, 0.1)
         self.tag.setTriggerLevel(1, 0.1)
         self.tag.autoCalibration()
コード例 #6
0
    def on_activate(self, e=None):
        """ Starts up the NI Card at activation.

        @param object e: Event class object from Fysom.
                         An object created by the state machine module Fysom,
                         which is connected to a specific event (have a look in
                         the Base Class). This object contains the passed event,
                         the state before the event happened and the destination
                         of the state which should be reached after the event
                         had happened.
        """

        self._tagger = createTimeTagger()

        self._count_frequency = 10  # Hz

        config = self.getConfiguration()

        if 'photon_source' in config.keys():
            self._photon_source = config['photon_source']
        else:
            self.log.error('No parameter "photon_source" configured.\n'
                           'Assign to that parameter an appropriated channel '
                           'from your NI Card!')
コード例 #7
0
from matplotlib import pyplot as plt
import numpy as np
import time
import pandas as pd
from datetime import datetime

# set up time tagger
'''
def log_handler(level, msg):
    if level >= LOGGER_WARNING:
        print(msg)

setLogger(log_handler)
'''

tagger = createTimeTagger()
tagger.reset()

CLICK_CH = 2  # the actual signal from APD or SNSPD
START_CH = 3
END_CH = DelayedChannel(tagger, START_CH, 100 * 1000)  # 300 nS, unit is P

tagger.setTriggerLevel(CLICK_CH, 0.2)  # trigger level 0.2
tagger.setTriggerLevel(START_CH, 0.2)  # trigger level 0.2
#tagger.setTestSignal(1, True) # if using internal test pulses
#tagger.setTestSignal(2, True) # if using internal test pulses

# set up pulse streammer
ip_hostname = '169.254.8.2'
pulser = PulseStreamer(ip_hostname)
HIGH = 1
コード例 #8
0
 def initialize(self):
     """Creates instance of class"""
     self.tag = createTimeTagger()
     self.tag.setTriggerLevel(0, 0.15)
     self.tag.setTriggerLevel(1, 0.15)