Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from artiq.experiment import *
from pyLIAF.artiq.controllers import UrukulCh
import numpy as np
class ControlAllRF(EnvExperiment):
"""Changing amp and freq of lasers"""
def build(self):
self.setattr_device("core")
# global attenuation
self.setattr_argument("attenuation",
NumberValue(0*dB, unit='dB', scale=dB, min=0*dB, max=31*dB),
)
RF_ch0 = UrukulCh(self, ch=0, freq=100.0, amp=1)
RF_ch1 = UrukulCh(self, ch=1, freq=208.0, amp=0.35)
RF_ch2 = UrukulCh(self, ch=2, freq=110.0, amp=0.3)
RF_ch3 = UrukulCh(self, ch=3, freq=80.0, amp=0.37)
self.RF_chs = [RF_ch0, RF_ch1, RF_ch2, RF_ch3]
#self.set_dataset("Potencias", np.full(0., 10))
#@rpc
#def get_measurement(self, i):
# val = self.RP.give_measurement()
# self.mutate_dataset("Potencias", i, val)
@kernel
def run(self):
self.core.reset()
delay(1000*ms)
# initialises CPLD all the selected channels
for rf_ch in self.RF_chs:
#rf_ch.initialize_channel()
self.core.break_realtime()
delay(100*ms)
for rf_ch in self.RF_chs:
rf_ch.set_channel()
self.core.break_realtime()
for rf_ch in self.RF_chs:
rf_ch.channel.set_att(0.)
self.core.break_realtime()
#self.get_measurement(medN)
# self.core.break_realtime()