-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreduce_MANDI.py
23 lines (22 loc) · 967 Bytes
/
reduce_MANDI.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import sys
import os
import numpy as np
import matplotlib
matplotlib.use("agg")
if __name__ == "__main__":
np.seterr("ignore") # ignore division by 0 warning in plots
# check number of arguments
if (len(sys.argv) != 3):
logger.error("autoreduction code requires a filename and an output directory")
sys.exit()
if not(os.path.isfile(sys.argv[1])):
logger.error("data file "+sys.argv[1]+ " not found")
sys.exit()
else:
filename = sys.argv[1]
outdir = sys.argv[2]
load_venv_command = 'source /SNS/snfs1/instruments/MANDI/shared/autoreduce/venv/bin/activate; '
python_command = '/SNS/users/ntv/workspace/mantid/release/bin/mantidpython'
script_to_call = '/SNS/snfs1/instruments/MANDI/shared/autoreduce/reduce_MANDI_doWork.py'
total_command = load_venv_command + python_command + ' ' + script_to_call + ' ' + filename + ' '+ outdir
#os.system(total_command)