import numpy as np
from artiq.experiment import *
class Photon_Detection(EnvExperiment):
"""Photon_Detction"""
def build(self):
self.setattr_device("core")
self.setattr_device("ttl1")
global Num_get_risings
global i
global list1
global list2
#假设gate_rising语法和delay语法作用一样,则可以成功
@kernel
def run(self):
list1=[]
list2=[]
try:
for i in range(10000000):
self.core.reset()
gate_end_mu = self.ttl1.gate_rising(200 * ms)
Num_get_risings = self.ttl1.count(gate_end_mu)
print(Num_get_risings)
self.analyse()
self.set_dataset("Photon_Counts",list2,broadcast=True)
self.set_dataset("Time",list1,broadcast=True)
except RTIOUnderflow:
print("Error for time")
def analyse(self):
list1.append(200*i)
list2.append(Num_get_risings)
I don‘t know what problem occured to my procedure,I just want to create two lists and add data point one by one,how should I do.