-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
executable file
·46 lines (35 loc) · 1.38 KB
/
main.py
File metadata and controls
executable file
·46 lines (35 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import os
import sys
import argparse
from common import Common
import config
from engScan import ENGSCAN
try:
import numpy as np
import epics
from PyQt5 import QtWidgets
except ImportError as error:
print("Please ensure that the following packages are installed properly:\n ")
print("pyepics\nnumpy\nPyQt5\n")
sys.exit()
# import heseb
app = QtWidgets.QApplication(sys.argv)
#########################################################
parser = argparse.ArgumentParser(description="XAFS/XRF Scanning Tool "\
"is a software developed by DCA at SESAME to collect exprimintal data from XAFS / XRF Beamline at SESAME ")
parser.add_argument('--testingMode', type=str,default = "No" ,help="Yes/No, default is No")
#########################################################
args = parser.parse_args()
tMode = args.testingMode
if __name__ == "__main__":
epics.PV("SCAN:STOP").put(1)
os.system("killall HESEB_ScanTool_LiveDataVisualization")
epics.PV("SCAN:STOP").put(0) #### in order to enable voltage source####
paths = Common.loadjson("configrations/paths.json")
cfg = config.ConfigGUI(paths).cfg
cfg['scanType'] = 'stepEngScan' # temprory hard codded untill adding Mapping scan
if cfg['scanType'] == 'stepEngScan':
ENGSCAN(paths = paths, cfg = cfg, testingMode = tMode)
elif cfg['scanType'] == 'stepMapScan':
MAPSCAN(paths = paths, cfg = cfg, testingMode = tMode)
sys.exit(app.exit())