\(\renewcommand\AA{\unicode{x212B}}\)

GetQsInQENSData v1

../_images/ImageNotFound.png

Enable screenshots using DOCS_SCREENSHOTS in CMake

Summary

Get Q-values in the vertical axis of a MatrixWorkspace containing QENS S(Q,E) of S(theta,E) data.

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

MatrixWorkspace

Mandatory

Input QENS data as MatrixWorkspace

RaiseMode

Input

boolean

False

Set to True if an Exception, instead of any empty list of Q values, is desired.

Qvalues

Output

dbl list

Description

Extract the values for momentum transfer stored in the vertical axis of a MatrixWorkspace representing the dynamic factor \(S(Q,E)\), or compute the values of a MatrixWorkspace representing the dynamic factor \(S(\theta,E)\).

Usage

** Extract Q values from \(S(Q,E)\) workspace **

workspace = LoadDaveGrp("BASIS_59689_divided.dat")
qvalues = GetQsInQENSData(workspace)
# print the first three values
vals = ' '.join(['{0:6.3f}'.format(Q) for Q in qvalues[0:3]])
print("'{}'".format(vals))
' 0.300  0.500  0.700'
workspace = LoadNexus("osiris97944_graphite002_red")
qvalues = GetQsInQENSData(workspace)
# print the first three values
vals = ' '.join(['{0:6.3f}'.format(Q) for Q in qvalues[0:3]])
print("'{}'".format(vals))
' 0.189  0.244  0.298'

Categories: AlgorithmIndex | Inelastic\Indirect

Source

C++ header: GetQsInQENSData.h

C++ source: GetQsInQENSData.cpp