Ticket #3557 (closed: fixed)
MergeMDEW: Algorithm to merge many MDEventWorkspaces
Reported by: | Janik Zikovsky | Owned by: | Janik Zikovsky |
---|---|---|---|
Priority: | major | Milestone: | Iteration 30 |
Component: | Mantid | Keywords: | |
Cc: | Blocked By: | #3571, #3605, #3661 | |
Blocking: | Tester: | Owen Arnold |
Description
Need a method for merging a large number of MDEventWorkspaces together WITHOUT EXPLODING MEMORY! This mostly for inelastic people wanting to add together N runs at N small rotations.
I think the way to go is:
- Generate a MDEventWorkspaces NXS file for each run with a fixed box structure.
- This would be a MaxDepth=1 structure but with finer boxes, maybe 50x50x50.
- This can be done immediately after acquiring each run so that less processing has to be done at once
- Supply a list of all the filenames to merge
- What's the GUI possibilities for this? Would be nice to select a bunch of files.
- Go through each BOX to sum up a small part of the events from EACH file, and dump these into a large (file-backed) MDEventWorkspace that CAN split however is best.
Attachments
Change History
comment:11 Changed 9 years ago by Janik Zikovsky
In [14207]:
comment:12 Changed 9 years ago by Janik Zikovsky
In [14219]:
comment:13 Changed 9 years ago by Janik Zikovsky
In [14220]:
comment:14 Changed 9 years ago by Janik Zikovsky
In [14226]:
comment:15 Changed 9 years ago by Janik Zikovsky
In [14227]:
comment:16 Changed 9 years ago by Stuart Campbell
In [14273]:
comment:17 Changed 9 years ago by Janik Zikovsky
In [14276]:
comment:18 Changed 9 years ago by Janik Zikovsky
In [14277]:
comment:19 Changed 9 years ago by Stuart Campbell
comment:21 Changed 9 years ago by Janik Zikovsky
In [14384]:
comment:22 Changed 9 years ago by Janik Zikovsky
In [14386]:
comment:23 Changed 9 years ago by Janik Zikovsky
In [14401]:
comment:24 Changed 9 years ago by Janik Zikovsky
In [14402]:
comment:25 Changed 9 years ago by Janik Zikovsky
In [14403]:
comment:26 Changed 9 years ago by Janik Zikovsky
- Status changed from accepted to verify
- Resolution set to fixed
comment:27 Changed 9 years ago by Owen Arnold
- Status changed from verify to verifying
- Tester set to Owen Arnold
comment:28 Changed 9 years ago by Owen Arnold
- Status changed from verifying to closed
Fully working as far as I can tell. Generated 20 rotated workspaces (in one axis). All have common box structure. After merging, number of events in merged workspace is exactly the same as the sum across all input workspaces. Visualisation of output workspace shows Bragg peaks tracing arc in one dimension, consistent with rotation.
comment:29 Changed 9 years ago by Owen Arnold
Test generator ... import time LoadEventNexus(Filename='C:/mantid/Test/AutoTestData/CNCS_7860_event.nxs', OutputWorkspace='CNCS_7860_event_NXS',CompressTolerance='0.10000000000000001')
start = time.time(); for omega in xrange(0, 20):
print "Starting omega %03d degrees" % omega CreateMDWorkspace(Dimensions='3',Extents='-5,5,-5,5,-5,5',Names='Q_sample_x,Q_sample_y,Qsample_z',Units='A,A,A'
,SplitInto='5',SplitThreshold='2000',MaxRecursionDepth='3',
MinRecursionDepth='3', OutputWorkspace='CNCS_7860_event_MD')
# Convert events to MD events AddSampleLog("CNCS_7860_event_NXS", "omega", "%s" % omega, "Number Series") AddSampleLog("CNCS_7860_event_NXS", "chi", "%s" % 0, "Number Series") AddSampleLog("CNCS_7860_event_NXS", "phi", "%s" % 0, "Number Series") ConvertToDiffractionMDWorkspace(InputWorkspace='CNCS_7860_event_NXS'
,OutputWorkspace='CNCS_7860_event_MD',OutputDimensions='Q(sampleframe)' ,LorentzCorrection='1')
SaveMD("CNCS_7860_event_MD", "C:/Users/spu92482/Desktop/CNCS/CNCS_7860_event_rotated_%03d.nxs" % omega) print time.time() - start, " seconds since start."
comment:30 Changed 9 years ago by Owen Arnold
Better way of distributing script than previous.
comment:31 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 4404