\(\renewcommand\AA{\unicode{x212B}}\)
ShiftLogTime v1¶
Summary¶
Shifts the indexes of the specified log. This will make the log shorter by the specified shift.
See Also¶
Properties¶
Name |
Direction |
Type |
Default |
Description |
---|---|---|---|---|
InputWorkspace |
Input |
Mandatory |
A workspace with units of TOF |
|
OutputWorkspace |
Output |
Mandatory |
The name to use for the output workspace |
|
LogName |
Input |
string |
Name of the log to add the offset to |
|
IndexShift |
Input |
number |
0 |
Number of (integer) values to move the log values. Required. |
Description¶
The algorithm is similar to ChangeLogTime, but instead of a defined time shift of the logs, one gets a shift in the indexes of the specified logs. This will make the log shorter by the specified shift.
See also
Usage¶
Note
To run these usage examples please first download the usage data, and add these to your path. In Mantid this is done using Manage User Directories.
import numpy as np
#Load a workspace
w = Load('CNCS_7860')
#get the log times for a particular variable
original = w.getRun()['Speed5'].times
#Change the log times
w = ShiftLogTime(w, LogName='Speed5', IndexShift='2')
#get the log times for a particular variable, after change
modified = w.getRun()['Speed5'].times
#print times
print("OriginalTimes: {}".format(np.datetime_as_string(original, timezone='UTC')))
print("ModifiedTimes: {}".format(np.datetime_as_string(modified, timezone='UTC')))
Output:
OriginalTimes: ['2010-03-25T16:09:27.780000000Z' '2010-03-25T16:10:01.560998229Z'
'2010-03-25T16:10:31.514001159Z' '2010-03-25T16:11:25.498002319Z']
ModifiedTimes: ['2010-03-25T16:10:31.514001159Z' '2010-03-25T16:11:25.498002319Z']
Categories: AlgorithmIndex | DataHandling\Logs
Source¶
C++ header: ShiftLogTime.h
C++ source: ShiftLogTime.cpp