Ticket #4480: script_4480.py

File script_4480.py, 1.7 KB (added by Ronald Fowler, 9 years ago)

Python script to generate test data for ticket 4480

Line 
1WS_Name = 'CNCS_7860_event'
2
3#WS_Name = 'MAR11001'
4Load(Filename='CNCS_7860_event.nxs',OutputWorkspace=WS_Name )
5ConvertUnits(InputWorkspace=WS_Name,OutputWorkspace=WS_Name,Target='DeltaE',EMode='Direct',EFixed='3')
6Rebin(InputWorkspace='CNCS_7860_event',OutputWorkspace=WS_Name,Params='-1,0.05,3',PreserveEvents=False)
7SetUB(Workspace=WS_Name,a='1.4165',b='1.4165',c='1.4165',u='1,0,0',v='0,1,0')
8#AddSampleLog(Workspace=WS_Name,LogName='Ei',LogText='3',LogType='Number')
9#AddSampleLog(Workspace=WS_Name,LogName='Psi',LogText='0',LogType='Number Series')
10#SetGoniometer(Workspace=WS_Name,Axis0='Psi,1,0,0,1')
11
12
13#for i in range(0,20,1):
14TWS='MD3'
15saveDir='/home/rff93/testing/4480/'
16for i in range(0,20,5):
17   
18  CloneWorkspace(InputWorkspace=WS_Name,OutputWorkspace='preMDpart'+str(i))
19   
20  AddSampleLog(Workspace='preMDpart'+str(i),LogName='Psi',LogText=str(i),LogType='Number Series')
21  SetGoniometer(Workspace='preMDpart'+str(i),Axis0='Psi,0,1,0,1')
22  SaveNXSPE(InputWorkspace='preMDpart'+str(i),Filename=saveDir+str(i)+'.nxspe',Efixed=3,Psi=i)
23   
24  ConvertToMDEvents(InputWorkspace='preMDpart'+str(i),OutputWorkspace='MDpart'+str(i),QDimensions='QhQkQl',u='1,0,0',v='0,1,0',dEAnalysisMode='Direct',MinValues='-2,-2,-3,-1',MaxValues='2,2,3,3',SplitInto="20,20,1,1")
25#ConvertToMDEvents(InputWorkspace=WS_Name,OutputWorkspace=TWS,QDimensions='QhQkQl',u='0,1,0',v='0,0,1',dEAnalysisMode='Direct',MinValues='-2,-2,-3,-1',MaxValues='2,2,3,3',SplitInto="20,20,1,1")
26PlusMD(LHSWorkspace='MDpart0',RHSWorkspace='MDpart5',OutputWorkspace=TWS)
27PlusMD(LHSWorkspace=TWS,RHSWorkspace='MDpart10',OutputWorkspace=TWS)
28PlusMD(LHSWorkspace=TWS,RHSWorkspace='MDpart15',OutputWorkspace=TWS)
29plotSlice(TWS, xydim=["Q1","Q2"], slicepoint=[0,0] )
30
31