|
20 | 20 | "import scipp as sc\n", |
21 | 21 | "import sciline\n", |
22 | 22 | "from essreflectometry.amor import providers, default_parameters\n", |
23 | | - "from essreflectometry.types import *" |
| 23 | + "from essreflectometry.types import *\n", |
| 24 | + "from essreflectometry.amor.data import providers as amor_data" |
24 | 25 | ] |
25 | 26 | }, |
26 | 27 | { |
|
29 | 30 | "metadata": {}, |
30 | 31 | "outputs": [], |
31 | 32 | "source": [ |
32 | | - "params = {\n", |
33 | | - " **default_parameters,\n", |
34 | | - " QBins: sc.geomspace(dim='Q', start=0.008, stop=0.075, num=200, unit='1/angstrom'),\n", |
35 | | - " SampleRotation[Sample]: sc.scalar(0.7989, unit='deg'),\n", |
36 | | - " Filename[Sample]: \"sample.nxs\",\n", |
37 | | - " SampleRotation[Reference]: sc.scalar(0.8389, unit='deg'),\n", |
38 | | - " Filename[Reference]: \"reference.nxs\",\n", |
39 | | - " WavelengthEdges: sc.array(dims=['wavelength'], values=[2.4, 16.0], unit='angstrom'),\n", |
40 | | - "}" |
41 | | - ] |
42 | | - }, |
43 | | - { |
44 | | - "cell_type": "code", |
45 | | - "execution_count": null, |
46 | | - "metadata": {}, |
47 | | - "outputs": [], |
48 | | - "source": [ |
49 | | - "pipeline = sciline.Pipeline(\n", |
50 | | - " providers,\n", |
51 | | - " params=params\n", |
52 | | - ")" |
| 33 | + "pl = sciline.Pipeline(\n", |
| 34 | + " (*providers, *amor_data),\n", |
| 35 | + " params=default_parameters\n", |
| 36 | + ")\n", |
| 37 | + "\n", |
| 38 | + "pl[QBins] = sc.geomspace(dim='Q', start=0.008, stop=0.075, num=200, unit='1/angstrom')\n", |
| 39 | + "pl[SampleRotation[Sample]] = sc.scalar(0.7989, unit='deg')\n", |
| 40 | + "pl[PoochFilename[Sample]] = \"sample.nxs\"\n", |
| 41 | + "pl[SampleRotation[Reference]] = sc.scalar(0.8389, unit='deg')\n", |
| 42 | + "pl[PoochFilename[Reference]] = \"reference.nxs\"\n", |
| 43 | + "pl[WavelengthEdges] = sc.array(dims=['wavelength'], values=[2.4, 16.0], unit='angstrom')" |
53 | 44 | ] |
54 | 45 | }, |
55 | 46 | { |
|
58 | 49 | "metadata": {}, |
59 | 50 | "outputs": [], |
60 | 51 | "source": [ |
61 | | - "pipeline.visualize((NormalizedIofQ, QResolution), graph_attr={'rankdir': 'LR'})" |
| 52 | + "pl.visualize((NormalizedIofQ, QResolution), graph_attr={'rankdir': 'LR'})" |
62 | 53 | ] |
63 | 54 | }, |
64 | 55 | { |
|
68 | 59 | "outputs": [], |
69 | 60 | "source": [ |
70 | 61 | "# Compute I over Q and the standard deviation of Q\n", |
71 | | - "ioq, qstd = pipeline.compute((NormalizedIofQ, QResolution)).values()" |
| 62 | + "ioq, qstd = pl.compute((NormalizedIofQ, QResolution)).values()" |
72 | 63 | ] |
73 | 64 | }, |
74 | 65 | { |
|
103 | 94 | "outputs": [], |
104 | 95 | "source": [ |
105 | 96 | "from essreflectometry.types import ThetaData\n", |
106 | | - "pipeline.compute(ThetaData[Sample])\\\n", |
| 97 | + "pl.compute(ThetaData[Sample])\\\n", |
107 | 98 | " .bins.concat('detector_number')\\\n", |
108 | 99 | " .hist(\n", |
109 | 100 | " theta=sc.linspace(dim='theta', start=0.0, stop=1.2, num=165, unit='deg').to(unit='rad'),\n", |
|
149 | 140 | "metadata": {}, |
150 | 141 | "outputs": [], |
151 | 142 | "source": [ |
152 | | - "providers_with_metadata = (\n", |
153 | | - " *providers,\n", |
154 | | - " *orso.providers,\n", |
155 | | - " *amor_orso.providers,\n", |
156 | | - ")\n", |
| 143 | + "for p in (*orso.providers, *amor_orso.providers):\n", |
| 144 | + " pl.insert(p)\n", |
157 | 145 | "\n", |
158 | | - "params[orso.OrsoCreator] = orso.OrsoCreator(fileio.base.Person(\n", |
| 146 | + "pl[orso.OrsoCreator] = orso.OrsoCreator(fileio.base.Person(\n", |
159 | 147 | " name='Max Mustermann',\n", |
160 | 148 | " affiliation='European Spallation Source ERIC',\n", |
161 | 149 | " contact='[email protected]',\n", |
162 | | - "))\n", |
163 | | - "\n", |
164 | | - "metadata_pipeline = sciline.Pipeline(\n", |
165 | | - " providers_with_metadata,\n", |
166 | | - " params=params\n", |
167 | | - ")" |
| 150 | + "))" |
168 | 151 | ] |
169 | 152 | }, |
170 | 153 | { |
|
180 | 163 | "metadata": {}, |
181 | 164 | "outputs": [], |
182 | 165 | "source": [ |
183 | | - "iofq_dataset = metadata_pipeline.compute(orso.OrsoIofQDataset)" |
| 166 | + "iofq_dataset = pl.compute(orso.OrsoIofQDataset)" |
184 | 167 | ] |
185 | 168 | }, |
186 | 169 | { |
|
243 | 226 | "metadata": {}, |
244 | 227 | "outputs": [], |
245 | 228 | "source": [ |
246 | | - "iofq_dataset.info.reduction.corrections = orso.find_corrections(metadata_pipeline.get(orso.OrsoIofQDataset))" |
| 229 | + "iofq_dataset.info.reduction.corrections = orso.find_corrections(pl.get(orso.OrsoIofQDataset))" |
247 | 230 | ] |
248 | 231 | }, |
249 | 232 | { |
|
0 commit comments