Changeset 790 in ETALON for BPM/initialise_motors.py
- Timestamp:
- Aug 3, 2018, 2:44:23 PM (6 years ago)
- File:
-
- 1 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)
Note: See TracChangeset
for help on using the changeset viewer.