Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
Workspace | InOut | MatrixWorkspace | Mandatory | An InOut workspace that will store the new log information |
Name | Input | string | Mandatory | A String name for either a new time series log to be created or an existing name to update |
Time | Input | string | An ISO formatted date/time string specifying the timestamp for the given log value, for example 2010-09-14T04:20:12 If left blank, this will default to the current Date and Time | |
Value | Input | string | Mandatory | A String value for the series log at the given time |
DeleteExisting | Input | boolean | False | If true and the named log exists then the whole log is removed first. |
Creates/updates a time-series log entry on a chosen workspace. The given time stamp and value are appended to the named log entry. If the named entry does no exist, then a new log is created. A time stamp must be given in ISO8601 format, e.g. 2010-09-14T04:20:12.
Example - AddNote
# Create a host workspace
ws = CreateSampleWorkspace()
AddNote(ws, Name="my_log", Time="2014-01-01T00:00:00", Value="Initial")
AddNote(ws, Name="my_log", Time="2014-01-01T00:30:30", Value="Second")
AddNote(ws, Name="my_log", Time="2014-01-01T00:50:00", Value="Final")
log = ws.getRun().getLogData("my_log")
print "my_log has %i entries" % log.size()
for i in range(log.size()):
print "\t%s\t%s" %(log.times[i], log.value[i])
AddNote(ws, Name="my_log", Time="2014-01-01T00:00:00", Value="New Initial", DeleteExisting=True)
AddNote(ws, Name="my_log", Time="2014-01-01T00:30:00", Value="New Final")
log = ws.getRun().getLogData("my_log")
print "my_log now has %i entries" %log.size()
for i in range(log.size()):
print "\t%s\t%s" % (log.times[i], log.value[i])
Output:
my_log has 3 entries
2014-01-01T00:00:00 Initial
2014-01-01T00:30:30 Second
2014-01-01T00:50:00 Final
my_log now has 2 entries
2014-01-01T00:00:00 New Initial
2014-01-01T00:30:00 New Final
Categories: Algorithms | DataHandling | Logs