essdiffraction 24.10.0__tar.gz → 24.11.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {essdiffraction-24.10.0/src/essdiffraction.egg-info → essdiffraction-24.11.0}/PKG-INFO +3 -3
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/api-reference/index.md +1 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/user-guide/dream/dream-data-reduction.ipynb +147 -53
- essdiffraction-24.11.0/docs/user-guide/dream/dream-detector-diagnostics.ipynb +112 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/user-guide/dream/index.md +2 -0
- essdiffraction-24.11.0/docs/user-guide/dream/workflow-widget-dream.ipynb +140 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/pyproject.toml +2 -2
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/base.in +2 -2
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/base.txt +23 -21
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/basetest.txt +3 -3
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/ci.txt +4 -4
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/dev.txt +11 -11
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/docs.txt +12 -12
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/mypy.txt +1 -1
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/nightly.txt +14 -12
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/static.txt +2 -2
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/wheels.txt +2 -2
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/dream/data.py +27 -0
- essdiffraction-24.11.0/src/ess/dream/diagnostics.py +235 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/dream/io/__init__.py +3 -3
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/dream/io/cif.py +12 -7
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/dream/io/geant4.py +65 -0
- essdiffraction-24.11.0/src/ess/dream/parameters.py +66 -0
- essdiffraction-24.11.0/src/ess/dream/workflow.py +108 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/powder/__init__.py +4 -0
- essdiffraction-24.11.0/src/ess/powder/calibration.py +114 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/powder/conversion.py +33 -3
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/powder/correction.py +122 -44
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/powder/masking.py +2 -2
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/powder/types.py +25 -4
- {essdiffraction-24.10.0 → essdiffraction-24.11.0/src/essdiffraction.egg-info}/PKG-INFO +3 -3
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/essdiffraction.egg-info/SOURCES.txt +6 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/essdiffraction.egg-info/requires.txt +2 -2
- essdiffraction-24.11.0/tests/dream/diagnostics_test.py +57 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/tests/dream/geant4_reduction_test.py +76 -12
- essdiffraction-24.11.0/tests/dream/io/cif_test.py +65 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/tests/powder/correction_test.py +160 -1
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/tests/snspowder/powgen/powgen_reduction_test.py +2 -2
- essdiffraction-24.10.0/src/ess/dream/workflow.py +0 -52
- essdiffraction-24.10.0/tests/dream/io/cif_test.py +0 -49
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/.copier-answers.ess.yml +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/.copier-answers.yml +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/.github/ISSUE_TEMPLATE/blank.md +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/.github/ISSUE_TEMPLATE/high-level-requirement.yml +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/.github/dependabot.yml +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/.github/workflows/ci.yml +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/.github/workflows/docs.yml +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/.github/workflows/nightly_at_main.yml +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/.github/workflows/nightly_at_release.yml +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/.github/workflows/python-version-ci +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/.github/workflows/release.yml +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/.github/workflows/test.yml +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/.github/workflows/unpinned.yml +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/.gitignore +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/.pre-commit-config.yaml +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/.python-version +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/CODE_OF_CONDUCT.md +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/CONTRIBUTING.md +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/LICENSE +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/MANIFEST.in +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/README.md +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/conda/meta.yaml +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/_static/anaconda-icon.js +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/_static/favicon.svg +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/_static/logo-dark.svg +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/_static/logo.svg +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/_templates/class-template.rst +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/_templates/doc_version.html +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/_templates/module-template.rst +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/about/bibliography.rst +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/about/index.md +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/bibliography.bib +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/conf.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/developer/coding-conventions.md +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/developer/dependency-management.md +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/developer/getting-started.md +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/developer/index.md +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/index.md +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/user-guide/dream/dream-instrument-view.ipynb +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/user-guide/index.md +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/user-guide/sns-instruments/POWGEN_data_reduction.ipynb +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/user-guide/sns-instruments/index.md +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/user-guide/sns-instruments/preprocess_files.ipynb +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/user-guide/sns-instruments/vanadium_processing.ipynb +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/basetest.in +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/ci.in +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/dev.in +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/docs.in +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/make_base.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/mypy.in +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/nightly.in +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/static.in +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/test.in +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/test.txt +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/requirements/wheels.in +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/resources/logo.svg +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/setup.cfg +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/diffraction/__init__.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/diffraction/py.typed +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/dream/__init__.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/dream/instrument_view.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/dream/io/nexus.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/dream/py.typed +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/powder/_util.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/powder/filtering.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/powder/grouping.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/powder/logging.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/powder/py.typed +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/powder/smoothing.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/powder/transform.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/snspowder/powgen/__init__.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/snspowder/powgen/beamline.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/snspowder/powgen/calibration.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/snspowder/powgen/data.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/snspowder/powgen/instrument_view.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/snspowder/powgen/peaks.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/ess/snspowder/powgen/workflow.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/essdiffraction.egg-info/dependency_links.txt +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/src/essdiffraction.egg-info/top_level.txt +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/tests/dream/instrument_view_test.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/tests/dream/io/geant4_test.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/tests/dream/io/nexus_test.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/tests/package_test.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/tests/powder/conversion_test.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/tests/powder/filtering_test.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/tests/powder/transform_test.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/tests/snspowder/powgen/load_test.py +0 -0
- {essdiffraction-24.10.0 → essdiffraction-24.11.0}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: essdiffraction
|
|
3
|
-
Version: 24.
|
|
3
|
+
Version: 24.11.0
|
|
4
4
|
Summary: Diffraction data reduction for the European Spallation Source
|
|
5
5
|
Author: Scipp contributors
|
|
6
6
|
License: BSD 3-Clause License
|
|
@@ -51,14 +51,14 @@ Requires-Python: >=3.10
|
|
|
51
51
|
Description-Content-Type: text/markdown
|
|
52
52
|
License-File: LICENSE
|
|
53
53
|
Requires-Dist: dask
|
|
54
|
-
Requires-Dist: essreduce>=24.
|
|
54
|
+
Requires-Dist: essreduce>=24.11.3
|
|
55
55
|
Requires-Dist: graphviz
|
|
56
56
|
Requires-Dist: numpy
|
|
57
57
|
Requires-Dist: plopp
|
|
58
58
|
Requires-Dist: pythreejs
|
|
59
59
|
Requires-Dist: sciline>=24.06.0
|
|
60
60
|
Requires-Dist: scipp>=24.09.1
|
|
61
|
-
Requires-Dist: scippneutron>=24.
|
|
61
|
+
Requires-Dist: scippneutron>=24.11.0
|
|
62
62
|
Requires-Dist: scippnexus>=23.12.0
|
|
63
63
|
Provides-Extra: test
|
|
64
64
|
Requires-Dist: pandas; extra == "test"
|
{essdiffraction-24.10.0 → essdiffraction-24.11.0}/docs/user-guide/dream/dream-data-reduction.ipynb
RENAMED
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"outputs": [],
|
|
21
21
|
"source": [
|
|
22
22
|
"import scipp as sc\n",
|
|
23
|
-
"from scippneutron.io import cif\n",
|
|
24
23
|
"\n",
|
|
25
24
|
"from ess import dream, powder\n",
|
|
26
25
|
"import ess.dream.data # noqa: F401\n",
|
|
@@ -44,7 +43,7 @@
|
|
|
44
43
|
"metadata": {},
|
|
45
44
|
"outputs": [],
|
|
46
45
|
"source": [
|
|
47
|
-
"workflow = dream.DreamGeant4Workflow()"
|
|
46
|
+
"workflow = dream.DreamGeant4Workflow(run_norm=powder.RunNormalization.proton_charge)"
|
|
48
47
|
]
|
|
49
48
|
},
|
|
50
49
|
{
|
|
@@ -74,7 +73,7 @@
|
|
|
74
73
|
"workflow[DspacingBins] = sc.linspace(\"dspacing\", 0.0, 2.3434, 201, unit=\"angstrom\")\n",
|
|
75
74
|
"# Mask in time-of-flight to crop to valid range\n",
|
|
76
75
|
"workflow[TofMask] = lambda x: (x < sc.scalar(0.0, unit=\"ns\")) | (\n",
|
|
77
|
-
"
|
|
76
|
+
" x > sc.scalar(86e6, unit=\"ns\")\n",
|
|
78
77
|
")\n",
|
|
79
78
|
"workflow[TwoThetaMask] = None\n",
|
|
80
79
|
"workflow[WavelengthMask] = None\n",
|
|
@@ -86,50 +85,25 @@
|
|
|
86
85
|
"cell_type": "markdown",
|
|
87
86
|
"id": "6",
|
|
88
87
|
"metadata": {},
|
|
89
|
-
"source": [
|
|
90
|
-
"We also need some parameters to configure the output file:"
|
|
91
|
-
]
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"cell_type": "code",
|
|
95
|
-
"execution_count": null,
|
|
96
|
-
"id": "7",
|
|
97
|
-
"metadata": {},
|
|
98
|
-
"outputs": [],
|
|
99
|
-
"source": [
|
|
100
|
-
"workflow[CIFAuthors] = CIFAuthors([\n",
|
|
101
|
-
" cif.Author(\n",
|
|
102
|
-
" name=\"Jane Doe\",\n",
|
|
103
|
-
" email=\"jane.doe@ess.eu\",\n",
|
|
104
|
-
" orcid=\"0000-0000-0000-0001\",\n",
|
|
105
|
-
" role=\"measurement\",\n",
|
|
106
|
-
" ),\n",
|
|
107
|
-
"])"
|
|
108
|
-
]
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"cell_type": "markdown",
|
|
112
|
-
"id": "8",
|
|
113
|
-
"metadata": {},
|
|
114
88
|
"source": [
|
|
115
89
|
"## Use the workflow\n",
|
|
116
90
|
"\n",
|
|
117
|
-
"We can visualize the graph for computing the final normalized result for intensity as a function of
|
|
91
|
+
"We can visualize the graph for computing the final normalized result for intensity as a function of time-of-flight:"
|
|
118
92
|
]
|
|
119
93
|
},
|
|
120
94
|
{
|
|
121
95
|
"cell_type": "code",
|
|
122
96
|
"execution_count": null,
|
|
123
|
-
"id": "
|
|
97
|
+
"id": "7",
|
|
124
98
|
"metadata": {},
|
|
125
99
|
"outputs": [],
|
|
126
100
|
"source": [
|
|
127
|
-
"workflow.visualize(
|
|
101
|
+
"workflow.visualize([IofTof, ReducedTofCIF], graph_attr={\"rankdir\": \"LR\"})"
|
|
128
102
|
]
|
|
129
103
|
},
|
|
130
104
|
{
|
|
131
105
|
"cell_type": "markdown",
|
|
132
|
-
"id": "
|
|
106
|
+
"id": "8",
|
|
133
107
|
"metadata": {},
|
|
134
108
|
"source": [
|
|
135
109
|
"We then call `compute()` to compute the result:\n",
|
|
@@ -139,39 +113,38 @@
|
|
|
139
113
|
{
|
|
140
114
|
"cell_type": "code",
|
|
141
115
|
"execution_count": null,
|
|
142
|
-
"id": "
|
|
116
|
+
"id": "9",
|
|
143
117
|
"metadata": {},
|
|
144
118
|
"outputs": [],
|
|
145
119
|
"source": [
|
|
146
|
-
"results = workflow.compute([
|
|
147
|
-
"result = results[
|
|
148
|
-
"cif_data = results[
|
|
120
|
+
"results = workflow.compute([IofTof, ReducedTofCIF])\n",
|
|
121
|
+
"result = results[IofTof]\n",
|
|
122
|
+
"cif_data = results[ReducedTofCIF]"
|
|
149
123
|
]
|
|
150
124
|
},
|
|
151
125
|
{
|
|
152
126
|
"cell_type": "code",
|
|
153
127
|
"execution_count": null,
|
|
154
|
-
"id": "
|
|
128
|
+
"id": "10",
|
|
155
129
|
"metadata": {},
|
|
156
130
|
"outputs": [],
|
|
157
131
|
"source": [
|
|
158
|
-
"
|
|
159
|
-
"
|
|
132
|
+
"histogram = result.hist()\n",
|
|
133
|
+
"histogram.plot()"
|
|
160
134
|
]
|
|
161
135
|
},
|
|
162
136
|
{
|
|
163
137
|
"cell_type": "markdown",
|
|
164
|
-
"id": "
|
|
138
|
+
"id": "11",
|
|
165
139
|
"metadata": {},
|
|
166
140
|
"source": [
|
|
167
|
-
"We can now save the result to disk
|
|
168
|
-
"(The comment is optional but helps to identify the file later.)"
|
|
141
|
+
"We can now save the result to disk:"
|
|
169
142
|
]
|
|
170
143
|
},
|
|
171
144
|
{
|
|
172
145
|
"cell_type": "code",
|
|
173
146
|
"execution_count": null,
|
|
174
|
-
"id": "
|
|
147
|
+
"id": "12",
|
|
175
148
|
"metadata": {},
|
|
176
149
|
"outputs": [],
|
|
177
150
|
"source": [
|
|
@@ -179,12 +152,12 @@
|
|
|
179
152
|
"in the documentation of ESSdiffraction.\n",
|
|
180
153
|
"See https://scipp.github.io/essdiffraction/\n",
|
|
181
154
|
"\"\"\"\n",
|
|
182
|
-
"cif_data.save('
|
|
155
|
+
"cif_data.save('reduced.cif')"
|
|
183
156
|
]
|
|
184
157
|
},
|
|
185
158
|
{
|
|
186
159
|
"cell_type": "markdown",
|
|
187
|
-
"id": "
|
|
160
|
+
"id": "13",
|
|
188
161
|
"metadata": {},
|
|
189
162
|
"source": [
|
|
190
163
|
"## Compute intermediate results\n",
|
|
@@ -197,7 +170,7 @@
|
|
|
197
170
|
{
|
|
198
171
|
"cell_type": "code",
|
|
199
172
|
"execution_count": null,
|
|
200
|
-
"id": "
|
|
173
|
+
"id": "14",
|
|
201
174
|
"metadata": {},
|
|
202
175
|
"outputs": [],
|
|
203
176
|
"source": [
|
|
@@ -214,7 +187,7 @@
|
|
|
214
187
|
{
|
|
215
188
|
"cell_type": "code",
|
|
216
189
|
"execution_count": null,
|
|
217
|
-
"id": "
|
|
190
|
+
"id": "15",
|
|
218
191
|
"metadata": {},
|
|
219
192
|
"outputs": [],
|
|
220
193
|
"source": [
|
|
@@ -226,7 +199,7 @@
|
|
|
226
199
|
},
|
|
227
200
|
{
|
|
228
201
|
"cell_type": "markdown",
|
|
229
|
-
"id": "
|
|
202
|
+
"id": "16",
|
|
230
203
|
"metadata": {},
|
|
231
204
|
"source": [
|
|
232
205
|
"## Grouping by scattering angle\n",
|
|
@@ -238,7 +211,7 @@
|
|
|
238
211
|
{
|
|
239
212
|
"cell_type": "code",
|
|
240
213
|
"execution_count": null,
|
|
241
|
-
"id": "
|
|
214
|
+
"id": "17",
|
|
242
215
|
"metadata": {},
|
|
243
216
|
"outputs": [],
|
|
244
217
|
"source": [
|
|
@@ -250,7 +223,7 @@
|
|
|
250
223
|
{
|
|
251
224
|
"cell_type": "code",
|
|
252
225
|
"execution_count": null,
|
|
253
|
-
"id": "
|
|
226
|
+
"id": "18",
|
|
254
227
|
"metadata": {},
|
|
255
228
|
"outputs": [],
|
|
256
229
|
"source": [
|
|
@@ -261,7 +234,7 @@
|
|
|
261
234
|
{
|
|
262
235
|
"cell_type": "code",
|
|
263
236
|
"execution_count": null,
|
|
264
|
-
"id": "
|
|
237
|
+
"id": "19",
|
|
265
238
|
"metadata": {},
|
|
266
239
|
"outputs": [],
|
|
267
240
|
"source": [
|
|
@@ -279,12 +252,133 @@
|
|
|
279
252
|
{
|
|
280
253
|
"cell_type": "code",
|
|
281
254
|
"execution_count": null,
|
|
282
|
-
"id": "
|
|
255
|
+
"id": "20",
|
|
283
256
|
"metadata": {},
|
|
284
257
|
"outputs": [],
|
|
285
258
|
"source": [
|
|
286
259
|
"grouped_dspacing.hist().plot(norm=\"log\")"
|
|
287
260
|
]
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"cell_type": "markdown",
|
|
264
|
+
"id": "21",
|
|
265
|
+
"metadata": {},
|
|
266
|
+
"source": [
|
|
267
|
+
"## Normalizing by monitor\n",
|
|
268
|
+
"\n",
|
|
269
|
+
"The workflow used above normalizes the detected counts by proton charge.\n",
|
|
270
|
+
"Alternatively, ESSdiffraction can normalize by a monitor.\n",
|
|
271
|
+
"In this example, this is DREAM's cave monitor.\n",
|
|
272
|
+
"\n",
|
|
273
|
+
"There are two options for normalizing by monitor:\n",
|
|
274
|
+
"1. Normalize by a wavelength-histogram of the monitor counts ([normalize_by_monitor_histogram](../../generated/modules/ess.powder.correction.normalize_by_monitor_histogram.rst)).\n",
|
|
275
|
+
"2. Normalized by the integral over all wavelength bins ([normalize_by_monitor_integrated](../../generated/modules/ess.powder.correction.normalize_by_monitor_integrated.rst)).\n",
|
|
276
|
+
"\n",
|
|
277
|
+
"Here, we use option 1.\n",
|
|
278
|
+
"Option 2 can be chosen by constructing a workflow using `run_norm=powder.RunNormalization.monitor_integrated`.\n",
|
|
279
|
+
"\n",
|
|
280
|
+
"Construct a workflow as before but select normalization by monitor histogram:"
|
|
281
|
+
]
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"cell_type": "code",
|
|
285
|
+
"execution_count": null,
|
|
286
|
+
"id": "22",
|
|
287
|
+
"metadata": {},
|
|
288
|
+
"outputs": [],
|
|
289
|
+
"source": [
|
|
290
|
+
"workflow = dream.DreamGeant4Workflow(run_norm=powder.RunNormalization.monitor_histogram)"
|
|
291
|
+
]
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"cell_type": "markdown",
|
|
295
|
+
"id": "23",
|
|
296
|
+
"metadata": {},
|
|
297
|
+
"source": [
|
|
298
|
+
"In addition to the parameters used before, we also need to provide filenames for monitor data and a position of the monitor as that is not saved in the simulation files:"
|
|
299
|
+
]
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"cell_type": "code",
|
|
303
|
+
"execution_count": null,
|
|
304
|
+
"id": "24",
|
|
305
|
+
"metadata": {},
|
|
306
|
+
"outputs": [],
|
|
307
|
+
"source": [
|
|
308
|
+
"workflow[MonitorFilename[SampleRun]] = dream.data.simulated_monitor_diamond_sample()\n",
|
|
309
|
+
"workflow[MonitorFilename[VanadiumRun]] = dream.data.simulated_monitor_vanadium_sample()\n",
|
|
310
|
+
"workflow[MonitorFilename[BackgroundRun]] = dream.data.simulated_monitor_empty_can()\n",
|
|
311
|
+
"workflow[CaveMonitorPosition] = sc.vector([0.0, 0.0, -4220.0], unit='mm')\n",
|
|
312
|
+
"\n",
|
|
313
|
+
"# These are the same as at the top of the notebook:\n",
|
|
314
|
+
"workflow[Filename[SampleRun]] = dream.data.simulated_diamond_sample()\n",
|
|
315
|
+
"workflow[Filename[VanadiumRun]] = dream.data.simulated_vanadium_sample()\n",
|
|
316
|
+
"workflow[Filename[BackgroundRun]] = dream.data.simulated_empty_can()\n",
|
|
317
|
+
"workflow[CalibrationFilename] = None\n",
|
|
318
|
+
"workflow[NeXusDetectorName] = \"mantle\"\n",
|
|
319
|
+
"workflow[UncertaintyBroadcastMode] = UncertaintyBroadcastMode.drop\n",
|
|
320
|
+
"workflow[DspacingBins] = sc.linspace(\"dspacing\", 0.0, 2.3434, 201, unit=\"angstrom\")\n",
|
|
321
|
+
"workflow[TofMask] = lambda x: (x < sc.scalar(0.0, unit=\"ns\")) | (\n",
|
|
322
|
+
" x > sc.scalar(86e6, unit=\"ns\")\n",
|
|
323
|
+
")\n",
|
|
324
|
+
"workflow[TwoThetaMask] = None\n",
|
|
325
|
+
"workflow[WavelengthMask] = None\n",
|
|
326
|
+
"workflow = powder.with_pixel_mask_filenames(workflow, [])"
|
|
327
|
+
]
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"cell_type": "code",
|
|
331
|
+
"execution_count": null,
|
|
332
|
+
"id": "25",
|
|
333
|
+
"metadata": {},
|
|
334
|
+
"outputs": [],
|
|
335
|
+
"source": [
|
|
336
|
+
"workflow.visualize(IofTof, graph_attr={\"rankdir\": \"LR\"})"
|
|
337
|
+
]
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"cell_type": "code",
|
|
341
|
+
"execution_count": null,
|
|
342
|
+
"id": "26",
|
|
343
|
+
"metadata": {},
|
|
344
|
+
"outputs": [],
|
|
345
|
+
"source": [
|
|
346
|
+
"results = workflow.compute((IofTof, WavelengthMonitor[SampleRun, CaveMonitor]))\n",
|
|
347
|
+
"normalized_by_monitor = results[IofTof]\n",
|
|
348
|
+
"monitor = results[WavelengthMonitor[SampleRun, CaveMonitor]]\n",
|
|
349
|
+
"monitor"
|
|
350
|
+
]
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
"cell_type": "code",
|
|
354
|
+
"execution_count": null,
|
|
355
|
+
"id": "27",
|
|
356
|
+
"metadata": {},
|
|
357
|
+
"outputs": [],
|
|
358
|
+
"source": [
|
|
359
|
+
"monitor.plot()"
|
|
360
|
+
]
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"cell_type": "markdown",
|
|
364
|
+
"id": "28",
|
|
365
|
+
"metadata": {},
|
|
366
|
+
"source": [
|
|
367
|
+
"Comparing the final, normalized result shows that it agrees with the data that was normalized by proton-charge:"
|
|
368
|
+
]
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
"cell_type": "code",
|
|
372
|
+
"execution_count": null,
|
|
373
|
+
"id": "29",
|
|
374
|
+
"metadata": {},
|
|
375
|
+
"outputs": [],
|
|
376
|
+
"source": [
|
|
377
|
+
"sc.plot({\n",
|
|
378
|
+
" 'By proton charge': histogram,\n",
|
|
379
|
+
" 'By monitor': normalized_by_monitor.hist()\n",
|
|
380
|
+
"})"
|
|
381
|
+
]
|
|
288
382
|
}
|
|
289
383
|
],
|
|
290
384
|
"metadata": {
|
|
@@ -303,7 +397,7 @@
|
|
|
303
397
|
"name": "python",
|
|
304
398
|
"nbconvert_exporter": "python",
|
|
305
399
|
"pygments_lexer": "ipython3",
|
|
306
|
-
"version": "3.10.
|
|
400
|
+
"version": "3.10.14"
|
|
307
401
|
}
|
|
308
402
|
},
|
|
309
403
|
"nbformat": 4,
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cells": [
|
|
3
|
+
{
|
|
4
|
+
"cell_type": "markdown",
|
|
5
|
+
"id": "0",
|
|
6
|
+
"metadata": {},
|
|
7
|
+
"source": [
|
|
8
|
+
"# DREAM Detector Diagnostics\n",
|
|
9
|
+
"\n",
|
|
10
|
+
"This page is primarily intended for instrument scientists and other experts.\n",
|
|
11
|
+
"\n",
|
|
12
|
+
"ESSdiffraction has some tools for inspecting the DREAM detector based on recorded event data.\n",
|
|
13
|
+
"This notebook gives an overview of the available tools.\n",
|
|
14
|
+
"\n",
|
|
15
|
+
"## Voxel Viewer\n",
|
|
16
|
+
"\n",
|
|
17
|
+
"The [FlatVoxelViewer](../../generated/modules/ess.dream.diagnostics.FlatVoxelViewer.rst) is an interactive visualization for inspecting individual voxels.\n",
|
|
18
|
+
"It shows a 2D histogram of recorded events.\n",
|
|
19
|
+
"The image axes correspond to a chosen pair of logical dimensions combined with all other dimensions.\n",
|
|
20
|
+
"Each bin in the image corresponds to exactly one detector voxel.\n",
|
|
21
|
+
"\n",
|
|
22
|
+
"Tick marks indicate the values of the chosen dimensions.\n",
|
|
23
|
+
"E.g., all pixels between module=2 and module=3 tick marks belong to module 2."
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"cell_type": "code",
|
|
28
|
+
"execution_count": null,
|
|
29
|
+
"id": "1",
|
|
30
|
+
"metadata": {},
|
|
31
|
+
"outputs": [],
|
|
32
|
+
"source": [
|
|
33
|
+
"import scipp as sc\n",
|
|
34
|
+
"\n",
|
|
35
|
+
"from ess import dream\n",
|
|
36
|
+
"from ess.dream.data import simulated_diamond_sample\n",
|
|
37
|
+
"from ess.dream.diagnostics import FlatVoxelViewer"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"cell_type": "code",
|
|
42
|
+
"execution_count": null,
|
|
43
|
+
"id": "2",
|
|
44
|
+
"metadata": {},
|
|
45
|
+
"outputs": [],
|
|
46
|
+
"source": [
|
|
47
|
+
"%matplotlib widget"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"cell_type": "markdown",
|
|
52
|
+
"id": "3",
|
|
53
|
+
"metadata": {},
|
|
54
|
+
"source": [
|
|
55
|
+
"Load simulated test data and compute histograms:"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"cell_type": "code",
|
|
60
|
+
"execution_count": null,
|
|
61
|
+
"id": "4",
|
|
62
|
+
"metadata": {},
|
|
63
|
+
"outputs": [],
|
|
64
|
+
"source": [
|
|
65
|
+
"raw = dream.io.load_geant4_csv(simulated_diamond_sample())\n",
|
|
66
|
+
"dg = sc.DataGroup({\n",
|
|
67
|
+
" k: v['events'].hist()\n",
|
|
68
|
+
" for k, v in raw['instrument'].items()\n",
|
|
69
|
+
"})"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"cell_type": "markdown",
|
|
74
|
+
"id": "5",
|
|
75
|
+
"metadata": {},
|
|
76
|
+
"source": [
|
|
77
|
+
"Display 2D view:"
|
|
78
|
+
]
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"cell_type": "code",
|
|
82
|
+
"execution_count": null,
|
|
83
|
+
"id": "6",
|
|
84
|
+
"metadata": {},
|
|
85
|
+
"outputs": [],
|
|
86
|
+
"source": [
|
|
87
|
+
"FlatVoxelViewer(dg)"
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"metadata": {
|
|
92
|
+
"kernelspec": {
|
|
93
|
+
"display_name": "Python 3 (ipykernel)",
|
|
94
|
+
"language": "python",
|
|
95
|
+
"name": "python3"
|
|
96
|
+
},
|
|
97
|
+
"language_info": {
|
|
98
|
+
"codemirror_mode": {
|
|
99
|
+
"name": "ipython",
|
|
100
|
+
"version": 3
|
|
101
|
+
},
|
|
102
|
+
"file_extension": ".py",
|
|
103
|
+
"mimetype": "text/x-python",
|
|
104
|
+
"name": "python",
|
|
105
|
+
"nbconvert_exporter": "python",
|
|
106
|
+
"pygments_lexer": "ipython3",
|
|
107
|
+
"version": "3.10.15"
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"nbformat": 4,
|
|
111
|
+
"nbformat_minor": 5
|
|
112
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cells": [
|
|
3
|
+
{
|
|
4
|
+
"cell_type": "markdown",
|
|
5
|
+
"id": "0",
|
|
6
|
+
"metadata": {},
|
|
7
|
+
"source": [
|
|
8
|
+
"# Workflow widgets example\n",
|
|
9
|
+
"\n",
|
|
10
|
+
"This notebook illustrates how we can use ESSreduce’s [workflow widgets](https://scipp.github.io/essreduce/user-guide/widget.html) to generate a graphical interface for running the LoKI tutorial workflow.\n",
|
|
11
|
+
"\n",
|
|
12
|
+
"## Initializing the GUI\n",
|
|
13
|
+
"\n",
|
|
14
|
+
"It is as simple as importing the dream submodule and generating a GUI using `workflow_widget` (the workflow automatically registers itself to a library of workflows when imported)."
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"cell_type": "code",
|
|
19
|
+
"execution_count": null,
|
|
20
|
+
"id": "1",
|
|
21
|
+
"metadata": {},
|
|
22
|
+
"outputs": [],
|
|
23
|
+
"source": [
|
|
24
|
+
"# Import dream submodule to register workflow\n",
|
|
25
|
+
"from ess import dream\n",
|
|
26
|
+
"from ess.reduce import ui\n",
|
|
27
|
+
"\n",
|
|
28
|
+
"# Prepare a container for accessing the results computed by the GUI\n",
|
|
29
|
+
"results = {}\n",
|
|
30
|
+
"\n",
|
|
31
|
+
"# Initialize the GUI widget\n",
|
|
32
|
+
"widget = ui.workflow_widget(result_registry=results)\n",
|
|
33
|
+
"widget"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"cell_type": "code",
|
|
38
|
+
"execution_count": null,
|
|
39
|
+
"id": "2",
|
|
40
|
+
"metadata": {
|
|
41
|
+
"editable": true,
|
|
42
|
+
"slideshow": {
|
|
43
|
+
"slide_type": ""
|
|
44
|
+
},
|
|
45
|
+
"tags": []
|
|
46
|
+
},
|
|
47
|
+
"outputs": [],
|
|
48
|
+
"source": [
|
|
49
|
+
"from ess.powder.types import DspacingBins, Filename, SampleRun, VanadiumRun\n",
|
|
50
|
+
"import ess.dream.data # noqa: F401\n",
|
|
51
|
+
"\n",
|
|
52
|
+
"select = widget.children[0].children[0]\n",
|
|
53
|
+
"keys, values = zip(*select.options, strict=True)\n",
|
|
54
|
+
"ind = keys.index(\"DreamGeant4ProtonChargeWorkflow\")\n",
|
|
55
|
+
"select.value = values[ind]\n",
|
|
56
|
+
"# Select IofDspacing output\n",
|
|
57
|
+
"wfw = widget.children[1].children[0]\n",
|
|
58
|
+
"outputs = wfw.output_selection_box.typical_outputs_widget\n",
|
|
59
|
+
"keys, values = zip(*outputs.options, strict=True)\n",
|
|
60
|
+
"ind = keys.index(\"IofTof\")\n",
|
|
61
|
+
"outputs.value = (values[ind],)\n",
|
|
62
|
+
"# Refresh parameters\n",
|
|
63
|
+
"pbox = wfw.parameter_box\n",
|
|
64
|
+
"pbox.parameter_refresh_button.click()\n",
|
|
65
|
+
"# Set parameters\n",
|
|
66
|
+
"pbox._input_widgets[Filename[SampleRun]].children[0].value = dream.data.simulated_diamond_sample()\n",
|
|
67
|
+
"pbox._input_widgets[Filename[VanadiumRun]].children[0].value = dream.data.simulated_vanadium_sample()\n",
|
|
68
|
+
"pbox._input_widgets[DspacingBins].children[0].fields[\"stop\"].value = 2.3434\n",
|
|
69
|
+
"# Run the workflow\n",
|
|
70
|
+
"rbox = wfw.result_box\n",
|
|
71
|
+
"rbox.run_button.click()"
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"cell_type": "markdown",
|
|
76
|
+
"id": "3",
|
|
77
|
+
"metadata": {
|
|
78
|
+
"editable": true,
|
|
79
|
+
"slideshow": {
|
|
80
|
+
"slide_type": ""
|
|
81
|
+
},
|
|
82
|
+
"tags": []
|
|
83
|
+
},
|
|
84
|
+
"source": [
|
|
85
|
+
"## Accessing the results\n",
|
|
86
|
+
"\n",
|
|
87
|
+
"We can now access the computed result in the `results` dictionary:"
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"cell_type": "code",
|
|
92
|
+
"execution_count": null,
|
|
93
|
+
"id": "4",
|
|
94
|
+
"metadata": {},
|
|
95
|
+
"outputs": [],
|
|
96
|
+
"source": [
|
|
97
|
+
"results"
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"cell_type": "markdown",
|
|
102
|
+
"id": "5",
|
|
103
|
+
"metadata": {},
|
|
104
|
+
"source": [
|
|
105
|
+
"The result can be plotted using"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"cell_type": "code",
|
|
110
|
+
"execution_count": null,
|
|
111
|
+
"id": "6",
|
|
112
|
+
"metadata": {},
|
|
113
|
+
"outputs": [],
|
|
114
|
+
"source": [
|
|
115
|
+
"(da,) = results.values()\n",
|
|
116
|
+
"da.hist(tof=200).plot()"
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
"metadata": {
|
|
121
|
+
"kernelspec": {
|
|
122
|
+
"display_name": "Python 3 (ipykernel)",
|
|
123
|
+
"language": "python",
|
|
124
|
+
"name": "python3"
|
|
125
|
+
},
|
|
126
|
+
"language_info": {
|
|
127
|
+
"codemirror_mode": {
|
|
128
|
+
"name": "ipython",
|
|
129
|
+
"version": 3
|
|
130
|
+
},
|
|
131
|
+
"file_extension": ".py",
|
|
132
|
+
"mimetype": "text/x-python",
|
|
133
|
+
"name": "python",
|
|
134
|
+
"nbconvert_exporter": "python",
|
|
135
|
+
"pygments_lexer": "ipython3"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"nbformat": 4,
|
|
139
|
+
"nbformat_minor": 5
|
|
140
|
+
}
|
|
@@ -31,14 +31,14 @@ requires-python = ">=3.10"
|
|
|
31
31
|
# Make sure to list one dependency per line.
|
|
32
32
|
dependencies = [
|
|
33
33
|
"dask",
|
|
34
|
-
"essreduce>=24.
|
|
34
|
+
"essreduce>=24.11.3",
|
|
35
35
|
"graphviz",
|
|
36
36
|
"numpy",
|
|
37
37
|
"plopp",
|
|
38
38
|
"pythreejs",
|
|
39
39
|
"sciline>=24.06.0",
|
|
40
40
|
"scipp>=24.09.1",
|
|
41
|
-
"scippneutron>=24.
|
|
41
|
+
"scippneutron>=24.11.0",
|
|
42
42
|
"scippnexus>=23.12.0",
|
|
43
43
|
]
|
|
44
44
|
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
# --- END OF CUSTOM SECTION ---
|
|
4
4
|
# The following was generated by 'tox -e deps', DO NOT EDIT MANUALLY!
|
|
5
5
|
dask
|
|
6
|
-
essreduce>=24.
|
|
6
|
+
essreduce>=24.11.3
|
|
7
7
|
graphviz
|
|
8
8
|
numpy
|
|
9
9
|
plopp
|
|
10
10
|
pythreejs
|
|
11
11
|
sciline>=24.06.0
|
|
12
12
|
scipp>=24.09.1
|
|
13
|
-
scippneutron>=24.
|
|
13
|
+
scippneutron>=24.11.0
|
|
14
14
|
scippnexus>=23.12.0
|