configurations.py 11.5 KB
Newer Older
1
2
3
4
5
6
7
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2020 ISIS Rutherford Appleton Laboratory UKRI,
#     NScD Oak Ridge National Laboratory, European Spallation Source
#     & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +

8

9
10
class RundexSettings(object):

11
12
    # instruments
    D11 =    "D11"
13
    D11B =   "D11B"
14
15
    D16 =    "D16"
    D22 =    "D22"
16
    D22B =   "D22B"
17
18
19
    D33 =    "D33"
    D17 =    "D17"
    FIGARO = "FIGARO"
20
    D2B =    "D2B"
21
    D20 =    "D20"
22
    D1B =    "D1B"
23

24
25
26
27
    # techniques (see instrument/Facilities.xml)
    SANS =   "SANS"
    REFL =   "Reflectometry"
    POWDER = "Powder diffraction"
28

29
    # acquisition modes
30
    SANS_ACQ =     "SANS"
31
    SANS_PSCAN =   "Sample scan"
32
33
34
    REFL_POL =     "Polarized"
    REFL_NPOL =    "Unpolarized"
    POWDER_DSCAN = "Detector scan"
35
    POWDER_PSCAN = "Sample scan"
36
37
38
39

    # correspondance between instrument and technique
    TECHNIQUE = {
            D11:    SANS,
40
            D11B:    SANS,
41
42
            D16:    SANS,
            D22:    SANS,
43
            D22B:    SANS,
44
45
            D33:    SANS,
            D17:    REFL,
46
47
            FIGARO: REFL,
            D2B:    POWDER,
48
            D20:    POWDER,
49
            D1B:    POWDER
50
51
52
53
54
            }

    # correspondance between instrument and acquisition mode
    ACQUISITION_MODES = {
            D11:    [SANS_ACQ],
55
            D11B:    [SANS_ACQ],
56
            D16:    [SANS_ACQ, SANS_PSCAN],
57
            D22:    [SANS_ACQ],
58
            D22B:    [SANS_ACQ],
59
60
            D33:    [SANS_ACQ],
            D17:    [REFL_POL, REFL_NPOL],
61
62
            FIGARO: [REFL_NPOL],
            D2B:    [POWDER_DSCAN],
63
            D20:    [POWDER_DSCAN, POWDER_PSCAN],
64
            D1B:    [POWDER_PSCAN]
65
            }
66

67
    # parameters for each acquisition mode
68
    COLUMNS = {
69
            SANS_ACQ: [
70
71
72
73
74
75
76
77
78
79
80
                "SampleRuns",
                "SampleTransmissionRuns",
                "AbsorberRuns",
                "BeamRuns",
                "FluxRuns",
                "ContainerRuns",
                "ContainerTransmissionRuns",
                "TransmissionAbsorberRuns",
                "TransmissionBeamRuns",
                "MaskFiles",
                "ReferenceFiles",
81
                "SolventFiles",
82
                "OutputWorkspace",
83
                "SampleThickness",
84
85
                "CustomOptions"
                ],
86
87
88
89
90
91
92
93
            SANS_PSCAN: [
                "SampleRuns",
                "AbsorberRuns",
                "ContainerRuns",
                "OutputWorkspace",
                "OutputJoinedWorkspace",
                "CustomOptions"
                ],
94
            REFL_POL: [
95
96
97
98
99
100
                "Run00",
                "Run01",
                "Run10",
                "Run11",
                "DirectRun",
                "OutputWorkspace",
101
                "AngleOption",
102
103
                "Theta",
                "SummationType",
104
105
                "GlobalScaleFactor",
                "UseManualScaleFactors",
106
107
                "ManualScaleFactors",
                "CustomOptions"
108
109
                ],
            REFL_NPOL: [
110
111
112
113
114
115
                "Run",
                "DirectRun",
                "OutputWorkspace",
                "AngleOption",
                "Theta",
                "SummationType",
116
117
118
                "GlobalScaleFactor",
                "UseManualScaleFactors",
                "ManualScaleFactors",
119
                "CustomOptions"
120
121
122
123
124
125
                ],
            POWDER_DSCAN: [
                "Run",
                "OutputWorkspace",
                "CustomOptions"
                ],
126
127
128
129
130
            POWDER_PSCAN: [
                "Run",
                "OutputWorkspace",
                "CustomOptions"
                ],
131
            }
132

