|
18 | 18 | ) |
19 | 19 | from ess.powder.types import ( |
20 | 20 | AccumulatedProtonCharge, |
| 21 | + CaveMonitor, |
21 | 22 | CaveMonitorPosition, # Should this be a DREAM-only parameter? |
22 | 23 | EmptyCanRun, |
23 | 24 | KeepEvents, |
|
32 | 33 | WavelengthMask, |
33 | 34 | ) |
34 | 35 | from ess.reduce import time_of_flight |
| 36 | +from ess.reduce.nexus.types import NeXusName |
35 | 37 | from ess.reduce.parameter import parameter_mappers |
| 38 | +from ess.reduce.time_of_flight import GenericTofWorkflow |
36 | 39 | from ess.reduce.workflow import register_workflow |
37 | 40 |
|
38 | 41 | from .beamline import InstrumentConfiguration |
@@ -105,6 +108,33 @@ def _collect_reducer_software() -> ReducerSoftware: |
105 | 108 | ) |
106 | 109 |
|
107 | 110 |
|
| 111 | +def DreamPowderWorkflow(*, run_norm: RunNormalization) -> sciline.Pipeline: |
| 112 | + """ |
| 113 | + Dream powder workflow with default parameters. |
| 114 | +
|
| 115 | + Parameters |
| 116 | + ---------- |
| 117 | + run_norm: |
| 118 | + Select how to normalize each run (sample, vanadium, etc.). |
| 119 | +
|
| 120 | + Returns |
| 121 | + ------- |
| 122 | + : |
| 123 | + A workflow object for DREAM. |
| 124 | + """ |
| 125 | + wf = GenericTofWorkflow(run_types=[SampleRun], monitor_types=[CaveMonitor]) |
| 126 | + for provider in itertools.chain(powder_providers, _dream_providers): |
| 127 | + wf.insert(provider) |
| 128 | + wf[NeXusName[CaveMonitor]] = "monitor_cave" |
| 129 | + insert_run_normalization(wf, run_norm) |
| 130 | + for key, value in itertools.chain( |
| 131 | + default_parameters().items(), time_of_flight.default_parameters().items() |
| 132 | + ): |
| 133 | + wf[key] = value |
| 134 | + wf.typical_outputs = typical_outputs |
| 135 | + return wf |
| 136 | + |
| 137 | + |
108 | 138 | def DreamGeant4Workflow(*, run_norm: RunNormalization) -> sciline.Pipeline: |
109 | 139 | """ |
110 | 140 | Workflow with default parameters for the Dream Geant4 simulation. |
|
0 commit comments