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

CalculateCoverageDGS v1

../_images/ImageNotFound.png

Enable screenshots using DOCS_SCREENSHOTS in CMake

Summary

Calculate the reciprocal space coverage for direct geometry spectrometers

See Also

SetGoniometer, SetUB

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

MatrixWorkspace

Mandatory

An input workspace.

Q1Basis

Input

dbl list

1,0,0

Q1 projection direction in the x,y,z format. Q1, Q2, Q3 must not be coplanar

Q2Basis

Input

dbl list

0,1,0

Q2 projection direction in the x,y,z format. Q1, Q2, Q3 must not be coplanar

Q3Basis

Input

dbl list

0,0,1

Q3 projection direction in the x,y,z format. Q1, Q2, Q3 must not be coplanar

IncidentEnergy

Input

number

Optional

Incident energy. If set, will override Ei in the input workspace

Dimension1

Input

string

Q1

Dimension to bin or integrate. Allowed values: [‘Q1’, ‘Q2’, ‘Q3’, ‘DeltaE’]

Dimension1Min

Input

number

Optional

Dimension1 minimum value. If empty will take minimum possible value.

Dimension1Max

Input

number

Optional

Dimension1 maximum value. If empty will take maximum possible value.

Dimension1Step

Input

number

Optional

Dimension1 step size. If empty the dimension will be integrated between minimum and maximum values

Dimension2

Input

string

Q2

Dimension to bin or integrate. Allowed values: [‘Q1’, ‘Q2’, ‘Q3’, ‘DeltaE’]

Dimension2Min

Input

number

Optional

Dimension2 minimum value. If empty will take minimum possible value.

Dimension2Max

Input

number

Optional

Dimension2 maximum value. If empty will take maximum possible value.

Dimension2Step

Input

number

Optional

Dimension2 step size. If empty the dimension will be integrated between minimum and maximum values

Dimension3

Input

string

Q3

Dimension to bin or integrate. Allowed values: [‘Q1’, ‘Q2’, ‘Q3’, ‘DeltaE’]

Dimension3Min

Input

number

Optional

Dimension3 minimum value. If empty will take minimum possible value.

Dimension3Max

Input

number

Optional

Dimension3 maximum value. If empty will take maximum possible value.

Dimension3Step

Input

number

Optional

Dimension3 step size. If empty the dimension will be integrated between minimum and maximum values

Dimension4

Input

string

DeltaE

Dimension to bin or integrate. Allowed values: [‘Q1’, ‘Q2’, ‘Q3’, ‘DeltaE’]

Dimension4Min

Input

number

Optional

Dimension4 minimum value. If empty will take minimum possible value.

Dimension4Max

Input

number

Optional

Dimension4 maximum value. If empty will take maximum possible value.

Dimension4Step

Input

number

Optional

Dimension4 step size. If empty the dimension will be integrated between minimum and maximum values

OutputWorkspace

Output

Workspace

Mandatory

A name for the output data MDHistoWorkspace.

Description

The algorithm calculates what part of the reciprocal space is covered by direct geometry spectrometers. It is supposed to be used in planning tools. The input workspace should contain the incident energy log, a goniometer, and the UB matrix. The incident energy can be overwritten by setting the IncidentEnergy parameter. The output is an MDHisto workspace. You can visualize it with Sliceviewer.

The parameters Q1Basis, Q2Basis, Q3Basis can be used to look at different directions in the reciprocal space, such as [H,H,0]

DimensionI, where I is from 1 to 4, allows one to select in which order Q1, Q2, Q3, DeltaE are stored in the output workspace. The algorithm will complain if you select the same dimension twice. For each dimension one can define minimum, maximum, and step size. If no minimum/maximum are set for DeltaE, these are chosen to be +/-Ei. If not specified, minimum/maximum for the Q dimensions are calculated based on the instrument geometry, incident energy, minimum/maximum for DeltaE, and lattice parameters.

The algorithm calculates detector trajectories in the reciprocal space and sets to 1 the corresponding points in the output workspace. All other points are 0.

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.

Example - CalculateCoverageDGS

w=Load(Filename="CNCS_7860")
w=ConvertUnits(InputWorkspace=w,Target='DeltaE', EMode='Direct', EFixed='3')
SetGoniometer(Workspace=w, Axis0='30,0,1,0,1')
SetUB(Workspace=w, a='2', b='2', c='2')
w=Rebin(InputWorkspace=w, Params='-3,0.1,3', PreserveEvents='0')
coverage=CalculateCoverageDGS(InputWorkspace=w, IncidentEnergy=3,
    Dimension1Min=-1, Dimension1Max=1, Dimension1Step=0.02,
    Dimension2Min=-1, Dimension2Max=1, Dimension2Step=2,
    Dimension3Min=-1, Dimension3Max=1, Dimension3Step=2,
    Dimension4Min=0, Dimension4Max=3, Dimension4Step=0.1)

# Print the result
print("You cover {:.0f} MD bins out of {}".format(coverage.getSignalArray().sum(),coverage.getSignalArray().size))

Output:

You cover 506 MD bins out of 3000

Categories: AlgorithmIndex | Inelastic\Planning | MDAlgorithms\Planning

Source

C++ header: CalculateCoverageDGS.h

C++ source: CalculateCoverageDGS.cpp