133
    VISUAL_SETTINGS = {
134
135
136
137
138
139
            SANS_ACQ: {
                "HiddenColumns": [
                    "FluxRuns",
                    "TransmissionAbsorberRuns"
                    ]
                }
140
141
            }

142
143
    # algo name for each acquisition mode
    ALGORITHM = {
144
            SANS_ACQ:     "SANSILLAutoProcess",
145
            SANS_PSCAN:   "SANSILLParameterScan",
146
147
148
            REFL_POL:     "ReflectometryILLAutoProcess",
            REFL_NPOL:    "ReflectometryILLAutoProcess",
            POWDER_DSCAN: "PowderILLDetectorScan",
149
            POWDER_PSCAN: "PowderILLParameterScan",
150
            }
151

152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
    # export algos for each acquisition mode. Each algo has a boolean to set
    # it as activated or not
    EXPORT_ALGORITHMS = {
            SANS_ACQ: {
                "SaveNexusProcessed": False,
                "SaveAscii": False,
                "SaveCanSAS1D": True,
                "SaveNISTDAT": True
                },
            REFL_POL: {
                "SaveNexusProcessed": False,
                "SaveAscii": False,
                "SaveReflectometryAscii": True
                },
            REFL_NPOL: {
                "SaveNexusProcessed": False,
                "SaveAscii": False,
                "SaveReflectometryAscii": True
                },
            POWDER_DSCAN: {
                "SaveNexusProcessed": False,
                "SaveAscii": False,
Guillaume Communie's avatar
Guillaume Communie committed
174
                "SaveFocusedXYE": True
175
176
177
178
179
180
181
182
                },
            POWDER_PSCAN: {
                "SaveNexusProcessed": False,
                "SaveAscii": False,
                "SaveFocussedXYE": True
                }
            }

183
184
185
186
187
    EXPORT_ALGO_CRITERIA = {
            "SaveCanSAS1D": "%OutputType% == 'I(Q)'",
            "SaveNISTDAT": "%OutputType% == 'I(Qx,Qy)'",
            }

188
189
190
191
192
193
194
195
196
    EXPORT_ALGO_EXTENSION = {
            "SaveNexusProcessed": ".nxs",
            "SaveAscii": ".txt",
            "SaveCanSAS1D": ".xml",
            "SaveNISTDAT": ".dat",
            "SaveReflectometryAscii": ".mft",
            "SaveFocussedXYE": ".dat"
            }

197
198
199
    # ideal number of threads for each acquisition mode (optional)
    # if not provided, Qt will decide, which will likely be the number of cores
    # for the moment, limit those to 1 until the algorithms are made truly thread safe
200
    THREADS_NUMBER = {
201
            SANS_ACQ:     1,
202
            SANS_PSCAN:   1,
203
204
205
            REFL_POL:     1,
            REFL_NPOL:    1,
            POWDER_DSCAN: 1,
206
            POWDER_PSCAN: 1,
207
208
            }

209
    # settings for each acquisition mode
210
211
212
213
214
215
216
217
218
219

    # optionnal flags
    FLAGS = {
            REFL_POL : {
                "PolarizationOption": "Polarized"
                },
            REFL_NPOL : {
                "PolarizationOption": "NonPolarized"
                }
            }
