if np.mean(i[0:2000]) < 0: signals.append(False) else: signals.append(True) return signals if __name__ == "__main__": #SDAS DATA client = StartSdas() shotP = 44501 shotH = 44330 shotV = 44278 #%matplotlib qt4 times, mirnovs_P = getMirnovInt(client, shotP, 'Post') times, mirnovs_H = getMirnovInt(client, shotH, 'Post') times, mirnovs_V = getMirnovInt(client, shotV, 'Post') timesp, Ip_prim, tbs = getSignal(client, ch_prim, shotP) timesp, Ip_hor, tbs = getSignal(client, ch_hor, shotP) timesp, Ip_vert, tbs = getSignal(client, ch_vert, shotP) timesh, Ih_prim, tbs = getSignal(client, ch_prim, shotH) timesh, Ih_hor, tbs = getSignal(client, ch_hor, shotH) timesh, Ih_vert, tbs = getSignal(client, ch_vert, shotH) timesv, Iv_prim, tbs = getSignal(client, ch_prim, shotV) timesv, Iv_hor, tbs = getSignal(client, ch_hor, shotV) timesv, Iv_vert, tbs = getSignal(client, ch_vert, shotV)
B2FluxMirn = 50 * 49e-6 scale = 1e6 # values in uV.s #Nshot=44330 # Horizontal Field #PfcHCurrent = -175.0 # in shot=44330 #Nshot=44330 # Horizontal Field Nshot = 44123 # Horizontal Field PfcHCurrent = -190 # -175.0 flatSample = 3700 # sample with flat values #Nshot=42966 # Horizontal Field #PfcHCurrent = 260.0 #flatSample = 2000 # sample with flat values times, dataH = getMirnovInt(client, Nshot, correctWO='Post') dataHarr = np.array(dataH) #plotAllPoloid(times, dataHarr*scale, show=True, title="Horizontal Field Coils # " +str(Nshot), ylim=10.0) #fig, ax = plt.subplots() #fig.suptitle("Horizontal Field Coils # " +str(Nshot)) #lines = ax.plot(times,dataHarr.T*scale) #ax.legend(lines, ['m1', 'm2', 'm3','m4', 'm5', 'm6','m7', \ # 'm8', 'm9','m10', 'm11', 'm12'],loc='right') #ax.set_ylabel('MirnFlux / uV.s') #ax.set_xlabel('Time / us') #plt.show() fig, ax = plt.subplots() fig.suptitle("Horizontal Field Coils # " + str(Nshot) + " Sample#: " + str(flatSample))
magSys2 = signal.StateSpace(A2, Bs2, C2, Ds2) bPolIs2 = np.matmul(Is2Bpol2, IsPfc) tout2, Ic2, x2 = signal.lsim(magSys2, IsPfc.T, time) bPolIc2 = np.matmul(Ic2Bpol, Ic2.T) bPolTot2 = (bPolIs2.T + bPolIc2.T) * 50 * 49e-6 return bPolTot2, (RIc, ZIc) if __name__ == "__main__": #SDAS DATA client = StartSdas() shotP = 44501 shotH = 44330 #%matplotlib qt4 times, mirnovs = getMirnovInt(client, shotH, 'Post') timesp, I_prim, tbs = getSignal(client, ch_prim, shotH) timesh, I_hor, tbs = getSignal(client, ch_hor, shotH) np.set_printoptions(precision=3) currPrim = I_prim[10:] currHor = I_hor[10:] nc = 15 # number of coppe2r shell 'wires' ResCopper = 1.0e-4 # 0.1 mOhm aCopper = 10.0e-3 # 'wire' radius 10 mm currVert = np.zeros_like(currPrim) #currHor=np.zeros_like(currPrim) # Zero current on Hori Field Coils IsPfc = np.array([currVert, currHor, currPrim])