SofQW v1#

Summary#

Computes S(Q,w) via the SofQWNormalisedPolygon algorithm. The output is a parallel-piped rebin, outputting a weighted-sum of overlapping polygons normalised by the fractional area of each overlap

See Also#

SofQWNormalisedPolygon, Rebin2D

Properties#

Name

Direction

Type

Default

Description

InputWorkspace

Input

MatrixWorkspace

Mandatory

Reduced data in units of energy transfer DeltaE. The workspace must contain histogram data and have common bins across all spectra.

OutputWorkspace

Output

MatrixWorkspace

Mandatory

The name to use for the q-omega workspace.

QAxisBinning

Input

dbl list

Mandatory

The bin parameters to use for the q axis (in the format used by the Rebin v1 algorithm).

EMode

Input

string

Mandatory

The energy transfer analysis mode (Direct/Indirect). Allowed values: [‘Direct’, ‘Indirect’]

EFixed

Input

number

0

The value of fixed energy: \(E_i\) (EMode=Direct) or \(E_f\) (EMode=Indirect) (meV). Must be set here if not available in the instrument definition.

ReplaceNaNs

Input

boolean

False

If true, all NaN values in the output workspace are replaced using the ReplaceSpecialValues algorithm.

EAxisBinning

Input

dbl list

The bin parameters to use for the E axis (optional, in the format used by the Rebin v1 algorithm).

DetectorTwoThetaRanges

Input

TableWorkspace

A table workspace use by SofQWNormalisedPolygon containing a ‘Detector ID’ column as well as ‘Min two theta’ and ‘Max two theta’ columns listing the detector’s min and max scattering angles in radians.

Description#

This algorithm is for use by inelastic instruments and takes as its input a workspace where the data’s been reduced to be in Units of energy transfer against spectrum number (which can be seen as equivalent to angle, with the angle being taken from the detector(s) to which the spectrum pertains).

Since the removal of deprecated algorithms SofQWCentre and SofQWPolygon (release 7.0.0), this algorithm now simply wraps SofQWNormalisedPolygon v1.

The energy binning will not be changed by this algorithm, so the input workspace should already have the desired bins (though this axis can be rebinned afterwards if desired). The EMode and EFixed parameters are used for the calculation of \(Q\).

If the input workspace is a distribution (i.e. counts/meV ) then the output workspace will similarly be divided by the bin width in both directions (i.e. will contain counts/meV/(1/Angstrom) ).

Workflow#

../_images/SofQW-v1_wkflw.svg

Usage#

Example - simple transformation of inelastic workspace:

# create sample inelastic workspace for MARI instrument containing 1 at all spectra values
ws=CreateSimulationWorkspace(Instrument='MAR',BinParams='-10,1,10')
# convert workspace into MD workspace
ws=SofQW(InputWorkspace=ws,QAxisBinning='-3,0.1,3',Emode='Direct',EFixed=12)

print("The converted X values are:")
print(ws.x(59)[0:10])
print(ws.x(59)[10:21])

print("The converted Y values are:")
print(ws.y(59)[0:10])
print(ws.y(59)[10:21])

Output:

The converted X values are:
[-10.  -9.  -8.  -7.  -6.  -5.  -4.  -3.  -2.  -1.]
[ 0.  1.  2.  3.  4.  5.  6.  7.  8.  9. 10.]
The converted Y values are:
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
[1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]

Categories: AlgorithmIndex | Inelastic\SofQW

Source#

C++ header: SofQW.h

C++ source: SofQW.cpp