Ticket #8587: ref.py

File ref.py, 705 bytes (added by Samuel Jackson, 7 years ago)

python script for testing

Line 
1#Ref test for DOS
2import os
3import numpy as np
4
5#location of perl script on disk
6dos_file_path = '/home/chs18285/Documents/dos/dos.pl'
7#location of input file on disk
8input_file_path = '/home/chs18285/Documents/dos/squaricn.phonon'
9
10def readLogFile(wsName):
11        fname = "log.txt"
12        dataX, dataY = np.loadtxt(fname, unpack=True)
13        return CreateWorkspace(DataX=dataX, DataY=dataY, OutputWorkspace=wsName + "_refdata")
14
15os.system("perl %s %s > log.txt" % (dos_file_path, input_file_path))
16ws = readLogFile("DOS")
17
18os.system("perl %s -ir %s > log.txt" % (dos_file_path, input_file_path))
19ws = readLogFile("IR")
20
21os.system("perl %s -raman %s > log.txt" % (dos_file_path, input_file_path))
22ws = readLogFile("Raman")