Ticket #3557: MergeMD.py

File MergeMD.py, 1.0 KB (added by Owen Arnold, 9 years ago)
Line 
1import time
2LoadEventNexus(Filename='C:/mantid/Test/AutoTestData/CNCS_7860_event.nxs',OutputWorkspace='CNCS_7860_event_NXS',CompressTolerance='0.10000000000000001')
3
4start = time.time();
5for omega in xrange(0, 20):
6 print "Starting omega %03d degrees" % omega
7 CreateMDWorkspace(Dimensions='3',Extents='-5,5,-5,5,-5,5',Names='Q_sample_x,Q_sample_y,Q__sample_z',Units='A,A,A',SplitInto='5',SplitThreshold='2000',MaxRecursionDepth='3',
8  MinRecursionDepth='3', OutputWorkspace='CNCS_7860_event_MD')
9
10 # Convert events to MD events
11 AddSampleLog("CNCS_7860_event_NXS", "omega", "%s" % omega, "Number Series")
12 AddSampleLog("CNCS_7860_event_NXS", "chi", "%s" % 0, "Number Series")
13 AddSampleLog("CNCS_7860_event_NXS", "phi", "%s" % 0, "Number Series")
14 ConvertToDiffractionMDWorkspace(InputWorkspace='CNCS_7860_event_NXS',OutputWorkspace='CNCS_7860_event_MD',OutputDimensions='Q (sample frame)',LorentzCorrection='1')
15 
16 SaveMD("CNCS_7860_event_MD", "C:/Users/spu92482/Desktop/CNCS/CNCS_7860_event_rotated_%03d.nxs" % omega)
17 print time.time() - start, " seconds since start."