Changeset 779 in ETALON
- Timestamp:
- Jun 15, 2018, 2:13:45 PM (6 years ago)
- Location:
- BPM
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
BPM/initialise_motors.py
r778 r779 406 406 motor_enable(1) 407 407 motor_enable(2) 408 move_motor_absolute(1,10000,begin1) 409 move_motor_absolute(2,10000,begin2) 410 while (motor_get(1, 'status') != 'READY') or (motor_get(2, 'status') != 'READY'): 411 time.sleep(1) 412 print("bagin position ok ?") 413 time.sleep(15) 408 414 # L = [[],[],[],[],[],[]] 409 415 for i in range(begin1, end1, pas1): … … 417 423 time.sleep(1) 418 424 time.sleep(1) 419 420 425 acqui_column(begin2, end2, pas2, data_name_and_path, end1) 421 426 print("end position ok ?") 427 time.sleep(15) 422 428 motor_disable(1) 423 429 motor_disable(2) -
BPM/motor_control.py
r778 r779 37 37 #horizontal_acquisition(4000,0,-4000,"test") 38 38 39 acquisition(-1 0000,10000,10000,-50000,0,25000,"test")39 acquisition(-15000,15000,10000,-50000,50000,25000,"test") 40 40 41 41 #acquisition(-10000,10000,1000,-50000,0,5000,"test") -
BPM/print_datas.py
r777 r779 16 16 17 17 18 def print_data(fichier):18 def read_data(fichier): 19 19 fichier = open(fichier, "r") 20 20 A = fichier.read() … … 52 52 for i in range(1,5): 53 53 L[i] = product_list(L[i],1000) 54 print_graph(L) 54 return(L) 55 56 55 57 56 58 def print_graph(L): 57 a = np.array([L[0][i],L[1][i]] for i in range(len(L[0])))59 # a = np.array([L[0][i],L[1][i]] for i in range(len(L[0]))) 58 60 fig = plt.figure(1) 59 61 plt.clf() 60 61 62 lr1 = stats.linregress(L[0],L[1]) # return tuple (pente,ordonnee a l'origine, coef de correlation, p-value, erreur standard de l'estimation) 62 63 plt.plot(L[0],L[1], "r", label = "BMP_ref") … … 80 81 plt.show() 81 82 83 def residu(L): 84 fig = plt.figure(1) 85 plt.clf() 86 plt.title("Residu") 87 lr1 = stats.linregress(L[0],L[1]) # return tuple (pente (.slope),ordonnee a l'origine (.intercept), coef de correlation (.rvalue), p-value (.pvalue ?), erreur standard de l'estimation (.stderr)) 88 for i in range(len(L[1])): 89 L[1][i] = L[1][i] - lr1.slope*L[0][i] - lr1.intercept 90 plt.plot(L[0],L[1], "r", label = "BMP_ref") 91 92 lr2 = stats.linregress(L[0],L[2]) 93 for i in range(len(L[2])): 94 L[2][i] = L[2][i] - lr1.slope*L[0][i] - lr1.intercept 95 plt.plot(L[0],L[2], "b", label = "BMP_impr") 96 97 lr3 = stats.linregress(L[0],L[3]) 98 for i in range(len(L[3])): 99 L[3][i] = L[3][i] - lr1.slope*L[0][i] - lr1.intercept 100 plt.plot(L[0],L[3], "g", label = "BMP_ref") 101 102 lr4 = stats.linregress(L[0],L[4]) 103 for i in range(len(L[4])): 104 L[4][i] = L[4][i] - lr1.slope*L[0][i] - lr1.intercept 105 plt.plot(L[0],L[4], "m", label = "BMP_impr") 106 plt.legend() 107 plt.xlabel("length in million motor step") 108 plt.ylabel("tension in mV") 109 plt.show() 82 110 83 111 """ … … 88 116 plt.show() 89 117 """ 118 def print_data(fichier): 119 L = read_data(fichier) 120 print_graph(L) 90 121 122 def print_residu(fichier): 123 L = read_data(fichier) 124 residu(L) 91 125 92 #print_data("data/position_vs_tension_ch1-3_bpm_ref_ch2-4_bpm_impr_20180611_160153_0.txt") 126 print_data("data/position_vs_tension_ch1-3_bpm_ref_ch2-4_bpm_impr_20180611_160153_0.txt") 127 print_residu("data/position_vs_tension_ch1-3_bpm_ref_ch2-4_bpm_impr_20180611_160153_0.txt") 128 93 129 #print_data("data/position_vs_tension_ch1-3_bpm_ref_ch2-4_bpm_impr_20180611_163036_0.txt") 94 130 95 131 #print_data("data/position_vs_tension_ch1-3_bpm_ref_ch2-4_bpm_impr_vertical_acquisition_20180612_0.txt") 96 print_data("data/position_vs_tension_ch1-3_bpm_ref_ch2-4_bpm_impr_vertical_acquisition_20180612_0.txt")132 #print_data("data/position_vs_tension_ch1-3_bpm_ref_ch2-4_bpm_impr_vertical_acquisition_20180612_0.txt")
Note: See TracChangeset
for help on using the changeset viewer.