|
15 | 15 | from ess.powder.conversion import convert_monitor_to_wavelength |
16 | 16 | from ess.powder.correction import ( |
17 | 17 | RunNormalization, |
| 18 | + add_empty_can_subtraction, |
18 | 19 | insert_run_normalization, |
19 | 20 | ) |
20 | 21 | from ess.powder.types import ( |
@@ -114,16 +115,34 @@ def convert_dream_monitor_to_wavelength( |
114 | 115 | return convert_monitor_to_wavelength(monitor) |
115 | 116 |
|
116 | 117 |
|
117 | | -def DreamGeant4Workflow(*, run_norm: RunNormalization) -> sciline.Pipeline: |
| 118 | +def DreamGeant4Workflow( |
| 119 | + *, run_norm: RunNormalization, subtract_empty_can: bool = False |
| 120 | +) -> sciline.Pipeline: |
118 | 121 | """ |
119 | 122 | Workflow with default parameters for the Dream Geant4 simulation. |
| 123 | +
|
| 124 | + Parameters |
| 125 | + ---------- |
| 126 | + run_norm: |
| 127 | + Select how to normalize each run (sample, vanadium, etc.). |
| 128 | + subtract_empty_can: |
| 129 | + If ``True``, subtract the same data by an empty can / empty instrument |
| 130 | + measurement before normalizing by vanadium. |
| 131 | + This requires specifying a filename parameter for the empty can run. |
| 132 | +
|
| 133 | + Returns |
| 134 | + ------- |
| 135 | + : |
| 136 | + A workflow object for DREAM. |
120 | 137 | """ |
121 | 138 | wf = LoadGeant4Workflow() |
122 | 139 | for provider in itertools.chain(powder_providers, _dream_providers): |
123 | 140 | wf.insert(provider) |
124 | 141 | wf.insert(convert_dream_monitor_to_wavelength) |
125 | 142 | wf.insert(resample_monitor_time_of_flight_data) |
126 | 143 | insert_run_normalization(wf, run_norm) |
| 144 | + if subtract_empty_can: |
| 145 | + add_empty_can_subtraction(wf) |
127 | 146 | for key, value in itertools.chain( |
128 | 147 | default_parameters().items(), time_of_flight.default_parameters().items() |
129 | 148 | ): |
|
0 commit comments