Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
Workspace | InOut | MatrixWorkspace | Mandatory | Workspace to have logs merged |
LogName1 | Input | string | The name of the first log to be merged. | |
LogName2 | Input | string | The name of the second log to be merged. | |
MergedLogName | Input | string | The name of the new log as the result of log 1 being merged with log 2. | |
ResetLogValue | Input | boolean | False | Reset both logs’ values to unity for each one. |
LogValue1 | Input | number | 0 | Unity value of log 1. |
LogValue2 | Input | number | 1 | Unity value of log 2. |
Two TimeSeriesProperty logs are merged together by the time stamps.
Example - Merge 2 sample logs with value reset:
Load(Filename=r'HYS_11092_event.nxs',OutputWorkspace='HYS_11092_event')
MergeLogs(Workspace='HYS_11092_event',LogName1='Phase1',LogName2='Phase2',MergedLogName='PhaseM12',ResetLogValue='1',LogValue1='1',LogValue2='2')
ws = mtd["HYS_11092_event"]
newprop = ws.run().getProperty("PhaseM12")
prop1 = ws.run().getProperty("Phase1")
prop2 = ws.run().getProperty("Phase2")
print "Phase 1's size = %d, Phase 2's size = %d, Merged size = %d." % (prop1.size(), prop2.size(), newprop.size())
for i in xrange(5):
print "Phase1 Time[%d] = %s." % (i, prop1.nthTime(i))
for i in xrange(5):
print "Phase2 Time[%d] = %s." % (i, prop2.nthTime(i))
for i in xrange(5):
print "Mixed Phase 1 and 2 Time[%d] = %s." % (i, newprop.nthTime(i))
Output:
Phase 1's size = 21, Phase 2's size = 20, Merged size = 41.
Phase1 Time[0] = 2012-08-14T18:55:52.390000000 .
Phase1 Time[1] = 2012-08-14T18:55:52.406000000 .
Phase1 Time[2] = 2012-08-14T18:55:55.640000000 .
Phase1 Time[3] = 2012-08-14T18:55:57.171000137 .
Phase1 Time[4] = 2012-08-14T18:56:01.546000137 .
Phase2 Time[0] = 2012-08-14T18:55:52.390000000 .
Phase2 Time[1] = 2012-08-14T18:55:52.406000000 .
Phase2 Time[2] = 2012-08-14T18:55:57.171000137 .
Phase2 Time[3] = 2012-08-14T18:56:01.546000137 .
Phase2 Time[4] = 2012-08-14T18:56:04.390000000 .
Mixed Phase 1 and 2 Time[0] = 2012-08-14T18:55:52.390000000 .
Mixed Phase 1 and 2 Time[1] = 2012-08-14T18:55:52.390000000 .
Mixed Phase 1 and 2 Time[2] = 2012-08-14T18:55:52.406000000 .
Mixed Phase 1 and 2 Time[3] = 2012-08-14T18:55:52.406000000 .
Mixed Phase 1 and 2 Time[4] = 2012-08-14T18:55:55.640000000 .
Categories: Algorithms | DataHandling | Logs