AddLogSmoothed v1

Summary

Add a sample log that is the smoothed version of an existing log

See Also

AddSampleLog, AddLogDerivative

Properties

Name

Direction

Type

Default

Description

InputWorkspace

InOut

MatrixWorkspace

Mandatory

An input/output workspace. The new log will be added to it.

LogName

Input

string

Mandatory

The name that will identify the log entry to be smoothed. This log must be a numerical series (double).

SmoothingMethod

Input

string

BoxCar

The smoothing method to use. Allowed values: [‘BoxCar’, ‘Zeroing’, ‘Butterworth’]

Params

Input

int list

The parameters which will be passed to the smoothing function.

NewLogName

Input

string

Name of the newly created log. If not specified, the string ‘_smoothed’ will be appended to the original name

Description

This algorithm performs a smoothing operation over the values in the sample log.

The options available are boxcar (moving average) smoothing, FFT smoothing by zeroing, or FFT smoothing with a Butterworth filter.

Usage

Example: Smoothing a log with moving average smoothing

ws = CreateSampleWorkspace()
AddTimeSeriesLog(ws,"MyLog","2010-01-01T00:00:00",1.0,DeleteExisting=False)
AddTimeSeriesLog(ws,"MyLog","2010-01-01T00:00:10",2.0,DeleteExisting=False)
AddTimeSeriesLog(ws,"MyLog","2010-01-01T00:00:20",6.0,DeleteExisting=False)
AddTimeSeriesLog(ws,"MyLog","2010-01-01T00:00:30",4.0,DeleteExisting=False)

AddLogSmoothed(ws, "MyLog", "BoxCar", Params = "3")

for logName in ["MyLog","MyLog_smoothed"]:
    print("Log: {}".format(logName))
    print(ws.getRun().getProperty(logName).valueAsString())

Output:

Log: MyLog
2010-Jan-01 00:00:00  1
2010-Jan-01 00:00:10  2
2010-Jan-01 00:00:20  6
2010-Jan-01 00:00:30  4

Log: MyLog_smoothed
2010-Jan-01 00:00:00  1.5
2010-Jan-01 00:00:10  3
2010-Jan-01 00:00:20  4
2010-Jan-01 00:00:30  5

Categories: AlgorithmIndex | DataHandling\Logs

Source

C++ header: AddLogSmoothed.h

C++ source: AddLogSmoothed.cpp