Measuring the Average Count Rate

Time Tagger provides a Countrate measurement class that allows for the measurement of average count rate. The averaging can be done over infinite time (as long as measurement runs) and over precisely defined averaging duration.

Below is the Python code that shows how to perform average countrate measurement over infinite and well-defined durations.

example_average_countrate.py

Time Tagger connection


from time import sleep
import TimeTagger

# Create a TimeTagger instance to control your hardware
tagger = TimeTagger.createTimeTagger()

channels = [1, 2]

# This enables internal test signals for demo purposes.
# Comment the following line if you want to try this with an external signals
tagger.setTestSignal(channels, True)

Infinite average

Measure the Countrate over the whole run time:


# We create a Countrate instance, it will acquire data immediately
countrate = TimeTagger.Countrate(tagger=tagger, channels=channels)

# Periodically read and print the average countrate measured since measurement creation.
print('Average countrate values since the measurement creation.')
for i in range(10):
        # Wait for some time (software controlled)
        sleep(0.5)
        # Read countrate averaged over the run duration
        rate = countrate.getData()
        # Read time since measurement start
        duration_of_measurement = countrate.getCaptureDuration()
        print(
                f'Average countrate: CH{channels[0]}: {rate[0]:10.6f} cps, '
                f'CH{channels[1]}:{rate[1]:10.6f} cps '
                f'@ averaged over: {duration_of_measurement*1e-12:0.3f} s'
        )

Average over precisely defined time

Measure the count rate periodically over a well-defined duration. The duration of averaging is hardware-controlled and is picoseconds precise:


# We create a Countrate instance, it will acquire data immediately
countrate = TimeTagger.Countrate(tagger=tagger, channels=channels)

# Periodically measure average countrate over well defined period of time.
average_time = 0.5 # seconds
print('EXAMPLE 2. Average over defined time.')
print('Average countrate values measured periodically over the defined time.')
for i in range(10):
# Start the measurement for defined duration. It will stop automtically.
countrate.startFor(average_time*1e12, clear=True)
# Wait until the measurement averaged over the requested duration.
countrate.waitUntilFinished()
# Read countrate averaged over the run duration
rate = countrate.getData()
# Read time since measurement start
duration_of_measurement = countrate.getCaptureDuration()
print(
        f'Average countrate: CH{channels[0]}: {rate[0]:10.6f} cps, '
        f'CH{channels[1]}:{rate[1]:10.6f} cps '
        f'@ averaged over: {duration_of_measurement*1e-12:0.3f} s'
)

Cookie Policy

We use third party service providers, like Freshworks Inc ("Freshworks") to enable interaction with you on our website and/or our product. As a data processor acting on our behalf, Freshworks automatically receives and records certain information of yours like device model, IP address, the type of browser being used and usage pattern through cookies and browser settings. Freshworks performs analytics on such data on our behalf which helps us improve our service to you. You can read about the cookies Freshworks' sets in their cookie policy here.