\(\renewcommand\AA{\unicode{x212B}}\)
Table of Contents
Convert constant wavelength single crystal diffractomer’s datain MDEventWorkspace and in unit of Q-sample to the HKL space by UB matrix.
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspace | Input | MDEventWorkspace | Mandatory | Name of the input MDEventWorkspace that stores detectors counts from a constant-wave powder diffraction experiment. |
PeaksWorkspace | Input | PeaksWorkspace | Input Peaks Workspace | |
UBMatrix | Input | dbl list | A comma seperated list of doubles for UB matrix from (0,0), (0,1)… (2,1),(2,2) | |
OutputWorkspace | Output | MDEventWorkspace | Mandatory | Name of the output MDEventWorkspace in HKL-space. |
QSampleFileName | Input | string | Name of file for sample sample. | |
HKLFileName | Input | string | Name of file for HKL. |
This algorithms is to convert an MDEventWorkspace in Q-sample coordinate to HKL coordindate for a reactor-based four-circle single crystal diffractometer. Meanwhile, the algorithm is able to export the MDEvents to file.
Example - Convert detector counts of an HB3A’s measurement to HKL.
# Create input table workspaces for experiment information and virtual instrument parameters
CollectHB3AExperimentInfo(ExperimentNumber='406', ScanList='298', PtLists='-1,22',
DataDirectory='',
GenerateVirtualInstrument=False,
OutputWorkspace='ExpInfoTable', DetectorTableWorkspace='VirtualInstrumentTable')
# Convert to MDWorkspace
ConvertCWSDExpToMomentum(InputWorkspace='ExpInfoTable', CreateVirtualInstrument=False,
OutputWorkspace='QSampleMD',
Directory='')
ConvertCWSDMDtoHKL(InputWorkspace='QSampleMD',
UBMatrix='0.13329061, 0.07152342, -0.04215966, 0.01084569, -0.1620849, 0.0007607, -0.14018499, -0.07841385, -0.04002737',
OutputWorkspace='HKLMD')
# Examine
mdws = mtd['QSampleMD']
hklws = mtd['HKLMD']
print('Output QSample and HKL workspaces have %d and %d events.'%(mdws.getNEvents(), hklws.getNEvents()))
BinMD(InputWorkspace='HKLMD', AlignedDim0='H,-0.3,0.3,60', AlignedDim1='K,-0.4,0.5,90', AlignedDim2='L,4,8,10', OutputWorkspace='BinndHKL')
histws = mtd['BinndHKL']
events_array = histws.getNumEventsArray()
print('events[22, 53, 5] = {:.1f}'.format(events_array[22, 53, 5]))
print('events[30, 40, 5] = {:.1f}'.format(events_array[30, 40, 5]))
Output:
Output QSample and HKL workspaces have 1631 and 1631 events.
events[22, 53, 5] = 19.0
events[30, 40, 5] = 38.0
Categories: AlgorithmIndex | Diffraction\ConstantWavelength