1 | """ |
---|
2 | Sets the constants for the CLIO data acquisition code |
---|
3 | March 2017 |
---|
4 | """ |
---|
5 | |
---|
6 | __author__ = 'delerue' |
---|
7 | |
---|
8 | |
---|
9 | import glob |
---|
10 | import time |
---|
11 | |
---|
12 | global basedir |
---|
13 | global FILE_STOP |
---|
14 | global FILE_PAUSE |
---|
15 | global data_directory |
---|
16 | global data_dir |
---|
17 | global motor_controller_IP |
---|
18 | global motor_controller_port |
---|
19 | global write_to_motor_dated_log |
---|
20 | global motor_position_info |
---|
21 | #global motor_position_save |
---|
22 | global motor_position_request |
---|
23 | global code_directory |
---|
24 | |
---|
25 | # detecting on which computer the code is running |
---|
26 | computer=0 |
---|
27 | COMPUTER_SP_CLIO=1 |
---|
28 | COMPUTER_ND_MAC=2 |
---|
29 | |
---|
30 | if (len(glob.glob("/home/etalon-admin/"))==1): |
---|
31 | print "Running on SP@CLIO's DAQ computer" |
---|
32 | computer=COMPUTER_SP_CLIO |
---|
33 | elif (len(glob.glob("/Users/delerue/"))==1): |
---|
34 | print "Running on Nicolas'Mac" |
---|
35 | computer=COMPUTER_ND_MAC |
---|
36 | |
---|
37 | |
---|
38 | today_str = time.strftime("%Y%m%d") |
---|
39 | |
---|
40 | |
---|
41 | # setting the correct directories |
---|
42 | if computer==COMPUTER_SP_CLIO: |
---|
43 | basedir="/home/etalon-admin/" |
---|
44 | code_directory=basedir+"control/" |
---|
45 | FILE_PAUSE=basedir+'acquisition_data/pause_acquisition'; |
---|
46 | FILE_STOP=basedir+'acquisition_data/stop_acquisition'; |
---|
47 | motor_position_info=basedir+'acquisition_data/motor_position.txt'; |
---|
48 | motor_position_request=basedir+'acquisition_data/motor_requested_position.txt'; |
---|
49 | data_directory_base="/var/www/html/CLIO/" |
---|
50 | # data_dir="/home/etalon-admin/acquisition_data" |
---|
51 | |
---|
52 | elif computer==COMPUTER_ND_MAC: |
---|
53 | basedir="/Users/delerue/" |
---|
54 | # data_dir="/home/etalon-admin/acquisition_data" |
---|
55 | code_directory=basedir+"control/" |
---|
56 | FILE_PAUSE=basedir+'acquisition_data/pause_acquisition'; |
---|
57 | FILE_STOP=basedir+'acquisition_data/stop_acquisition'; |
---|
58 | motor_position_info=basedir+'acquisition_data/motor_position.txt'; |
---|
59 | motor_position_request=basedir+'acquisition_data/motor_requested_position.txt'; |
---|
60 | # data_directory_base="/var/www/html/CLIO/" |
---|
61 | data_directory_base='/Users/delerue/Downloads/CLIO_tmp/' |
---|
62 | today_str="20170227" |
---|
63 | FILE_STOP='/Users/delerue/Downloads/CLIO_tmp/20170227/stop_acquisition'; |
---|
64 | |
---|
65 | # data_dir="/home/etalon-admin/acquisition_data" |
---|
66 | |
---|
67 | data_directory=data_directory_base+today_str+"/" |
---|
68 | |
---|
69 | |
---|
70 | #Scope IPs |
---|
71 | SCOPE1_IP='129.175.202.193' |
---|
72 | SCOPE2_IP='129.175.202.14' |
---|
73 | |
---|
74 | motor_controller_IP='129.175.202.187' |
---|
75 | motor_controller_port=30000 |
---|
76 | |
---|
77 | #Cameras [top, upstream, downstream] |
---|
78 | CAMERA_1_ON=1 |
---|
79 | CAMERA_2_ON=0 |
---|
80 | CAMERAS_ON=[CAMERA_1_ON, CAMERA_2_ON] |
---|
81 | |
---|
82 | CAMERA_1_TYPE=1 |
---|
83 | CAMERA_2_TYPE=0 |
---|
84 | CAMERAS_TYPE=[CAMERA_1_TYPE, CAMERA_2_TYPE] |
---|
85 | |
---|
86 | |
---|
87 | CAMERA_1_PORT='129.175.202.189:80' |
---|
88 | CAMERA_2_PORT='129.175.202.190:80' |
---|
89 | CAMERAS_PORT=[CAMERA_1_PORT, CAMERA_2_PORT] |
---|
90 | |
---|
91 | write_to_motor_dated_log = data_directory + "clio_write_to_motor_dated_log" |
---|
92 | #motor_position_save=data_directory + "motor_position.txt'; |
---|
93 | |
---|
94 | data_dir=data_directory |
---|