integration_test_MDE.py 2.92 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
# The following line helps with future compatibility with Python 3
# print must now be used as a function, e.g print('Hello','World')
from __future__ import (absolute_import, division, print_function, unicode_literals)

# import mantid algorithms, numpy and matplotlib
from mantid.simpleapi import *

import matplotlib.pyplot as plt

import numpy as np

data = LoadWANDSCD(IPTS=21362, RunNumbers='120754-122554', Grouping='4x4')
13
norm=LoadWANDSCD("HB2C137518", Grouping='4x4')
14
mde=ConvertWANDSCDtoMDE(data)
15
16
17
18
ConvertWANDSCDtoQ(InputWorkspace='data',
                  NormalisationWorkspace='norm',
                  OutputWorkspace='Q',
                  BinningDim1='-1,1,21')
19
20
21
22
23
24
25
26
ConvertWANDSCDtoQ(InputWorkspace='data',
                  NormalisationWorkspace='norm',
                  Frame='HKL',
                  OutputWorkspace='HKL',
                  BinningDim0='-5.01,5.01,501',
                  BinningDim1='-5.01,5.01,501',
                  BinningDim2='-0.21,0.81,51')

27
28
29
30
31
32
PredictPeaks(InputWorkspace='Q',
MinDSpacing=0.1,
CalculateGoniometerForCW=True,
Wavelength=1.488, MaxAngle=0,
CalculateStructureFactors=True,
OutputWorkspace='predict')
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54


FindPeaksMD(InputWorkspace='mde',
PeakDistanceThreshold=1,
DensityThresholdFactor=10000,
CalculateGoniometerForCW=True,
OutputWorkspace='peaks')


FindPeaksMD(InputWorkspace='mde', PeakDistanceThreshold=1, DensityThresholdFactor=10000, CalculateGoniometerForCW=True, OutputWorkspace='peaks')
IndexPeaks(PeaksWorkspace='peaks')
OptimizeLatticeForCellType(PeaksWorkspace='peaks', CellType='Hexagonal', Apply=True, OutputDirectory='/home/rwp/build/mantid/.')

PredictPeaks(InputWorkspace='peaks',
MinDSpacing=0.1,
CalculateGoniometerForCW=True,
Wavelength=1.488,
MaxAngle=0,
ReflectionCondition='Hexagonally centred, reverse',
CalculateStructureFactors=True,
OutputWorkspace='predict2')

55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
CopySample(InputWorkspace='peaks',
OutputWorkspace='data',
CopyMaterial=False, CopyEnvironment=False, CopyShape=False
)


ConvertWANDSCDtoQ(InputWorkspace='data',
                  NormalisationWorkspace='norm',
                  Frame='HKL',
                  OutputWorkspace='HKL2',
                  BinningDim0='-5.01,5.01,501',
                  BinningDim1='-5.01,5.01,501',
                  BinningDim2='-0.21,0.81,51')



#PredictFractionalPeaks(Peaks='peaks', FracPeaks='frac', HOffset='0.5,0,0', KOffset='0,0.5,0', LOffset='0,0,0.25')



FindPeaksMD(InputWorkspace='mde', PeakDistanceThreshold=1, DensityThresholdFactor=1, CalculateGoniometerForCW=True, OutputWorkspace='peaks2')
IndexPeaks(PeaksWorkspace='peaks2',RoundHKLs=False)


PredictPeaks(InputWorkspace='peaks',
MinDSpacing=0.1,
CalculateGoniometerForCW=True,
Wavelength=1.488,
MaxAngle=0,
ReflectionCondition='Hexagonally centred, reverse',
CalculateStructureFactors=True,
OutputWorkspace='predict2')


CloneWorkspace(InputWorkspace='peaks', OutputWorkspace='peaks2')

ol=mtd['peaks2'].sample().getOrientedLattice()
a=ol.a();
b=ol.b()
c=ol.c()
ol.seta(a*2)
ol.setb(b*2)
ol.setc(c*2)
98