Changeset 754 in ETALON for CLIO/control/plot_compare.py
- Timestamp:
- Jan 19, 2018, 6:51:35 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CLIO/control/plot_compare.py
r748 r754 19 19 global FILE_COMPARE 20 20 global data_directory_base 21 22 23 print "Use plot several files instead" 24 exit -1 21 25 22 26 … … 61 65 plt.figure(1) 62 66 67 filenames=[] 68 69 with open(FILE_COMPARE) as cfid: 70 fname=cfid.readline().rstrip() 71 if (len(fname)==0): 72 fname=cfid.readline().rstrip() 73 fnameprev='' 74 while(len(fname)>0): 75 if (fname!=fnameprev): 76 print fname 77 filenames.append(fname) 78 fnameprev=fname 79 fname=cfid.readline().rstrip() 80 cfid.close() 81 82 print "Plotting" 83 63 84 dataref=load_reference_signal() 64 85 alldata=dataref 65 86 66 with open(FILE_COMPARE) as cfid: 67 fname=cfid.readline().rstrip() 68 while(len(fname)>0): 69 print fname 70 filedata=np.loadtxt(fname, comments='#', delimiter='\t', usecols=range(0,3)) 71 alldata=np.hstack((alldata,np.zeros((np.shape(alldata)[0],1),dtype=alldata.dtype))) 72 colref=np.shape(alldata)[1]-1 73 for angle in alldata[:,0]: 74 idx=list(alldata[:,0]).index(angle) 75 idxref=np.where(filedata == angle) 87 for fname in filenames: 88 print fname 89 filedata=np.loadtxt(fname, comments='#', delimiter='\t', usecols=range(0,3)) 90 alldata=np.hstack((alldata,np.zeros((np.shape(alldata)[0],1),dtype=alldata.dtype))) 91 colref=np.shape(alldata)[1]-1 92 for angle in alldata[:,0]: 93 idx=list(alldata[:,0]).index(angle) 94 idxref=np.where(filedata == angle) 95 if (len(idxref[0])==1): 76 96 alldata[idx,colref]=filedata[idxref[0],1] 77 97 78 79 plt.plot(alldata[:,0], alldata[:,colref],label=os.path.basename(fname).replace("data_CLIO_","").replace(".sig",""))80 plt.figure(2)81 plt.plot(alldata[:,0], alldata[:,colref]-alldata[:,1],label=os.path.basename(fname).replace("data_CLIO_","").replace(".sig",""))82 fname=cfid.readline().rstrip()98 plt.figure(1) 99 plt.plot(alldata[:,0], alldata[:,colref],label=(os.path.basename(fname).replace("data_CLIO_","").replace(".sig",""))[-8:]) 100 # plt.plot(alldata[:,0], alldata[:,colref],label=(os.path.basename(fname).replace("data_CLIO_","").replace(".sig",""))) 101 plt.figure(2) 102 plt.plot(alldata[:,0], alldata[:,colref]-alldata[:,1],label=os.path.basename(fname).replace("data_CLIO_","").replace(".sig","")[-8:]) 83 103 84 104 # ckey_values={} … … 91 111 # fid.close() 92 112 93 cfid.close()94 113 95 114 96 115 plt.figure(1) 97 plt.title('Comparison ')116 plt.title('Comparison of the selected data') 98 117 plt.ylabel('Signal amplitude [a.u.]') 99 118 plt.xlabel('Detector angle [deg.]') … … 105 124 106 125 plt.figure(2) 107 plt.title('Comparison (ref substracted)')126 plt.title('Comparison (reference substracted)') 108 127 plt.ylabel('Signal amplitude above reference [a.u.]') 109 128 plt.xlabel('Detector angle [deg.]')
Note: See TracChangeset
for help on using the changeset viewer.