Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #%%
- lista = []
- f = open("./FPA.txt", "r")
- for x in f:
- #print(x)
- a=x.split('\t')
- #print(a)
- b = a[1].split(',')
- c = a[2].split(',')
- #print(b)
- #print(c)
- tmp = [a[0]]+b+c
- #print("\n\n")
- #print(tmp)
- try:
- tmp[4]=tmp[4].replace('\n','')
- except:
- pass
- #print("\n\n")
- #print(tmp)
- lista.append(tmp)
- f.close()
- lista.pop(0)
- matrice=np.array(lista, dtype = np.float32)
- #mm=matrice.astype(float)
- plt.plot(matrice[:,0] , matrice[:,1])
- plt.plot(matrice[:,0] , np.sqrt(matrice[:,3]**2 + matrice[:,4]**2) )
- #plt.yscale('log')
- plt.xscale('log')
- plt.show()
- #Esporto i dati..
- f=matrice[:,0]
- v1=matrice[:,1]
- v2=np.sqrt(matrice[:,3]**2 + matrice[:,4]**2)
- dp=np.angle( np.vectorize(complex)(matrice[:,3], matrice[:,4]) , deg=True )
- v2 = np.abs( np.vectorize(complex)(matrice[:,3], matrice[:,4]) )
- plt.plot(f,v1)
- plt.plot(f,v2)
- plt.xscale('log')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement