Changeset 790 in ETALON
- Timestamp:
- Aug 3, 2018, 2:44:23 PM (6 years ago)
- Location:
- BPM
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
BPM/initialise_motors.py
r787 r790 8 8 from read_adc import * 9 9 import numpy as np 10 import matplotlib.pyplot as plt10 #import matplotlib.pyplot as plt 11 11 from datetime import datetime 12 12 … … 16 16 write_to_motor_dated_log = data_dir + './write_to_motor_log' 17 17 18 #from writeclient import *18 from writeclient import * 19 19 import time 20 20 … … 263 263 motor_disable(1) 264 264 265 def path(bpm_name ): # create the path of the file what will contain data265 def path(bpm_name, list_of_data): # create the path of the file what will contain data 266 266 idata = 0 267 267 start_time_str=datetime.now().strftime("%Y%m%d") 268 268 data_name_and_path = data_dir+"data/" 269 string_of_data = "" 270 for data_name in list_of_data: 271 string_of_data += data_name + "_" 269 272 if not os.path.exists(data_name_and_path) : 270 273 os.makedirs(data_name_and_path) 271 data_name_and_path = data_name_and_path+ "BPM-number_x-motor-step_x-motor-mm_y-motor-step_y-motor_mm_Va_Vb_Vc_Vd_Sum_X_Y_"+bpm_name+"_"+start_time_str+"_"274 data_name_and_path = data_name_and_path+string_of_data+bpm_name+"_"+start_time_str+"_" 272 275 while os.path.exists(data_name_and_path+str(idata)+".txt") : 273 276 idata+=1 … … 290 293 bpm_name1 = "BPM_E",bpm_name2 = "BPM_impr",bpm_name3 = "BPM_C",bpm_name4 = None): #name of the BPM used (as default, it the configuration of the BPM when this code was writen 291 294 292 data_name_and_path = path(title_bpm_name ) #create the name of the datafile295 data_name_and_path = path(title_bpm_name, list_of_data) #create the name of the datafile 293 296 write_first_line(data_name_and_path, list_of_data) # write first line of the datafile with the name of the data 294 297 bpm_list = initialise_bpm(bpm_name1,bpm_name2,bpm_name3,bpm_name4) # initialise BPM (program on read_adc.py) … … 312 315 bpm_name1 = "BPM_E",bpm_name2 = "BPM_impr",bpm_name3 = "BPM_C",bpm_name4 = None): #name of the BPM used (as default, it the configuration of the BPM when this code was writen 313 316 314 data_name_and_path = path(title_bpm_name ) #create the name of the datafile317 data_name_and_path = path(title_bpm_name, list_of_data) #create the name of the datafile 315 318 write_first_line(data_name_and_path, list_of_data) # write first line of the datafile with the name of the data 316 319 bpm_list = initialise_bpm(bpm_name1,bpm_name2,bpm_name3,bpm_name4) # initialise BPM (program on read_adc.py) … … 334 337 bpm_name1 = "BPM_E",bpm_name2 = "BPM_impr",bpm_name3 = "BPM_C",bpm_name4 = None):#name of the BPM used (as default, it the configuration of the BPM when this code was writen 335 338 336 data_name_and_path = path(title_bpm_name )#create the name of the datafile339 data_name_and_path = path(title_bpm_name, list_of_data)#create the name of the datafile 337 340 write_first_line(data_name_and_path, list_of_data)# write first line of the datafile with the name of the data 338 341 bpm_list = initialise_bpm(bpm_name1,bpm_name2,bpm_name3,bpm_name4)# initialise BPM (program on read_adc.py) … … 340 343 motor_enable(2) 341 344 for y_position in np.linspace(begin2, end2, number_of_point2): 342 345 motor_move_absolute(2,2000,y_position) 343 346 print('moteur going to', y_position) 344 347 for x_position in np.linspace(begin1,end1,number_of_point1): … … 349 352 time.sleep(1) 350 353 acquisition_libera(x_position, y_position, data_name_and_path, statistic_number, list_of_data, bpm_list) # read_the data (program on read_adc.py) 351 begin1,end1 = end1,begin1 #to 354 begin1,end1 = end1,begin1 #to go and back 352 355 motor_disable(1) 353 356 motor_disable(2) -
BPM/motor_control.py
r783 r790 1 1 #import time 2 #import urllib3 2 #import os 4 3 from initialise_motors import * 5 from scope_function import *4 #from scope_function import * 6 5 #import numpy as np 7 6 #import matplotlib.pyplot as plt … … 13 12 #motor_reset(2) 14 13 #motor_disable(2) 15 14 """ 16 15 motor_enable(1) 17 16 move_motor_absolute(1,5000,-5000) 18 #while motor_get(1, 'status') != 'READY':19 # time.sleep(1)20 17 move_motor_absolute(1,5000,0) 21 #while motor_get(1, 'status') != 'READY':22 # time.sleep(1)23 18 motor_disable(1) 24 25 """26 for i in range(5):27 motor_enable(2)28 move_motor_absolute(2,5000,-5000)29 while motor_get(2, 'status') != 'READY':30 time.sleep(1)31 time.sleep(10)32 33 34 move_motor_absolute(2,5000,0)35 while motor_get(2, 'status') != 'READY':36 time.sleep(1)37 motor_disable(2)38 time.sleep(10)39 19 """ 40 20 41 #controller_hello() 42 #move_motor_relative(1,1000,-1000) 43 #time.sleep(1) 44 #move_motor_relative(1,1000,1000) 45 #urllib.urlretrieve('http://10.0.1.112/crt_print.png','../oscillo_17-05-2018_voltage5V_freq1MHz_signal_carre/test2.png') 46 #if not os.path.exists(repertoire): 47 #os.makedirs('./test') cree repertoir 21 #acquisition_2D(-200000,200000,400, -240000, -260000, 3, 'BPM0-E_BPM1-impr_BPM2-C_100pts-horizontal_3pts-vertical', statistic_number = 100) 22 #acquisition_2D(-15000,15000,3, 0, -500000, 400, 'BPM0-E_BPM1-impr_BPM2-C_3pts-horizontal_100pts-vertical', statistic_number = 100) 48 23 49 #position_test_horizontal() 50 51 52 # creation graphique 53 54 #horizontal_acquisition(4000,0,-4000,"test") 55 56 #acquisition(-100000,100000,20000,-50000,50000,10000,"test") 57 58 #acquisition(-10000,10000,1000,-50000,0,5000,"test") 59 60 #turn_on() 61 62 #vertical_acquisition(-110000,90000,4000,"ch1-3_bpm_ref_ch2-4_bpm_impr_vertical_acquisition") 63 64 #vertical_acquisition(90000,-110000,4000,"ch1-3_bpm_ref_ch2-4_bpm_impr_vertical_acquisition") 65 66 #vertical_acquisition(0,-4000,2000,"test") 67 #vertical_acquisition(4000,0,2000,"test2") 68 69 #horizontal_acquisition(400000,0,-4000,"ch1-3_bpm_ref_ch2-4_bpm_impr") 70 71 #turn_off() 72 73 #fichier = open("24-05-2018_acquisition_from_0_to_400000_step_of_1000.txt", "r") 74 75 #fichier.close() 24 for i in range(5): 25 acquisition_2D(0,0,1, -380000, -320000, 10, 'test_decrochage_BPM0-E_BPM1-impr_BPM2-C',statistic_number = 10) 26 acquisition_2D(0,0,1, -320000, -380000, 10, 'test_decrochage_BPM0-E_BPM1-impr_BPM2-C',statistic_number = 10) 76 27 77 28 78 29 79 """80 for i in range(3):81 move_motor_absolute(1,5000,i*10000)82 while motor_get(1, 'status') != 'READY':83 time.sleep(1)84 time.sleep(1)85 urllib.urlretrieve('http://10.0.1.112/crt_print.png','../oscillo_17-05-2018_voltage5V_freq1MHz_signal_carre/position_'+str(i*10000)+'.png')86 time.sleep(1)87 30 31 #motor_enable(1) 88 32 89 move_motor_absolute(1,5000,0)90 while motor_get(1, 'status') != 'READY':91 time.sleep(1)92 time.sleep(1)93 motor_disable(1)94 95 96 """97 33 #motor_enable(2) 98 34 99 #motor_disable(2) #commande dangeureuse35 #motor_disable(2) -
BPM/print_datas.py
r789 r790 188 188 189 189 def linear_fonction_on_data(list_data_name, data, data_name, begin_mm = None, end_mm = None): # convert the data name data_name (use to length convertion) 190 if begin_mm is None and end_mm is None: 191 return(data) 190 192 number_data_name = number_of_data_name(list_data_name, data_name) 191 193 begin_step,end_step = min_max(list_data_name, data, data_name) … … 216 218 return("Coordonnee y d'apres le moteur (en en million pas)") 217 219 elif data_name == "y_motor_mm" : 218 return("Coordonnee y d'apres l e moteur(en mm)")220 return("Coordonnee y d'apres la regle optique (en mm)") 219 221 elif data_name == "Va" : 220 222 return("Tension sur l'electrode a (en mV)") … … 304 306 return("y coordinate acording to motor (in step)") 305 307 elif data_name == "y_motor_mm" : 306 return("y coordinate acording t o motor(in mm)")308 return("y coordinate acording the optical rule (in mm)") 307 309 elif data_name == "Va" : 308 310 return("Tension on electrode a (in mV)") … … 316 318 return("Sum of tensions on electrodes (in mV)") 317 319 elif data_name == "x_libera_mm" : 318 return("x coordinate acording d'apres leLibera (in mm)")320 return("x coordinate acording to Libera (in mm)") 319 321 elif data_name == "y_libera_mm" : 320 return(" Coordonnee x d'apres le Libera (en mm)")322 return("y coordonnee acording to Libera (in mm)") 321 323 elif data_name == "x_libera_um" : 322 return("x coordinate acording d'apres leLibera (in um)")324 return("x coordinate acording to Libera (in um)") 323 325 elif data_name == "y_libera_um" : 324 return(" Coordonnee x d'apres le Libera (en um)")326 return("x coordonnee acording to Libera (in um)") 325 327 else: 326 328 print("unknow ask data_name named " + data_name) … … 455 457 plt.ylabel(y_label, fontsize=20) 456 458 if title is None: 457 plt.title("Residu de " + y_label + " 458 else: 459 plt.title("Residu de " + y_label + " 459 plt.title("Residu de " + y_label + "\nen fonction de " + x_label, fontsize=20) 460 else: 461 plt.title("Residu de " + y_label + "\nen fonction de " + x_label + "\n" +title, fontsize=20) 460 462 plt.gca().xaxis.set_tick_params(labelsize = 15) 461 463 plt.gca().yaxis.set_tick_params(labelsize = 15) … … 486 488 """ 487 489 488 def oposit_name(list_data_name, data_name ):490 def oposit_name(list_data_name, data_name, data_name2 = None): 489 491 if data_name[0] == "x": 490 492 if "y_motor_step" in list_data_name: 491 493 return("y_motor_step") 492 if data_name[0] == "y":494 elif data_name[0] == "y": 493 495 if "x_motor_step" in list_data_name: 494 496 return("x_motor_step") 497 elif data_name[0] == "V": 498 if data_name2[0] == "x": 499 return("y_motor_step") 500 elif data_name2[0] == "y": 501 return("x_motor_step") 495 502 else: 496 503 print("ERROR MULTIPLE LINE") … … 499 506 500 507 501 def graph_fr(fichier, x_data_name, y_data_name, lin_reg = None, residu = None, rms = None, x_begin_mm = None, x_end_mm = None, y_begin_mm = None, y_end_mm = None, x_minimal = None, x_maximal = None, y_minimal = None, y_maximal = None, centrage = None ):508 def graph_fr(fichier, x_data_name, y_data_name, lin_reg = None, residu = None, rms = None, x_begin_mm = None, x_end_mm = None, y_begin_mm = None, y_end_mm = None, x_minimal = None, x_maximal = None, y_minimal = None, y_maximal = None, centrage = None, one_bpm = None): 502 509 (list_data_name,data) = read_data(fichier) 510 if not(x_data_name in list_data_name): 511 print("This x_data_name doesn't exist, choise within : ") 512 print(list_data_name) 513 return(0) 514 if not(y_data_name in list_data_name): 515 print("This y_data_name doesn't exist, choise within : ") 516 print(list_data_name) 517 return(0) 503 518 data = convert_data(list_data_name, data) 504 519 global global_index_figure # to creat different figure … … 515 530 if "bpm_name" in list_data_name: 516 531 all_bpm_name = all_value_of_data(list_data_name, data, "bpm_name") 532 if not(one_bpm is None): 533 if one_bpm in all_bpm_name: 534 all_bpm_name = [one_bpm] 535 else: 536 print("This BPM doesn't exist, choise within : ") 537 print(all_bpm_name) 538 return(0) 517 539 while len(all_bpm_name) > len(color_list): 518 540 color_list += color_list 519 oposit_y_data_name = oposit_name(list_data_name, y_data_name )541 oposit_y_data_name = oposit_name(list_data_name, y_data_name, x_data_name) 520 542 oposit_y_data_number = number_of_data_name(list_data_name, oposit_y_data_name) 521 543 if oposit_y_data_number == "": … … 542 564 #graph_fr("data/bpm_name_bpm_number_x_motor_step_x_motor_mm_y_motor_step_y_motor_mm_Va_Vb_Vc_Vd_Sum_x_libera_mm_y_libera_mm_BPM0-E_BPM1-impr_BPM2-C_100pts-horizontal_3pts-vertical_20180801_0.txt", "x_motor_step", "x_libera_mm",lin_reg = "true", residu = "yes", rms = "yes") 543 565 544 graph_fr("data/bpm_name_bpm_number_x_motor_step_x_motor_mm_y_motor_step_y_motor_mm_Va_Vb_Vc_Vd_Sum_x_libera_mm_y_libera_mm_BPM0-E_BPM1-impr_BPM2-C_100pts-horizontal_3pts-vertical_20180801_1.txt", "x_motor_step", "x_libera_mm",lin_reg = "true", residu = "yes", rms = "yes")#, x_begin_mm =103.78 , x_end_mm = 72.5) 545 546 graph_fr("data/bpm_name_bpm_number_x_motor_step_x_motor_mm_y_motor_step_y_motor_mm_Va_Vb_Vc_Vd_Sum_x_libera_mm_y_libera_mm_BPM0-E_BPM1-impr_BPM2-C_100pts-horizontal_3pts-vertical_20180801_1.txt", "x_motor_mm", "x_libera_mm",lin_reg = "true", residu = "yes", rms = "yes", centrage = "yes")#, x_begin_mm =103.78 , x_end_mm = 72.5, x_minimal = 77., x_maximal = 99, centrage = "yes")#, x_minimal = 77, x_maximal = 99 547 548 #graph_fr("data/bpm_name_bpm_number_x_motor_step_x_motor_mm_y_motor_step_y_motor_mm_Va_Vb_Vc_Vd_Sum_x_libera_mm_y_libera_mm_BPM0-E_BPM1-impr_BPM2-C_3pts-horizontal_100pts-vertical_20180802_0.txt", "x_motor_mm", "x_libera_mm",lin_reg = "true", residu = "yes", rms = "yes") 549 566 #graph_fr("data/bpm_name_bpm_number_x_motor_step_x_motor_mm_y_motor_step_y_motor_mm_Va_Vb_Vc_Vd_Sum_x_libera_mm_y_libera_mm_BPM0-E_BPM1-impr_BPM2-C_100pts-horizontal_3pts-vertical_20180801_1.txt", "x_motor_mm", "x_libera_mm",lin_reg = "true", residu = "yes", rms = "yes", x_begin_mm =103.78 , x_end_mm = 72.5) 567 568 #graph_fr("data/bpm_name_bpm_number_x_motor_step_x_motor_mm_y_motor_step_y_motor_mm_Va_Vb_Vc_Vd_Sum_x_libera_mm_y_libera_mm_BPM0-E_BPM1-impr_BPM2-C_100pts-horizontal_3pts-vertical_20180801_1.txt", "x_motor_mm", "x_libera_mm",lin_reg = "true", residu = "yes", rms = "yes", centrage = "yes", x_begin_mm =103.78, x_end_mm = 72.5 , x_minimal = 86., x_maximal = 96.)#, centrage = "yes")#, x_minimal = 77, x_maximal = 99 569 570 #graph_fr("data/bpm_name_bpm_number_x_motor_step_x_motor_mm_y_motor_step_y_motor_mm_Va_Vb_Vc_Vd_Sum_x_libera_mm_y_libera_mm_BPM0-E_BPM1-impr_BPM2-C_3pts-horizontal_100pts-vertical_20180802_0.txt", "y_motor_mm", "y_libera_mm",lin_reg = "true", residu = "yes", rms = "yes", centrage = "yes") 571 graph_fr("data/bpm_name_bpm_number_x_motor_step_x_motor_mm_y_motor_step_y_motor_mm_Va_Vb_Vc_Vd_Sum_x_libera_mm_y_libera_mm_BPM0-E_BPM1-impr_BPM2-C_3pts-horizontal_100pts-vertical_20180802_0.txt", "y_motor_step", "y_libera_mm",lin_reg = "true", residu = "yes", rms = "yes")#, centrage = "yes", y_minimal = -20., y_maximal = -10.) 572 573 #graph_fr("data/bpm_name_bpm_number_x_motor_step_x_motor_mm_y_motor_step_y_motor_mm_Va_Vb_Vc_Vd_Sum_x_libera_mm_y_libera_mm_BPM0-E_BPM1-impr_BPM2-C_3pts-horizontal_100pts-vertical_20180802_0.txt", "y_motor_mm", "Va", residu = "yes", centrage = "yes", one_bpm = "BPM_E")#, rms = "yes") 550 574 551 575 -
BPM/read_adc.py
r788 r790 1 1 import PyTango 2 2 import os 3 import time 3 4 from bpm_constants import * 4 5 from datetime import datetime … … 10 11 ##PyTango.Database().get_device_exported('/opt/libera/sbin/libera-ds libera-instrument1') 11 12 13 14 12 15 PyTango.ApiUtil.get_env_var("TANGO_HOST") 13 16 14 17 def initialise_bpm(bpm_name1, bpm_name2, bpm_name3, bpm_name4): 15 18 bpm_list = [] 16 if not(bpm_name1 is None): 17 bpm_list.append([bpm_name1,DeviceProxy("Maquette/diag/bpm1")]) 18 if not(bpm_name2 is None): 19 bpm_list.append([bpm_name2,DeviceProxy("Maquette/diag/bpm2")]) 20 if not(bpm_name3 is None): 21 bpm_list.append([bpm_name3,DeviceProxy("Maquette/diag/bpm3")]) 22 if not(bpm_name4 is None): 23 bpm_list.append([bpm_name4,DeviceProxy("Maquette/diag/bpm4")]) 24 for bpm in bpm_list: 25 bpm[1].SpEnable = True 26 bpm[1].Kx = 14136 27 bpm[1].Ky = 14136 28 bpm[1].SpThreshold = 200 29 bpm[1].SpNBefor = 1 30 bpm[1].SpNAfter = 25 19 successive_error = 0 20 while bpm_list == []: 21 try: 22 #print(successive_error) 23 successive_error += 1 24 #print("\n") 25 if not(bpm_name1 is None): 26 bpm_list.append([bpm_name1,DeviceProxy("Maquette/diag/bpm1")]) 27 if not(bpm_name2 is None): 28 bpm_list.append([bpm_name2,DeviceProxy("Maquette/diag/bpm2")]) 29 if not(bpm_name3 is None): 30 bpm_list.append([bpm_name3,DeviceProxy("Maquette/diag/bpm3")]) 31 if not(bpm_name4 is None): 32 bpm_list.append([bpm_name4,DeviceProxy("Maquette/diag/bpm4")]) 33 for bpm in bpm_list: 34 bpm[1].Fans = 6000 35 bpm[1].AdcLength = 50 36 bpm[1].SpEnable = True 37 bpm[1].Kx = 14136 38 bpm[1].Ky = 14136 39 bpm[1].SpThreshold = 200 40 bpm[1].SpNBefor = 1 41 bpm[1].SpNAfter = 20 42 except: 43 print("error of initialise bpm") 44 bpm_list = [] 45 if successive_error > 4: 46 raise 31 47 return(bpm_list) 32 48 33 49 34 #bpm_list = [DeviceProxy("Maquette/diag/bpm1"), DeviceProxy("Maquette/diag/bpm2"), DeviceProxy("Maquette/diag/bpm3")] # global list that containe data for each used BPM50 bpm_list = [DeviceProxy("Maquette/diag/bpm1"), DeviceProxy("Maquette/diag/bpm2"), DeviceProxy("Maquette/diag/bpm3")] # global list that containe data for each used BPM 35 51 #, DeviceProxy("Maquette/diag/bpm4")] 36 #bpm_list[1].Fans = 5000 52 #bpm_list[0].Fans = 2500 53 #print(bpm_list[0].get_attribute_list()) # give all the attribute of a bpm 54 #print(bpm_list[0].T2TrigCount) #give the trigger 55 #print(bpm_list[1].AdcLength) 37 56 38 57 def read_all_bpm(bpm_list): … … 57 76 58 77 59 def read_libera_and_write_2D(x_motor_step ,y_motor_step ,data_name_and_path, bpm_number, bpm, list_of_data): 78 def read_libera(bpm): 79 data_libera = [bpm[1].T2TrigCount,bpm[1].SpVa,bpm[1].SpVb,bpm[1].SpVc,bpm[1].SpVd,bpm[1].SpSum,bpm[1].SpX,bpm[1].SpY,bpm[1].T2TrigCount] 80 while data_libera[8] != data_libera[0]: 81 print("error trigger") 82 data_libera = [bpm[1].T2TrigCount,bpm[1].SpVa,bpm[1].SpVb,bpm[1].SpVc,bpm[1].SpVd,bpm[1].SpSum,bpm[1].SpX,bpm[1].SpY,bpm[1].T2TrigCount] 83 else: 84 return(data_libera) 85 86 #print(read_libera([3.1415,bpm_list[0]])) 87 88 def read_libera_and_write_2D(x_motor_step ,y_motor_step , # position of motor in step 89 data_name_and_path, 90 bpm_number, 91 bpm, #list that contain in 0 the name of the bpm, and in 1 the bpm davice on libera 92 list_of_data): # list of data what we will read 93 data_libera = [] 94 successive_error = 0 95 while data_libera == []: 96 try: 97 #print(successive_error) 98 successive_error += 1 99 #print("\n") 100 data_libera = read_libera(bpm) 101 except: 102 print("error of read libera") 103 data_libera = [] 104 if successive_error > 4: 105 raise 106 fichier = open(data_name_and_path, "a") 60 107 for data in list_of_data: 61 fichier = open(data_name_and_path, "a")62 108 if data == "bpm_name" : 63 109 fichier.write(bpm[0]) … … 65 111 elif data == "bpm_number" : 66 112 fichier.write(str(bpm_number)) 67 fichier.write(' ') 113 fichier.write(' ') 68 114 elif data == "x_motor_step" : 69 115 fichier.write(str(x_motor_step)) 70 fichier.write(' ') 116 fichier.write(' ') 71 117 elif data == "x_motor_mm" : 72 118 x_motor_mm = x_motor_step # will there isn't potentiometer, this value can't be read 73 119 fichier.write(str(x_motor_mm)) 74 fichier.write(' ') 120 fichier.write(' ') 75 121 elif data == "y_motor_step" : 76 122 fichier.write(str(y_motor_step)) 77 fichier.write(' ') 123 fichier.write(' ') 78 124 elif data == "y_motor_mm" : 79 #position = read_vertical_position()80 y_motor_mm = 0#position[0] # it's the number of the output of the optical rules125 position = read_vertical_position() 126 y_motor_mm = position[0] # it's the number of the output of the optical rules 81 127 fichier.write(str(y_motor_mm)) 82 fichier.write(' ') 128 fichier.write(' ') 83 129 elif data == "Va" : 84 fichier.write(str( bpm[1].SpVa))85 fichier.write(' ') 130 fichier.write(str(data_libera[1])) 131 fichier.write(' ') 86 132 elif data == "Vb" : 87 fichier.write(str( bpm[1].SpVb))88 fichier.write(' ') 133 fichier.write(str(data_libera[2])) 134 fichier.write(' ') 89 135 elif data == "Vc" : 90 fichier.write(str( bpm[1].SpVc))91 fichier.write(' ') 136 fichier.write(str(data_libera[3])) 137 fichier.write(' ') 92 138 elif data == "Vd" : 93 fichier.write(str( bpm[1].SpVd))94 fichier.write(' ') 139 fichier.write(str(data_libera[4])) 140 fichier.write(' ') 95 141 elif data == "Sum" : 96 fichier.write(str( bpm[1].SpSum))97 fichier.write(' ') 142 fichier.write(str(data_libera[5])) 143 fichier.write(' ') 98 144 elif data == "x_libera_mm" : 99 fichier.write(str( bpm[1].SpX))100 fichier.write(' ') 145 fichier.write(str(data_libera[6]/1000.)) #libera give value un micrometer, converted in millimeter 146 fichier.write(' ') 101 147 elif data == "y_libera_mm" : 102 fichier.write(str( bpm[1].SpY))148 fichier.write(str(data_libera[7]/1000.)) #libera give value un micrometer, we write value in mm 103 149 fichier.write(' ') 104 150 else: … … 115 161 list_of_data, #list of the name of the data that the program will read 116 162 bpm_list): #list of the bpm on which you need to read data with look like [["bpm_name1",bpm_DeviceProxy1],["bpm_name2",bpm_DeviceProxy2],...] 117 for bpm_number in range(len(bpm_list)):118 for i in range(statistic_number): #take a set of statistic_number times the data for one set of parameters163 for i in range(statistic_number): #take a set of statistic_number times the data for one set of parameters 164 for bpm_number in range(len(bpm_list)): 119 165 read_libera_and_write_2D(x_motor_step, y_motor_step,data_name_and_path, bpm_number, bpm_list[bpm_number], list_of_data) 120 166 -
BPM/read_position.py
r788 r790 38 38 39 39 40 #print(read_vertical_position())40 print(read_vertical_position())
Note: See TracChangeset
for help on using the changeset viewer.