$$\renewcommand\AA{\unicode{x212B}}$$

# MDNormSCD v1¶

## Summary¶

Calculate normalization for an MDEvent workspace for single crystal diffraction.

## Properties¶

Name

Direction

Type

Default

Description

InputWorkspace

Input

MDEventWorkspace

Mandatory

An input MDWorkspace.

AlignedDim0

Input

string

Binning parameters for the 0th dimension. Enter it as a comma-separated list of values with the format: ‘name,minimum,maximum,number_of_bins’. Leave blank for NONE.

AlignedDim1

Input

string

Binning parameters for the 1th dimension. Enter it as a comma-separated list of values with the format: ‘name,minimum,maximum,number_of_bins’. Leave blank for NONE.

AlignedDim2

Input

string

Binning parameters for the 2th dimension. Enter it as a comma-separated list of values with the format: ‘name,minimum,maximum,number_of_bins’. Leave blank for NONE.

AlignedDim3

Input

string

Binning parameters for the 3th dimension. Enter it as a comma-separated list of values with the format: ‘name,minimum,maximum,number_of_bins’. Leave blank for NONE.

AlignedDim4

Input

string

Binning parameters for the 4th dimension. Enter it as a comma-separated list of values with the format: ‘name,minimum,maximum,number_of_bins’. Leave blank for NONE.

AlignedDim5

Input

string

Binning parameters for the 5th dimension. Enter it as a comma-separated list of values with the format: ‘name,minimum,maximum,number_of_bins’. Leave blank for NONE.

FluxWorkspace

Input

MatrixWorkspace

Mandatory

An input workspace containing momentum dependent flux.

SolidAngleWorkspace

Input

MatrixWorkspace

Mandatory

An input workspace containing momentum integrated vanadium (a measure of the solid angle).

SkipSafetyCheck

Input

boolean

False

If set to true, the algorithm does not check history if the workspace was modified since theConvertToMD algorithm was run, and assume that the elastic mode is used.

TemporaryNormalizationWorkspace

Input

IMDHistoWorkspace

An input MDHistoWorkspace used to accumulate normalization from multiple MDEventWorkspaces. If unspecified a blank MDHistoWorkspace will be created.

TemporaryDataWorkspace

Input

IMDHistoWorkspace

An input MDHistoWorkspace used to accumulate data from multiple MDEventWorkspaces. If unspecified a blank MDHistoWorkspace will be created.

OutputWorkspace

Output

Workspace

Mandatory

A name for the output data MDHistoWorkspace.

OutputNormalizationWorkspace

Output

Workspace

Mandatory

A name for the output normalization MDHistoWorkspace.

## Description¶

The algorithm calculates a normalization MD workspace for single crystal diffraction experiments. Trajectories of each detector in reciprocal space are calculated, and the flux is integrated between intersections with each MDBox. A brief introduction to the multi-dimensional data normalization can be found here.

The algorithm MDNormSCDPreprocessIncoherent can be used to process Vanadium data for the Solid Angle and Flux workspaces.

Note

As of Release 4.0.0, the algorithm can handle merged MD workspaces. Make sure all original MDEvent workspaces have the same dimensions

## Usage¶

Example - MDNormSCD

try:
# Setting up the workspaces containing information about the flux and the solid angle (from a vanadium run)
rawVan=ConvertUnits(InputWorkspace=rawVan,Target='Momentum')
rawVan=CropWorkspace(InputWorkspace=rawVan,XMin='1.85',XMax='10')

#Solid angle
sa=Rebin(InputWorkspace=rawVan,Params='1.85,10,10',PreserveEvents='0')
SaveNexus(InputWorkspace=sa, Filename="/home/3y9/Desktop/TOPAZ/solidAngle.nxs")

#flux
flux=GroupDetectors(InputWorkspace=rawVan,MapFile=r'/home/3y9/Desktop/TOPAZ/grouping.xml')
DeleteWorkspace(rawVan)
flux=CompressEvents(InputWorkspace=flux,Tolerance=1e-4)
flux=Rebin(InputWorkspace=flux,Params='1.85,10,10')
for i in range(flux.getNumberHistograms()):
el=flux.getSpectrum(i)
flux=Rebin(InputWorkspace=flux,Params='1.85,10,10')
flux=IntegrateFlux(flux)
SaveNexus(InputWorkspace=flux, Filename="/home/3y9/Desktop/TOPAZ/spectra.nxs")

#data
#If you have multiple workspaces, add separately the output workspaces, and separately the
#output normalization workspaces, then divide the two sums
runs = range(7985,7995,1)
mdout = None
mdnorm = None
for run in runs:
try:
except:
data=ConvertUnits(InputWorkspace=data,Target='Momentum')
data=CropWorkspace(InputWorkspace=data,XMin='1.85',XMax='10')
data=Rebin(InputWorkspace=data,Params='1.85,10,10')
MDdata=ConvertToMD(InputWorkspace=data,QDimensions="Q3D",dEAnalysisMode="Elastic",
Q3DFrames="HKL",QConversionScales="HKL",
MinValues="-10,-10,-10",Maxvalues="10,10,10")
SaveMD(InputWorkspace=MDdata, Filename="/home/3y9/Desktop/TOPAZ/MDdata_"+str(run)+".nxs")

#running the algorithm
mdout, mdnorm = MDNormSCD(InputWorkspace='MDdata',
AlignedDim0='[H,0,0],-8,8,100',
AlignedDim1='[0,K,0],-8,8,100',
AlignedDim2='[0,0,L],-8,8,100',
FluxWorkspace=flux,
SolidAngleWorkspace=sa,
TemporaryDataWorkspace=mdout,
TemporaryNormalizationWorkspace=mdnorm)

normalized=DivideMD('mdout','mdnorm')
except:
pass




## References¶

The source for how this calculation is done is

1. T.M. Michels-Clark, A.T. Savici, V.E. Lynch, X.P. Wang and C.M. Hoffmann Expanding Lorentz and spectrum corrections to large volumes of reciprocal space for single-crystal time-of-flight neutron diffraction. J Appl Crystallogr 49.2 (2016) doi: 10.1107/S1600576716001369

Categories: AlgorithmIndex | MDAlgorithms\Normalisation