Ticket #10929: verify10929B.py

File verify10929B.py, 2.0 KB (added by Wenduo Zhou, 6 years ago)
Line 
1######################################################################
2#Python Script Generated by GeneratePythonScript Algorithm
3######################################################################
4
5datawslist = []
6monitorwslist = []
7binpars = '5,0.1,150'
8
9# reduce single Spice data set
10for scanid in ['0001', '0002', '0003']: 
11    LoadSpiceAscii(Filename='/home/wzz/Projects/MantidTests/Tickets/10929_Reduce_HB2A/verification_test/HB2A_exp0231_scan%s.dat' % (scanid), 
12            DateAndTimeLog='date,MM/DD/YYYY,time,HH:MM:SS AM', 
13            OutputWorkspace='HB2A_exp0231_scan%s_DataTable' % (scanid), 
14            RunInfoWorkspace='HB2A_exp0231_scan%s_Log' % (scanid))
15   
16    ConvertSpiceDataToRealSpace(InputWorkspace='HB2A_exp0231_scan%s_DataTable'%(scanid), 
17            RunInfoWorkspace='HB2A_exp0231_scan%s_Log' % (scanid), 
18            OutputWorkspace='HB2A_exp0231_scan%s_DataMD' % (scanid), 
19            OutputMonitorWorkspace='HB2A_exp0231_scan%s_MonitorMD' % (scanid))
20
21    dataws = mtd["HB2A_exp0231_scan%s_DataMD"%(scanid)]
22    datawslist.append(dataws)
23
24    monitorws = mtd["HB2A_exp0231_scan%s_MonitorMD"%(scanid)]
25    monitorwslist.append(monitorws)
26
27    ConvertCWPDMDToSpectra(InputWorkspace='HB2A_exp0231_scan%s_DataMD' % (scanid), 
28            InputMonitorWorkspace='HB2A_exp0231_scan%s_MonitorMD'%(scanid), 
29            BinningParams=binpars, 
30            OutputWorkspace='TwoTheta_scan%s'%(scanid), 
31            NeutronWaveLength=2.4100000000000001)
32
33# Merge 3 scans and reduce
34mergedataws = datawslist[0] + datawslist[1]
35for i in xrange(2, len(datawslist)):
36    mergedataws += datawslist[i]
37           
38# Merge 3 scans and reduce
39mergemonitorws = monitorwslist[0] + monitorwslist[1]
40for i in xrange(2, len(monitorwslist)):
41    mergemonitorws += monitorwslist[i]
42           
43ConvertCWPDMDToSpectra(InputWorkspace=mergedataws,
44            InputMonitorWorkspace=mergemonitorws,
45            BinningParams=binpars, 
46            OutputWorkspace='TwoTheta_Merged', 
47            NeutronWaveLength=2.4100000000000001)