-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapplication.py
More file actions
52 lines (46 loc) · 1.75 KB
/
Copy pathapplication.py
File metadata and controls
52 lines (46 loc) · 1.75 KB
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
51
52
import wavgen as wv
import easygui
#### IMPORTANT NOTES ####
# max value of amplitude: 2000mV. Do not exceed.
# For a given maximum amplitude of the card output, Vout,
# the amplitude of each pure tone will be (Vout / N) if
# N traps are output simultaneously.
## 20 Random Phases within [0, 2pi] ##
r = [2.094510589860613, 5.172224588379723, 2.713365750754814, 2.7268654021553975, 1. /
9455621726067513, 2.132845902763719, 5.775685169342227, 4.178303582622483, 1.971 /
4912917733933, 1.218844007759545, 4.207174369712666, 2.6609861484752124, 3.41140 /
54221128125, 1.0904071328591276, 1.0874359520279866, 1.538248528697041, 0.501676 /
9726252504, 2.058427862897829, 6.234202186024447, 5.665480185178818]
if __name__ == '__main__':
# Define Waveform #
freq = [80E6 + j*1E6 for j in range(10)]
A = wv.waveform.Superposition(freq, sample_length=int(16E3))
A.set_phases(r[:len(freq)])
A.compute_waveform('./gey.h5')
#
# A = wv.utilities.from_file('./waveforms/A.h5')
# AB = wv.utilities.from_file('./waveforms/AB.h5')
# B = wv.utilities.from_file('./waveforms/B.h5')
# BA = wv.utilities.from_file('./waveforms/BA.h5')
#
# segments = [A, AB, B, BA]
#
# a = wv.utilities.Step(0, 0, 10000, 1)
# ab = wv.utilities.Step(1, 1, 1, 2)
# b = wv.utilities.Step(2, 2, 10000, 3)
# ba = wv.utilities.Step(3, 3, 1, 0)
#
# steps = [a, ab, b, ba]
# Open Card/Configure #
print('begin')
card = wv.Card()
print('opened')
card.setup_channels(amplitude=240)
print('channel')
card.load_waveforms(A)
# card.load_sequence(segments, steps)
# Let it Rip #
card.wiggle_output(block=False)
easygui.msgbox("Done?")
## Done! ##
print("Done -- Success!")