Lines Matching refs:np
17 import numpy as np namespace
57 scf_i = np.empty(4*len(scf))
71 scf_i = np.append(scf_i[:n2], scf_i[2*n2:])
73 g_sns = np.power(2, [ -scf_i, scf_i ][inv])
77 y = np.empty(len(x))
100 e = np.append(np.empty(n2), e)
106 e_s = np.zeros(len(e))
114 e_p = e_s * (10 ** ((np.arange(64) * g_tilt) / 630))
118 noise_floor = max(np.average(e_p) * (10 ** (-40/10)), 2 ** -32)
119 e_p = np.fmax(e_p, noise_floor * np.ones(len(e)))
123 e_l = np.log2(10 ** -31 + e_p) / 2
129 e_4 = np.zeros(len(e_l) // 4)
130 e_4[0 ] = w[0] * e_l[0] + np.sum(w[1:] * e_l[:5])
131 e_4[1:15] = [ np.sum(w * e_l[4*i-1:4*i+5]) for i in range(1, 15) ]
132 e_4[ 15] = np.sum(w[:5] * e_l[59:64]) + w[5] * e_l[63]
136 scf = 0.85 * (e_4 - np.average(e_4))
138 scf_a = np.zeros(len(scf))
139 scf_a[0 ] = np.average(scf[:3])
140 scf_a[1 ] = np.average(scf[:4])
141 scf_a[2:14] = [ np.average(scf[i:i+5]) for i in range(12) ]
142 scf_a[ 14] = np.average(scf[12:])
143 scf_a[ 15] = np.average(scf[13:])
146 (scf_a - np.average(scf_a))
172 dmse_lf = [ np.sum((scf[:8] - T.SNS_LFCB[i]) ** 2) for i in range(32) ]
173 dmse_hf = [ np.sum((scf[8:] - T.SNS_HFCB[i]) ** 2) for i in range(32) ]
175 self.ind_lf = np.argmin(dmse_lf)
176 self.ind_hf = np.argmin(dmse_hf)
178 st1 = np.append(T.SNS_LFCB[self.ind_lf], T.SNS_HFCB[self.ind_hf])
184 x = np.abs(t2_rot)
190 proj_fac = (K - 1) / sum(np.abs(t2_rot))
191 y3 = np.floor(x * proj_fac).astype(int)
195 corr_xy = np.sum(y3 * x)
196 energy_y = np.sum(y3 * y3)
201 n_best = np.argmax(q_pvq)
215 n_best = np.argmax(q_pvq)
224 y1 = np.append(y2[:10], [0] * 6)
237 n_best = np.argmax(q_pvq)
245 y0 = np.append(y1[:10], [ 0 ] * 6)
248 n_best = 10 + np.argmax(q_pvq)
254 y0 *= np.sign(t2_rot).astype(int)
255 y1 *= np.sign(t2_rot).astype(int)
256 y2 *= np.sign(t2_rot).astype(int)
257 y3 *= np.sign(t2_rot).astype(int)
261 xq = [ y / np.sqrt(sum(y ** 2)) for y in (y0, y1, y2, y3) ]
271 self.shape = np.argmin([ np.min(dMSE[j]) for j in range(4) ])
272 self.gain = np.argmin(dMSE[self.shape])
308 gain_msb_bits = np.array([ 1, 1, 2, 2 ])[shape]
309 gain_lsb_bits = np.array([ 0, 1, 0, 1 ])[shape]
348 y = np.zeros(n, dtype=np.int)
377 y = np.empty(16, dtype=np.int)
384 y[10:] = np.zeros(6, dtype=np.int)
392 y = y / np.sqrt(sum(y ** 2))
401 scf = np.append(T.SNS_LFCB[self.ind_lf], T.SNS_HFCB[self.ind_hf]) \
480 ok = ok and np.amax(np.abs(y - y_c)) < 1e-1
509 ok = ok and np.amax(np.abs(y - y_c)) < 1e0
521 ok = ok and np.amax(np.abs(scf - C.SCF[dt][i])) < 1e-4
527 ok = ok and np.any(y[0][:16] - C.SNS_Y0[dt][i] == 0)
528 ok = ok and np.any(y[1][:10] - C.SNS_Y1[dt][i] == 0)
529 ok = ok and np.any(y[2][:16] - C.SNS_Y2[dt][i] == 0)
530 ok = ok and np.any(y[3][:16] - C.SNS_Y3[dt][i] == 0)
535 ok = ok and np.amax(np.abs(scf_q - C.SCF_Q[dt][i])) < 1e-5
538 ok = ok and np.amax(np.abs(1 - x/C.X_S[dt][i])) < 1e-5
552 ok = ok and np.amax(np.abs(1 - x/C.X_S[dt][i])) < 1e-5
574 ok = ok and np.amax(np.abs(x - C.X_HAT_SNS[dt][i])) < 1e0
580 rng = np.random.default_rng(1234)