Ticket #7880: verify7880.py

File verify7880.py, 2.2 KB (added by Wenduo Zhou, 7 years ago)
Line 
1# This script is to be executed inside MantidPlot
2
3def setupProfileWS():
4    """ Main
5    """
6    import math
7   
8    parammap = []
9    parammap.append(["BANK", 1, "tie"])
10    parammap.append(["Dtt1", 16370.650, "tie"])
11    parammap.append(["Dtt2", 0.10, "tie"])
12    parammap.append(["Zero", 0.0, "tie"])
13
14    # Use peak shape parameters from Argonne Silicon example
15    parammap.append(["Alph0", 1.0, "tie"])
16    parammap.append(["Alph1", 0.0, "tie"])
17    parammap.append(["Beta0", 0.109036, "tie"])
18    parammap.append(["Beta1", 0.009834, "tie"])
19
20    parammap.append(["Sig2",  math.sqrt(91.127), "tie"])
21    parammap.append(["Sig1",  math.sqrt(1119.230), "tie"])
22    parammap.append(["Sig0",  math.sqrt(0.0), "tie"])
23
24    parammap.append(["Gam0", 0.0, "tie"])
25    parammap.append(["Gam1", 0.0, "tie"])
26    parammap.append(["Gam2", 0.0, "tie"])
27
28    parammap.append(["LatticeConstant", 5.431363, "tie"])
29
30    CreateEmptyTableWorkspace(OutputWorkspace="Vulcan_Bank1")
31    pws = mtd["Vulcan_Bank1"]
32   
33    pws.addColumn("str", "Name")
34    pws.addColumn("double", "Value")
35    pws.addColumn("str", "FitOrTie")
36   
37    for item in parammap:
38        pws.addRow(item)
39
40    return
41
42
43def main():
44    """ Main
45    """
46    LoadAscii(Filename="VULCAN_22946_NOM.dat", OutputWorkspace="VULCAN_22946", Unit="TOF")
47         
48    # Generate list of reflections
49    CreateLeBailFitInput(FullprofParameterFile=r'dummy.irf', 
50            Bank='1', LatticeConstant='4.0010000000000003', InstrumentParameterWorkspace='I',
51            GenerateBraggReflections='1',BraggPeakParameterWorkspace='BraggPeaks')
52    DeleteWorkspace(Workspace="I")
53   
54    setupProfileWS()
55
56    LoadNexusProcessed(Filename="v22946_bkgd_polynomial.nxs", OutputWorkspace="VUL_22946_BackgroundParameters")
57
58    # For debug purpose
59    ExaminePowderDiffProfile(InputWorkspace="VULCAN_22946", LoadData=False,
60            StartX = 7000., EndX = 29100., 
61            ProfileWorkspace = "Vulcan_Bank1", BraggPeakWorkspace = "BraggPeaks", GenerateInformationWS = False,
62            BackgroundType = "Polynomial", BackgroundParameterWorkspace = "VUL_22946_BackgroundParameters", ProcessBackground = False, 
63            BackgroundWorkspace = "V22946_Background", OutputWorkspace = "VUL_22946_Cal")
64
65    # Load data
66
67
68if __name__ == "__main__":
69    main()