220
    SETTINGS = {
221
222
223
224
225
226
227
            SANS_ACQ : [
                "ThetaDependent",
                "SensitivityMaps",
                "DefaultMaskFile",
                "NormaliseBy",
                "SampleThickness",
                "BeamRadius",
228
                "TransmissionBeamRadius",
229
230
231
232
233
234
235
236
237
238
239
240
241
242
                "WaterCrossSection",
                "OutputType",
                "CalculateResolution",
                "DefaultQBinning",
                "BinningFactor",
                "OutputBinning",
                "NPixelDivision",
                "NumberOfWedges",
                "WedgeAngle",
                "WedgeOffset",
                "AsymmetricWedges",
                "MaxQxy",
                "DeltaQ",
                "IQxQyLogBinning",
243
                "OutputPanels",
Mathieu Tillet's avatar
Mathieu Tillet committed
244
                "WavelengthRange",
245
                "StitchReferenceIndex",
246
                "ClearCorrected2DWorkspace",
247
248
249
                "ShapeTable",
                "Wavelength"
            ],
250
251
252
253
254
255
256
257
258
            SANS_PSCAN : [
                "SensitivityMap",
                "DefaultMaskFile",
                "NormaliseBy",
                "Observable",
                "PixelYMin",
                "PixelYMax",
                "Wavelength"
                ],
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
            REFL_POL : [
                "PolarizationEfficiencyFile",
                "DirectFlatBackground",
                "ReflFlatBackground",
                "SubalgorithmLogging",
                "Cleanup",
                "WaterWorkspace",
                "SlitNormalisation",
                "FluxNormalisation",
                "CacheDirectBeam",
                "WavelengthLowerBound",
                "WavelengthUpperBound",
                "DeltaQFractionBinning",
                "DirectLowAngleFrgHalfWidth",
                "DirectLowAngleBkgOffset",
                "DirectLowAngleBkgWidth",
                "DirectHighAngleFrgHalfWidth",
                "DirectHighAngleBkgOffset",
                "DirectHighAngleBkgWidth",
                "DirectFitStartWorkspaceIndex",
                "DirectFitEndWorkspaceIndex",
                "DirectFitWavelengthLowerBound",
                "DirectFitWavelengthUpperBound",
                "ReflLowAngleFrgHalfWidth",
                "ReflLowAngleBkgOffset",
                "ReflLowAngleBkgWidth",
                "ReflHighAngleFrgHalfWidth",
                "ReflHighAngleBkgOffset",
                "ReflHighAngleBkgWidth",
                "ReflFitStartWorkspaceIndex",
                "ReflFitEndWorkspaceIndex",
                "ReflFitWavelengthLowerBound",
                "ReflFitWavelengthUpperBound"
                ],
            REFL_NPOL : [
                "DirectFlatBackground",
                "ReflFlatBackground",
                "SubalgorithmLogging",
                "Cleanup",
                "WaterWorkspace",
                "SlitNormalisation",
                "FluxNormalisation",
                "CacheDirectBeam",
                "WavelengthLowerBound",
                "WavelengthUpperBound",
                "DeltaQFractionBinning",
                "DirectLowAngleFrgHalfWidth",
                "DirectLowAngleBkgOffset",
                "DirectLowAngleBkgWidth",
                "DirectHighAngleFrgHalfWidth",
                "DirectHighAngleBkgOffset",
                "DirectHighAngleBkgWidth",
                "DirectFitStartWorkspaceIndex",
                "DirectFitEndWorkspaceIndex",
                "DirectFitWavelengthLowerBound",
                "DirectFitWavelengthUpperBound",
                "ReflLowAngleFrgHalfWidth",
                "ReflLowAngleBkgOffset",
                "ReflLowAngleBkgWidth",
                "ReflHighAngleFrgHalfWidth",
                "ReflHighAngleBkgOffset",
                "ReflHighAngleBkgWidth",
                "ReflFitStartWorkspaceIndex",
                "ReflFitEndWorkspaceIndex",
                "ReflFitWavelengthLowerBound",
                "ReflFitWavelengthUpperBound"
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
                ],
            POWDER_DSCAN: [
                "NormaliseTo",
                "CalibrationFile",
                "UseCalibratedData",
                "Output2DTubes",
                "Output2D",
                "Output1D",
                "CropNegativeScatteringAngles",
                "HeightRange",
                "InitialMask",
                "FinalMask",
                "ComponentsToMask",
                "ComponentsToReduce",
                "AlignTubes"
                ],
            POWDER_PSCAN: [
                "CalibrationFile",
                "ROCCorrectionFile",
                "NormaliseTo",
                "ROI",
                "Observable",
                "SortObservableAxis",
                "ScanAxisBinWidth",
                "CropNegative2Theta",
                "ZeroCountingCells",
                "Unit"
352
                ]
353
354
            }

355
356
357
    # Json keys
    INSTRUMENT_JSON_KEY = "Instrument"
    TECHNIQUE_JSON_KEY = "Technique"
358
    MODE_JSON_KEY = "AcquisitionMode"
359
360
    CYCLE_JSON_KEY = "CycleNumber"
    EXPERIMENT_JSON_KEY = "ExperimentID"
361
362
363
    SETTINGS_JSON_KEY = "GlobalSettings"
    SAMPLES_JSON_KEY = "Samples"
    CUSTOM_OPT_JSON_KEY = "CustomOptions"
364
    VISUAL_SETTINGS_JSON_KEY = "VisualSettings"
365
    EXPORT_JSON_KEY = "ExportAlgorithms"