Ticket #7001: s2A.py

File s2A.py, 2.6 KB (added by Wenduo Zhou, 7 years ago)
Line 
1# determine where to save
2import os
3savedir = os.path.abspath(os.path.curdir)
4
5LoadEventNexus(Filename="PG3_4866_event.nxs",
6               OutputWorkspace="PG3_4866",
7               Precount=True)
8FilterBadPulses(InputWorkspace="PG3_4866",
9                OutputWorkspace="PG3_4866")
10RemovePromptPulse(InputWorkspace="PG3_4866",
11                  OutputWorkspace="PG3_4866",
12                  Width=50)
13CompressEvents(InputWorkspace="PG3_4866",
14               OutputWorkspace="PG3_4866",
15               Tolerance=0.01)
16SortEvents(InputWorkspace="PG3_4866")
17CropWorkspace(InputWorkspace="PG3_4866",
18              OutputWorkspace="PG3_4866",
19              XMax=16666.669999999998)
20LoadCalFile(InputWorkspace="PG3_4866",
21            CalFilename="PG3_FERNS_d4832_2011_08_24.cal",
22            WorkspaceName="PG3")
23MaskDetectors(Workspace="PG3_4866",
24              MaskedWorkspace="PG3_mask")
25AlignDetectors(InputWorkspace="PG3_4866",
26               OutputWorkspace="PG3_4866",
27               OffsetsWorkspace="PG3_offsets")
28ConvertUnits(InputWorkspace="PG3_4866",
29             OutputWorkspace="PG3_4866",
30             Target="TOF")
31UnwrapSNS(InputWorkspace="PG3_4866",
32          OutputWorkspace="PG3_4866",
33          LRef=62)
34RemoveLowResTOF(InputWorkspace="PG3_4866",
35                OutputWorkspace="PG3_4866",
36                ReferenceDIFC=1500)
37ConvertUnits(InputWorkspace="PG3_4866",
38             OutputWorkspace="PG3_4866",
39             Target="dSpacing")
40Rebin(InputWorkspace="PG3_4866",
41      OutputWorkspace="PG3_4866",
42      Params=(0.1,-0.0004,2.2))
43SortEvents(InputWorkspace="PG3_4866")
44DiffractionFocussing(InputWorkspace="PG3_4866",
45                     OutputWorkspace="PG3_4866",
46                     GroupingWorkspace="PG3_group")
47EditInstrumentGeometry(Workspace="PG3_4866",
48                       PrimaryFlightPath=60,
49                       SpectrumIDs=[1],
50                       L2=[3.2208],
51                       Polar=[90.8074],
52                       Azimuthal=[0])
53ConvertUnits(InputWorkspace="PG3_4866",
54             OutputWorkspace="PG3_4866",
55             Target="TOF")
56Rebin(InputWorkspace="PG3_4866",
57      OutputWorkspace="PG3_4866",
58      Params=[-0.0004])
59ConvertUnits(InputWorkspace="PG3_4866",
60             OutputWorkspace="PG3_4866",
61             Target="dSpacing")
62
63
64FindPeaks(InputWorkspace = "PG3_4866",
65        FWHM = 8,
66        Tolerance = 4,
67        PeakPositions = "0.5044,0.5191,0.5350,0.5526,0.5936,0.6178,0.6453,0.6768,0.7134,0.7566,0.8089,0.8737,0.9571,1.0701,1.2356,1.5133,2.1401",
68        PeakFunctions = "Gaussian",
69        BackgroundFunction = "Quadratic",
70        HighBackground = True,
71        PeakPositionTolerance = 0.05,
72        PeakList = "FoundPeakTable",
73        RawPeakParameters = True)