-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathData extraction step 1.py
146 lines (124 loc) · 5.01 KB
/
Data extraction step 1.py
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Plot intensity data
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib import rc
rc('text', usetex=False)
fig = plt.figure()
#Enter directory and name of measurement
#File path
directory = 'D:\Data\Fluxonium #10_7.5GHzCav\Two_tone_spec'
measurement = 'Two_tone_spec_YOKO_28.4to28.44mA_Cav_7.3649GHz&-15dBm_QuBit0.5to1.5GHz&16dBm'
path = directory + '\\' + measurement
#Read data
current = np.genfromtxt(path + '_CURRENT.csv')#*1e3
current = current[1:-1]
freq = np.genfromtxt(path + '_FREQ.csv')
freq = freq[1::]
data = np.genfromtxt(path + '_PHASEMAG.csv')
phase = data[1::,0] #phase is recorded in rad
mag = data[1::,1]
Z = np.zeros((len(current),len(freq)))
# print (phase)
for idx in range(len(current)):
temp = np.unwrap(phase[idx*len(freq):(idx+1)*len(freq)])
temp = temp*180/(np.pi)
# temp = mag[idx*len(freq):(idx+1)*len(freq)]
Z[idx,:] = temp - np.max(temp)
X,Y = np.meshgrid(current,freq)
plt.figure(1)
plt.pcolormesh(X,Y,Z.transpose(), cmap= 'GnBu_r', vmin = -0.5, vmax = 0.5)
##############################################################################################################################
directory = 'D:\Data\Fluxonium #10_7.5GHzCav\Two_tone_spec'
measurement = 'Two_tone_spec_YOKO_28.44to28.8mA_Cav_7.3649GHz&-15dBm_QuBit0.5to1.5GHz&20dBm'
path = directory + '\\' + measurement
#Read data
current = np.genfromtxt(path + '_CURRENT.csv')#*1e3
current = current[1:-1]
freq = np.genfromtxt(path + '_FREQ.csv')
freq = freq[1::]
data = np.genfromtxt(path + '_PHASEMAG.csv')
phase = data[1::,0] #phase is recorded in rad
mag = data[1::,1]
Z = np.zeros((len(current),len(freq)))
# print (phase)
for idx in range(len(current)):
temp = np.unwrap(phase[idx*len(freq):(idx+1)*len(freq)])
temp = temp*180/(np.pi)
# temp = mag[idx*len(freq):(idx+1)*len(freq)]
Z[idx,:] = temp - np.max(temp)
X,Y = np.meshgrid(current,freq)
plt.figure(1)
plt.pcolormesh(X,Y,Z.transpose(), cmap= 'GnBu_r', vmin = -0.5, vmax = 0.5)
##############################################################################################################################
directory = 'D:\Data\Fluxonium #10_7.5GHzCav\Two_tone_spec'
measurement = 'Two_tone_spec_YOKO_28.526to28.529mA_Cav_7.3649GHz&-15dBm_QuBit0.5to0.51GHz&0dBm'
path = directory + '\\' + measurement
#Read data
current = np.genfromtxt(path + '_CURRENT.csv')#*1e3
current = current[1:-1]
freq = np.genfromtxt(path + '_FREQ.csv')
freq = freq[1::]
data = np.genfromtxt(path + '_PHASEMAG.csv')
phase = data[1::,0] #phase is recorded in rad
mag = data[1::,1]
Z = np.zeros((len(current),len(freq)))
# print (phase)
for idx in range(len(current)):
temp = np.unwrap(phase[idx*len(freq):(idx+1)*len(freq)])
temp = temp*180/(np.pi)
# temp = mag[idx*len(freq):(idx+1)*len(freq)]
Z[idx,:] = temp - np.max(temp)
X,Y = np.meshgrid(current,freq)
plt.figure(1)
plt.pcolormesh(X,Y,Z.transpose(), cmap= 'GnBu_r', vmin = -0.5, vmax = 0)
##############################################################################################################################
directory = 'D:\Data\Fluxonium #10_7.5GHzCav\Two_tone_spec'
measurement = 'Two_tone_spec_YOKO_28.529to28.53mA_Cav_7.3649GHz&-15dBm_QuBit0.5to0.51GHz&0dBm'
path = directory + '\\' + measurement
#Read data
current = np.genfromtxt(path + '_CURRENT.csv')#*1e3
current = current[1:-1]
freq = np.genfromtxt(path + '_FREQ.csv')
freq = freq[1::]
data = np.genfromtxt(path + '_PHASEMAG.csv')
phase = data[1::,0] #phase is recorded in rad
mag = data[1::,1]
Z = np.zeros((len(current),len(freq)))
# print (phase)
for idx in range(len(current)):
temp = np.unwrap(phase[idx*len(freq):(idx+1)*len(freq)])
temp = temp*180/(np.pi)
# temp = mag[idx*len(freq):(idx+1)*len(freq)]
Z[idx,:] = temp - np.max(temp)
X,Y = np.meshgrid(current,freq)
plt.figure(1)
plt.pcolormesh(X,Y,Z.transpose(), cmap= 'GnBu_r', vmin = -0.5, vmax = 0)
##############################################################################################################################
directory = 'D:\Data\Fluxonium #10_7.5GHzCav\Two_tone_spec'
measurement = 'Two_tone_spec_YOKO_28.53to28.535mA_Cav_7.3649GHz&-15dBm_QuBit0.5to0.51GHz&0dBm'
path = directory + '\\' + measurement
#Read data
current = np.genfromtxt(path + '_CURRENT.csv')#*1e3
current = current[1:-1]
freq = np.genfromtxt(path + '_FREQ.csv')
freq = freq[1::]
data = np.genfromtxt(path + '_PHASEMAG.csv')
phase = data[1::,0] #phase is recorded in rad
mag = data[1::,1]
Z = np.zeros((len(current),len(freq)))
# print (phase)
for idx in range(len(current)):
temp = np.unwrap(phase[idx*len(freq):(idx+1)*len(freq)])
temp = temp*180/(np.pi)
# temp = mag[idx*len(freq):(idx+1)*len(freq)]
Z[idx,:] = temp - np.max(temp)
X,Y = np.meshgrid(current,freq)
plt.figure(1)
plt.pcolormesh(X,Y,Z.transpose(), cmap= 'GnBu_r', vmin = -0.5, vmax = 0)
#Click on the points on screen to define an approximation line for interpolation
def onclick(event):
print ('[%f, %f],'%(event.xdata, event.ydata))
cid = fig.canvas.mpl_connect('button_press_event', onclick)
plt.show()