NormaliseByCurrent v1

../_images/NormaliseByCurrent-v1_dlg.png

NormaliseByCurrent dialog.

Summary

Normalises a workspace by the proton charge.

Properties

Name Direction Type Default Description
InputWorkspace Input MatrixWorkspace Mandatory Name of the input workspace
OutputWorkspace Output MatrixWorkspace Mandatory Name of the output workspace

Description

Normalises a workspace according to the good proton charge figure taken from the Input Workspace log data, which is stored in the workspace’s sample objects). Every data point (and its error) is divided by that number. The good proton charge value is added to the normalized workspace as the value of NormalizationFactor log.

ISIS Calculation Details

The good proton charge gd_prtn_chrg is an summed value that applies across all periods. It is therefore suitable to run NormaliseByProtonCharge for single-period workspaces, but gives incorrect normalisation for multi-period workspaces. If the algorithm detects the presences of a multi-period workspace, it calculates the normalisation slightly differently. It uses the current_period log property to index into the proton_charge_by_period log data array property.

EventWorkspaces

If the input workspace is an EventWorkspace, then the output will be as well. Weighted events are used to scale by the current (see the Divide v1 algorithm, which is a child algorithm being used).

Usage

Example - Normalise by Current simple workspace

# Create two workspaces
ws = CreateWorkspace(DataX=range(0,3), DataY=(17,12))

# Add Good Proton Charge Log
AddSampleLog(Workspace=ws, LogName='gd_prtn_chrg', LogText='10.0', LogType='Number')

# Fetch the generated logs
run1 = ws.getRun()
log_p = run1.getLogData('gd_prtn_chrg')

# Print the log value
print "Good Proton Charge =",log_p.value

#Run the Algorithm
wsN = NormaliseByCurrent(ws)
norm_factor = wsN.getRun().getLogData('NormalizationFactor').value

#Print results
print "Before normalisation", ws.readY(0);
print "After normalisation ", wsN.readY(0);
print "Normalisation factor", norm_factor;

Output:

Good Proton Charge = 10.0
Before normalisation [ 17.  12.]
After normalisation  [ 1.7  1.2]
Normalisation factor 10.0

Categories: Algorithms | CorrectionFunctions\NormalisationCorrections