1 | wsname = "NOM_26140" |
---|
2 | efname = "NOM_26140_event.nxs" |
---|
3 | peaks = '0.8920,1.0758,1.2615,2.0599' |
---|
4 | minpeakheight = 5 |
---|
5 | |
---|
6 | ############################################################################ |
---|
7 | # Generate a fit window table workspace |
---|
8 | ############################################################################ |
---|
9 | |
---|
10 | numspec = 101376 |
---|
11 | windowws = CreateEmptyTableWorkspace(OutputWorkspace="NOM_26140_Window") |
---|
12 | |
---|
13 | windowws.addColumn("int", "spectrum") |
---|
14 | windowws.addColumn("double", "peak0_left") |
---|
15 | windowws.addColumn("double", "peak0_right") |
---|
16 | windowws.addColumn("double", "peak1_left") |
---|
17 | windowws.addColumn("double", "peak1_right") |
---|
18 | windowws.addColumn("double", "peak2_left") |
---|
19 | windowws.addColumn("double", "peak2_right") |
---|
20 | windowws.addColumn("double", "peak3_left") |
---|
21 | windowws.addColumn("double", "peak3_right") |
---|
22 | |
---|
23 | # 0.892000, 1.075800, 1.261500, 2.06000 |
---|
24 | |
---|
25 | peak0left = 0.872 |
---|
26 | peak0right = 0.945 |
---|
27 | |
---|
28 | peak1left = 1.050 |
---|
29 | peak1right = 1.138 |
---|
30 | |
---|
31 | peak2left = 1.218 |
---|
32 | peak2right = 1.350 |
---|
33 | |
---|
34 | peak3left = 1.91 |
---|
35 | peak3right = 2.20 |
---|
36 | |
---|
37 | for iws in xrange(numspec): |
---|
38 | windowws.addRow([iws, peak0left, peak0right, peak1left, peak1right, peak2left, peak2right, |
---|
39 | peak3left, peak3right]) |
---|
40 | |
---|
41 | ############################################################################ |
---|
42 | # Create a workspace for resolution |
---|
43 | ############################################################################ |
---|
44 | Load(Filename = "NOM_26140_event.nxs", OutputWorkspace = "TempWS") |
---|
45 | EstimatePDDetectorResolution( |
---|
46 | InputWorkspace = "TempWS", |
---|
47 | OutputWorkspace = "NOM_Estimated_ResolutionWS", |
---|
48 | DeltaTOF = 40.) |
---|
49 | DeleteWorkspace(Workspace = "TempWS") |
---|
50 | |
---|
51 | ############################################################################ |
---|
52 | # Calibreate rectangular detectors |
---|
53 | ############################################################################ |
---|
54 | CalibrateRectangularDetectors( |
---|
55 | Instrument = "NOM", |
---|
56 | RunNumber = 26140, |
---|
57 | Extension = "_event.nxs", |
---|
58 | MaxOffset = 1., |
---|
59 | CrossCorrelation = False, |
---|
60 | PeakPositions = peaks, |
---|
61 | MinimumPeakHeight = minpeakheight, |
---|
62 | FitwindowTableWorkspace = "NOM_26140_Window", |
---|
63 | PeakFunction = "Gaussian", |
---|
64 | BackgroundType = "Linear", |
---|
65 | Binning = "0.5, -0.005, 5.", |
---|
66 | FilterBadPulses = True, |
---|
67 | SaveAs = "calibration", |
---|
68 | OutputDirectory = "/tmp/", |
---|
69 | DetectorResolutionWorkspace = "NOM_Estimated_ResolutionWS", |
---|
70 | AllowedResRange = "0.25, 4.0") |
---|