essdiffraction 25.2.0__tar.gz → 25.2.1__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-25.2.0 → essdiffraction-25.2.1}/.copier-answers.yml +1 -1
- {essdiffraction-25.2.0/src/essdiffraction.egg-info → essdiffraction-25.2.1}/PKG-INFO +4 -3
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/api-reference/index.md +1 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/user-guide/dream/dream-data-reduction.ipynb +26 -50
- essdiffraction-25.2.1/docs/user-guide/dream/dream-visualize-absorption.ipynb +225 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/user-guide/dream/index.md +1 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/user-guide/dream/workflow-widget-dream.ipynb +3 -3
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/user-guide/sns-instruments/POWGEN_data_reduction.ipynb +3 -4
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/pyproject.toml +3 -2
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/base.in +3 -2
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/base.txt +32 -13
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/basetest.txt +1 -5
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/ci.txt +0 -6
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/dev.txt +1 -7
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/docs.txt +4 -7
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/nightly.in +1 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/nightly.txt +11 -15
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/wheels.txt +0 -2
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/dream/__init__.py +2 -0
- essdiffraction-25.2.1/src/ess/dream/beamline.py +256 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/dream/data.py +16 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/dream/io/cif.py +23 -6
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/dream/io/geant4.py +105 -11
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/dream/parameters.py +4 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/dream/workflow.py +20 -2
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/powder/conversion.py +101 -5
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/powder/correction.py +3 -3
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/powder/filtering.py +2 -2
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/powder/types.py +47 -2
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/snspowder/powgen/data.py +4 -4
- {essdiffraction-25.2.0 → essdiffraction-25.2.1/src/essdiffraction.egg-info}/PKG-INFO +4 -3
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/essdiffraction.egg-info/SOURCES.txt +4 -1
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/essdiffraction.egg-info/requires.txt +3 -2
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/tests/dream/geant4_reduction_test.py +41 -18
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/tests/dream/io/cif_test.py +24 -4
- essdiffraction-25.2.1/tools/dream-make-tof-lookup-table.ipynb +147 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/tox.ini +1 -1
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/.copier-answers.ess.yml +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/.github/ISSUE_TEMPLATE/blank.md +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/.github/ISSUE_TEMPLATE/high-level-requirement.yml +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/.github/dependabot.yml +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/.github/workflows/ci.yml +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/.github/workflows/docs.yml +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/.github/workflows/nightly_at_main.yml +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/.github/workflows/nightly_at_release.yml +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/.github/workflows/python-version-ci +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/.github/workflows/release.yml +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/.github/workflows/test.yml +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/.github/workflows/unpinned.yml +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/.github/workflows/weekly_windows_macos.yml +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/.gitignore +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/.pre-commit-config.yaml +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/.python-version +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/CODE_OF_CONDUCT.md +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/CONTRIBUTING.md +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/LICENSE +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/MANIFEST.in +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/README.md +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/conda/meta.yaml +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/_static/anaconda-icon.js +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/_static/favicon.svg +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/_static/logo-dark.svg +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/_static/logo.svg +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/_templates/class-template.rst +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/_templates/doc_version.html +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/_templates/module-template.rst +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/about/bibliography.rst +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/about/index.md +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/bibliography.bib +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/conf.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/developer/coding-conventions.md +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/developer/dependency-management.md +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/developer/getting-started.md +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/developer/index.md +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/index.md +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/user-guide/dream/dream-detector-diagnostics.ipynb +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/user-guide/dream/dream-instrument-view.ipynb +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/user-guide/index.md +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/user-guide/sns-instruments/index.md +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/user-guide/sns-instruments/preprocess_files.ipynb +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/user-guide/sns-instruments/vanadium_processing.ipynb +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/basetest.in +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/ci.in +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/dev.in +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/docs.in +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/make_base.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/mypy.in +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/mypy.txt +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/static.in +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/static.txt +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/test.in +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/test.txt +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/requirements/wheels.in +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/resources/logo.svg +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/setup.cfg +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/diffraction/__init__.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/diffraction/py.typed +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/dream/diagnostics.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/dream/instrument_view.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/dream/io/__init__.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/dream/io/nexus.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/dream/py.typed +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/powder/__init__.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/powder/_util.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/powder/calibration.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/powder/grouping.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/powder/logging.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/powder/masking.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/powder/py.typed +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/powder/smoothing.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/powder/transform.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/snspowder/powgen/__init__.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/snspowder/powgen/beamline.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/snspowder/powgen/calibration.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/snspowder/powgen/instrument_view.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/snspowder/powgen/peaks.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/ess/snspowder/powgen/workflow.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/essdiffraction.egg-info/dependency_links.txt +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/src/essdiffraction.egg-info/top_level.txt +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/tests/dream/diagnostics_test.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/tests/dream/instrument_view_test.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/tests/dream/io/geant4_test.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/tests/dream/io/nexus_test.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/tests/package_test.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/tests/powder/conversion_test.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/tests/powder/correction_test.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/tests/powder/filtering_test.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/tests/powder/transform_test.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/tests/snspowder/powgen/load_test.py +0 -0
- {essdiffraction-25.2.0 → essdiffraction-25.2.1}/tests/snspowder/powgen/powgen_reduction_test.py +0 -0
|
@@ -5,7 +5,7 @@ description: Diffraction data reduction for the European Spallation Source
|
|
|
5
5
|
max_python: '3.13'
|
|
6
6
|
min_python: '3.10'
|
|
7
7
|
namespace_package: ess
|
|
8
|
-
nightly_deps: scipp,scippnexus,sciline,plopp,scippneutron,essreduce
|
|
8
|
+
nightly_deps: scipp,scippnexus,sciline,plopp,scippneutron,essreduce,tof
|
|
9
9
|
orgname: scipp
|
|
10
10
|
prettyname: ESSdiffraction
|
|
11
11
|
projectname: essdiffraction
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: essdiffraction
|
|
3
|
-
Version: 25.2.
|
|
3
|
+
Version: 25.2.1
|
|
4
4
|
Summary: Diffraction data reduction for the European Spallation Source
|
|
5
5
|
Author: Scipp contributors
|
|
6
6
|
License: BSD 3-Clause License
|
|
@@ -52,15 +52,16 @@ Requires-Python: >=3.10
|
|
|
52
52
|
Description-Content-Type: text/markdown
|
|
53
53
|
License-File: LICENSE
|
|
54
54
|
Requires-Dist: dask
|
|
55
|
-
Requires-Dist: essreduce>=
|
|
55
|
+
Requires-Dist: essreduce>=25.02.4
|
|
56
56
|
Requires-Dist: graphviz
|
|
57
57
|
Requires-Dist: numpy
|
|
58
58
|
Requires-Dist: plopp
|
|
59
59
|
Requires-Dist: pythreejs
|
|
60
60
|
Requires-Dist: sciline>=24.06.0
|
|
61
61
|
Requires-Dist: scipp>=24.09.1
|
|
62
|
-
Requires-Dist: scippneutron>=
|
|
62
|
+
Requires-Dist: scippneutron>=25.02.0
|
|
63
63
|
Requires-Dist: scippnexus>=23.12.0
|
|
64
|
+
Requires-Dist: tof>=25.01.2
|
|
64
65
|
Provides-Extra: test
|
|
65
66
|
Requires-Dist: pandas; extra == "test"
|
|
66
67
|
Requires-Dist: pooch; extra == "test"
|
{essdiffraction-25.2.0 → essdiffraction-25.2.1}/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
|
-
"\n",
|
|
24
23
|
"from ess import dream, powder\n",
|
|
25
24
|
"import ess.dream.data # noqa: F401\n",
|
|
26
25
|
"from ess.powder.types import *"
|
|
@@ -71,14 +70,14 @@
|
|
|
71
70
|
"workflow[UncertaintyBroadcastMode] = UncertaintyBroadcastMode.drop\n",
|
|
72
71
|
"# Edges for binning in d-spacing\n",
|
|
73
72
|
"workflow[DspacingBins] = sc.linspace(\"dspacing\", 0.0, 2.3434, 201, unit=\"angstrom\")\n",
|
|
74
|
-
"#
|
|
75
|
-
"workflow[TofMask] =
|
|
76
|
-
" x > sc.scalar(86e6, unit=\"ns\")\n",
|
|
77
|
-
")\n",
|
|
73
|
+
"# Empty masks by default\n",
|
|
74
|
+
"workflow[TofMask] = None\n",
|
|
78
75
|
"workflow[TwoThetaMask] = None\n",
|
|
79
76
|
"workflow[WavelengthMask] = None\n",
|
|
80
77
|
"# No pixel masks\n",
|
|
81
|
-
"workflow = powder.with_pixel_mask_filenames(workflow, [])"
|
|
78
|
+
"workflow = powder.with_pixel_mask_filenames(workflow, [])\n",
|
|
79
|
+
"# Time-of-flight lookup table\n",
|
|
80
|
+
"workflow[TimeOfFlightLookupTableFilename] = dream.data.tof_lookup_table_high_flux()"
|
|
82
81
|
]
|
|
83
82
|
},
|
|
84
83
|
{
|
|
@@ -86,7 +85,7 @@
|
|
|
86
85
|
"id": "6",
|
|
87
86
|
"metadata": {},
|
|
88
87
|
"source": [
|
|
89
|
-
"## Use the workflow\n",
|
|
88
|
+
"## Use the reduction workflow\n",
|
|
90
89
|
"\n",
|
|
91
90
|
"We can visualize the graph for computing the final normalized result for intensity as a function of time-of-flight:"
|
|
92
91
|
]
|
|
@@ -152,7 +151,7 @@
|
|
|
152
151
|
"in the documentation of ESSdiffraction.\n",
|
|
153
152
|
"See https://scipp.github.io/essdiffraction/\n",
|
|
154
153
|
"\"\"\"\n",
|
|
155
|
-
"cif_data.save(
|
|
154
|
+
"cif_data.save(\"reduced.cif\")"
|
|
156
155
|
]
|
|
157
156
|
},
|
|
158
157
|
{
|
|
@@ -192,9 +191,9 @@
|
|
|
192
191
|
"outputs": [],
|
|
193
192
|
"source": [
|
|
194
193
|
"two_theta = sc.linspace(\"two_theta\", 0.8, 2.4, 301, unit=\"rad\")\n",
|
|
195
|
-
"intermediates[MaskedData[SampleRun]].hist(
|
|
196
|
-
"
|
|
197
|
-
")"
|
|
194
|
+
"intermediates[MaskedData[SampleRun]].hist(\n",
|
|
195
|
+
" two_theta=two_theta, wavelength=300\n",
|
|
196
|
+
").plot(norm=\"log\")"
|
|
198
197
|
]
|
|
199
198
|
},
|
|
200
199
|
{
|
|
@@ -216,7 +215,7 @@
|
|
|
216
215
|
"outputs": [],
|
|
217
216
|
"source": [
|
|
218
217
|
"workflow[TwoThetaBins] = sc.linspace(\n",
|
|
219
|
-
" dim=\"two_theta\", unit=\"rad\", start=0.8, stop=2.4, num=
|
|
218
|
+
" dim=\"two_theta\", unit=\"rad\", start=0.8, stop=2.4, num=201\n",
|
|
220
219
|
")"
|
|
221
220
|
]
|
|
222
221
|
},
|
|
@@ -237,31 +236,13 @@
|
|
|
237
236
|
"id": "19",
|
|
238
237
|
"metadata": {},
|
|
239
238
|
"outputs": [],
|
|
240
|
-
"source": [
|
|
241
|
-
"angle = sc.midpoints(grouped_dspacing.coords[\"two_theta\"])\n",
|
|
242
|
-
"sc.plot(\n",
|
|
243
|
-
" {\n",
|
|
244
|
-
" f\"{angle[group].value:.3f} {angle[group].unit}\": grouped_dspacing[\n",
|
|
245
|
-
" \"two_theta\", group\n",
|
|
246
|
-
" ].hist()\n",
|
|
247
|
-
" for group in range(2, 6)\n",
|
|
248
|
-
" }\n",
|
|
249
|
-
")"
|
|
250
|
-
]
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
"cell_type": "code",
|
|
254
|
-
"execution_count": null,
|
|
255
|
-
"id": "20",
|
|
256
|
-
"metadata": {},
|
|
257
|
-
"outputs": [],
|
|
258
239
|
"source": [
|
|
259
240
|
"grouped_dspacing.hist().plot(norm=\"log\")"
|
|
260
241
|
]
|
|
261
242
|
},
|
|
262
243
|
{
|
|
263
244
|
"cell_type": "markdown",
|
|
264
|
-
"id": "
|
|
245
|
+
"id": "20",
|
|
265
246
|
"metadata": {},
|
|
266
247
|
"source": [
|
|
267
248
|
"## Normalizing by monitor\n",
|
|
@@ -283,7 +264,7 @@
|
|
|
283
264
|
{
|
|
284
265
|
"cell_type": "code",
|
|
285
266
|
"execution_count": null,
|
|
286
|
-
"id": "
|
|
267
|
+
"id": "21",
|
|
287
268
|
"metadata": {},
|
|
288
269
|
"outputs": [],
|
|
289
270
|
"source": [
|
|
@@ -292,7 +273,7 @@
|
|
|
292
273
|
},
|
|
293
274
|
{
|
|
294
275
|
"cell_type": "markdown",
|
|
295
|
-
"id": "
|
|
276
|
+
"id": "22",
|
|
296
277
|
"metadata": {},
|
|
297
278
|
"source": [
|
|
298
279
|
"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:"
|
|
@@ -301,14 +282,14 @@
|
|
|
301
282
|
{
|
|
302
283
|
"cell_type": "code",
|
|
303
284
|
"execution_count": null,
|
|
304
|
-
"id": "
|
|
285
|
+
"id": "23",
|
|
305
286
|
"metadata": {},
|
|
306
287
|
"outputs": [],
|
|
307
288
|
"source": [
|
|
308
289
|
"workflow[MonitorFilename[SampleRun]] = dream.data.simulated_monitor_diamond_sample()\n",
|
|
309
290
|
"workflow[MonitorFilename[VanadiumRun]] = dream.data.simulated_monitor_vanadium_sample()\n",
|
|
310
291
|
"workflow[MonitorFilename[BackgroundRun]] = dream.data.simulated_monitor_empty_can()\n",
|
|
311
|
-
"workflow[CaveMonitorPosition] = sc.vector([0.0, 0.0, -4220.0], unit
|
|
292
|
+
"workflow[CaveMonitorPosition] = sc.vector([0.0, 0.0, -4220.0], unit=\"mm\")\n",
|
|
312
293
|
"\n",
|
|
313
294
|
"# These are the same as at the top of the notebook:\n",
|
|
314
295
|
"workflow[Filename[SampleRun]] = dream.data.simulated_diamond_sample()\n",
|
|
@@ -318,18 +299,17 @@
|
|
|
318
299
|
"workflow[NeXusDetectorName] = \"mantle\"\n",
|
|
319
300
|
"workflow[UncertaintyBroadcastMode] = UncertaintyBroadcastMode.drop\n",
|
|
320
301
|
"workflow[DspacingBins] = sc.linspace(\"dspacing\", 0.0, 2.3434, 201, unit=\"angstrom\")\n",
|
|
321
|
-
"workflow[TofMask] =
|
|
322
|
-
" x > sc.scalar(86e6, unit=\"ns\")\n",
|
|
323
|
-
")\n",
|
|
302
|
+
"workflow[TofMask] = None\n",
|
|
324
303
|
"workflow[TwoThetaMask] = None\n",
|
|
325
304
|
"workflow[WavelengthMask] = None\n",
|
|
326
|
-
"workflow = powder.with_pixel_mask_filenames(workflow, [])"
|
|
305
|
+
"workflow = powder.with_pixel_mask_filenames(workflow, [])\n",
|
|
306
|
+
"workflow[TimeOfFlightLookupTableFilename] = dream.data.tof_lookup_table_high_flux()"
|
|
327
307
|
]
|
|
328
308
|
},
|
|
329
309
|
{
|
|
330
310
|
"cell_type": "code",
|
|
331
311
|
"execution_count": null,
|
|
332
|
-
"id": "
|
|
312
|
+
"id": "24",
|
|
333
313
|
"metadata": {},
|
|
334
314
|
"outputs": [],
|
|
335
315
|
"source": [
|
|
@@ -339,7 +319,7 @@
|
|
|
339
319
|
{
|
|
340
320
|
"cell_type": "code",
|
|
341
321
|
"execution_count": null,
|
|
342
|
-
"id": "
|
|
322
|
+
"id": "25",
|
|
343
323
|
"metadata": {},
|
|
344
324
|
"outputs": [],
|
|
345
325
|
"source": [
|
|
@@ -352,7 +332,7 @@
|
|
|
352
332
|
{
|
|
353
333
|
"cell_type": "code",
|
|
354
334
|
"execution_count": null,
|
|
355
|
-
"id": "
|
|
335
|
+
"id": "26",
|
|
356
336
|
"metadata": {},
|
|
357
337
|
"outputs": [],
|
|
358
338
|
"source": [
|
|
@@ -361,7 +341,7 @@
|
|
|
361
341
|
},
|
|
362
342
|
{
|
|
363
343
|
"cell_type": "markdown",
|
|
364
|
-
"id": "
|
|
344
|
+
"id": "27",
|
|
365
345
|
"metadata": {},
|
|
366
346
|
"source": [
|
|
367
347
|
"Comparing the final, normalized result shows that it agrees with the data that was normalized by proton-charge:"
|
|
@@ -370,14 +350,11 @@
|
|
|
370
350
|
{
|
|
371
351
|
"cell_type": "code",
|
|
372
352
|
"execution_count": null,
|
|
373
|
-
"id": "
|
|
353
|
+
"id": "28",
|
|
374
354
|
"metadata": {},
|
|
375
355
|
"outputs": [],
|
|
376
356
|
"source": [
|
|
377
|
-
"sc.plot({\
|
|
378
|
-
" 'By proton charge': histogram,\n",
|
|
379
|
-
" 'By monitor': normalized_by_monitor.hist()\n",
|
|
380
|
-
"})"
|
|
357
|
+
"sc.plot({\"By proton charge\": histogram, \"By monitor\": normalized_by_monitor.hist()})"
|
|
381
358
|
]
|
|
382
359
|
}
|
|
383
360
|
],
|
|
@@ -396,8 +373,7 @@
|
|
|
396
373
|
"mimetype": "text/x-python",
|
|
397
374
|
"name": "python",
|
|
398
375
|
"nbconvert_exporter": "python",
|
|
399
|
-
"pygments_lexer": "ipython3"
|
|
400
|
-
"version": "3.10.14"
|
|
376
|
+
"pygments_lexer": "ipython3"
|
|
401
377
|
}
|
|
402
378
|
},
|
|
403
379
|
"nbformat": 4,
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cells": [
|
|
3
|
+
{
|
|
4
|
+
"cell_type": "markdown",
|
|
5
|
+
"id": "0",
|
|
6
|
+
"metadata": {},
|
|
7
|
+
"source": [
|
|
8
|
+
"# Visualize effect of absorption\n",
|
|
9
|
+
"\n",
|
|
10
|
+
"This notebook is an example of how to use the `compute_transmission_map` function to visualize the effect of (sample) absorption on the intensity in the detector.\n",
|
|
11
|
+
"\n",
|
|
12
|
+
"Note that the `compute_transmission_map` function only accounts for the effect of absorption. The measured intensity in the detector can also be impacted by other effects, such as the effect of the solid angle being different for different detector pixels.\n",
|
|
13
|
+
"\n",
|
|
14
|
+
"For more details, see https://scipp.github.io/scippneutron/user-guide/absorption-correction.html."
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"cell_type": "code",
|
|
19
|
+
"execution_count": null,
|
|
20
|
+
"id": "1",
|
|
21
|
+
"metadata": {},
|
|
22
|
+
"outputs": [],
|
|
23
|
+
"source": [
|
|
24
|
+
"import scipp as sc\n",
|
|
25
|
+
"\n",
|
|
26
|
+
"from ess import dream\n",
|
|
27
|
+
"import ess.dream.data # noqa: F401\n",
|
|
28
|
+
"\n",
|
|
29
|
+
"from scippneutron.absorption import compute_transmission_map\n",
|
|
30
|
+
"from scippneutron.absorption.cylinder import Cylinder\n",
|
|
31
|
+
"from scippneutron.absorption.material import Material\n",
|
|
32
|
+
"from scippneutron.atoms import ScatteringParams"
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"cell_type": "markdown",
|
|
37
|
+
"id": "2",
|
|
38
|
+
"metadata": {},
|
|
39
|
+
"source": [
|
|
40
|
+
"## Load the data\n",
|
|
41
|
+
"\n",
|
|
42
|
+
"We load a dataset from a Geant4 simulation only to get access to the detector geometry."
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"cell_type": "code",
|
|
47
|
+
"execution_count": null,
|
|
48
|
+
"id": "3",
|
|
49
|
+
"metadata": {},
|
|
50
|
+
"outputs": [],
|
|
51
|
+
"source": [
|
|
52
|
+
"dg = dream.io.load_geant4_csv(dream.data.get_path(\"data_dream0_new_hkl_Si_pwd.csv.zip\"))[\"instrument\"]\n",
|
|
53
|
+
"dg = sc.DataGroup({key: detector[\"events\"][\"counter\", 0] for key, detector in dg.items()})\n",
|
|
54
|
+
"dg.keys()"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"cell_type": "markdown",
|
|
59
|
+
"id": "4",
|
|
60
|
+
"metadata": {},
|
|
61
|
+
"source": [
|
|
62
|
+
"## Inhomogeneity from absorption in mantle detector\n",
|
|
63
|
+
"\n",
|
|
64
|
+
"If the sample absorbs or scatters a large fraction of the incoming neutrons, the intensity in the detector will vary even if the scattering is inhomogeneous.\n"
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"cell_type": "markdown",
|
|
69
|
+
"id": "5",
|
|
70
|
+
"metadata": {},
|
|
71
|
+
"source": [
|
|
72
|
+
"### Rod-like sample oriented along x-axis"
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"cell_type": "code",
|
|
77
|
+
"execution_count": null,
|
|
78
|
+
"id": "6",
|
|
79
|
+
"metadata": {},
|
|
80
|
+
"outputs": [],
|
|
81
|
+
"source": [
|
|
82
|
+
"# The material determines the rate of absorption and scattering\n",
|
|
83
|
+
"vanadium = Material(\n",
|
|
84
|
+
" scattering_params=ScatteringParams.for_isotope('V'),\n",
|
|
85
|
+
" effective_sample_number_density=sc.scalar(0.07192, unit='1/angstrom**3')\n",
|
|
86
|
+
")\n",
|
|
87
|
+
"# The shape determines the shape and the orientation of the sample\n",
|
|
88
|
+
"rod_shape = Cylinder(\n",
|
|
89
|
+
" radius=sc.scalar(1, unit='cm'),\n",
|
|
90
|
+
" height=(height := sc.scalar(5., unit='cm')),\n",
|
|
91
|
+
" # Cylinder is oriented along the x-axis\n",
|
|
92
|
+
" symmetry_line=(symmetry_line := sc.vector([1, 0, 0])),\n",
|
|
93
|
+
" center_of_base=-height * symmetry_line / 2,\n",
|
|
94
|
+
")"
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"cell_type": "code",
|
|
99
|
+
"execution_count": null,
|
|
100
|
+
"id": "7",
|
|
101
|
+
"metadata": {},
|
|
102
|
+
"outputs": [],
|
|
103
|
+
"source": [
|
|
104
|
+
"transmission_fraction_mantle = compute_transmission_map(\n",
|
|
105
|
+
" rod_shape,\n",
|
|
106
|
+
" vanadium,\n",
|
|
107
|
+
" beam_direction=sc.vector([0, 0, 1]),\n",
|
|
108
|
+
" wavelength=sc.linspace('wavelength', 4, 8, 20, unit='angstrom'),\n",
|
|
109
|
+
" # To make it faster, don't compute the transmission fraction for every detector pixel, it's not necessary for the visualization.\n",
|
|
110
|
+
" detector_position=dg['mantle'].coords['position']['strip', ::4]['wire', ::2].copy(),\n",
|
|
111
|
+
" quadrature_kind='cheap',\n",
|
|
112
|
+
")\n",
|
|
113
|
+
"\n",
|
|
114
|
+
"# The visualization expects the `position` coord to denote detector positions, and `wavelength` to be the last dimension.\n",
|
|
115
|
+
"transmission_fraction_mantle.coords['position'] = transmission_fraction_mantle.coords.pop('detector_position')\n",
|
|
116
|
+
"dream.instrument_view(transmission_fraction_mantle, dim='wavelength', pixel_size=20.0)"
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"cell_type": "code",
|
|
121
|
+
"execution_count": null,
|
|
122
|
+
"id": "8",
|
|
123
|
+
"metadata": {},
|
|
124
|
+
"outputs": [],
|
|
125
|
+
"source": [
|
|
126
|
+
"transmission_fraction_mantle"
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"cell_type": "markdown",
|
|
131
|
+
"id": "9",
|
|
132
|
+
"metadata": {},
|
|
133
|
+
"source": [
|
|
134
|
+
"## Disk-like sample oriented along x-axis"
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"cell_type": "code",
|
|
139
|
+
"execution_count": null,
|
|
140
|
+
"id": "10",
|
|
141
|
+
"metadata": {},
|
|
142
|
+
"outputs": [],
|
|
143
|
+
"source": [
|
|
144
|
+
"disk_shape = Cylinder(\n",
|
|
145
|
+
" radius=sc.scalar(5, unit='cm'),\n",
|
|
146
|
+
" height=(height := sc.scalar(1., unit='cm')),\n",
|
|
147
|
+
" # Cylinder is oriented along the x-axis\n",
|
|
148
|
+
" symmetry_line=(symmetry_line := sc.vector([1, 0, 0])),\n",
|
|
149
|
+
" center_of_base=-height * symmetry_line / 2,\n",
|
|
150
|
+
")\n",
|
|
151
|
+
"\n",
|
|
152
|
+
"transmission_fraction_mantle = compute_transmission_map(\n",
|
|
153
|
+
" disk_shape,\n",
|
|
154
|
+
" vanadium,\n",
|
|
155
|
+
" beam_direction=sc.vector([0, 0, 1]),\n",
|
|
156
|
+
" wavelength=sc.linspace('wavelength', 4, 8, 20, unit='angstrom'),\n",
|
|
157
|
+
" # To make it faster, don't compute the transmission fraction for every detector pixel, it's not necessary for the visualization.\n",
|
|
158
|
+
" detector_position=dg['mantle'].coords['position']['strip', ::4]['wire', ::2].copy(),\n",
|
|
159
|
+
" quadrature_kind='cheap',\n",
|
|
160
|
+
")\n",
|
|
161
|
+
"\n",
|
|
162
|
+
"# The visualization expects the `position` coord to denote detector positions, and `wavelength` to be the last dimension.\n",
|
|
163
|
+
"transmission_fraction_mantle.coords['position'] = transmission_fraction_mantle.coords.pop('detector_position')\n",
|
|
164
|
+
"dream.instrument_view(transmission_fraction_mantle, dim='wavelength', pixel_size=20.0)"
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"cell_type": "markdown",
|
|
169
|
+
"id": "11",
|
|
170
|
+
"metadata": {},
|
|
171
|
+
"source": [
|
|
172
|
+
"## Does absorption influence the intensity in the endcap detector?"
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"cell_type": "code",
|
|
177
|
+
"execution_count": null,
|
|
178
|
+
"id": "12",
|
|
179
|
+
"metadata": {},
|
|
180
|
+
"outputs": [],
|
|
181
|
+
"source": [
|
|
182
|
+
"transmission_fraction_endcap = compute_transmission_map(\n",
|
|
183
|
+
" rod_shape,\n",
|
|
184
|
+
" vanadium,\n",
|
|
185
|
+
" beam_direction=sc.vector([0, 0, 1]),\n",
|
|
186
|
+
" wavelength=sc.linspace('wavelength', 4, 8, 20, unit='angstrom'),\n",
|
|
187
|
+
" detector_position=dg['endcap_backward'].coords['position']['strip', 0].copy(),\n",
|
|
188
|
+
" quadrature_kind='cheap',\n",
|
|
189
|
+
")\n",
|
|
190
|
+
"\n",
|
|
191
|
+
"transmission_fraction_endcap.coords['position'] = transmission_fraction_endcap.coords.pop('detector_position')\n",
|
|
192
|
+
"dream.instrument_view(transmission_fraction_endcap, dim='wavelength', pixel_size=20.0)"
|
|
193
|
+
]
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"cell_type": "markdown",
|
|
197
|
+
"id": "13",
|
|
198
|
+
"metadata": {},
|
|
199
|
+
"source": [
|
|
200
|
+
"As expected the impact of absorption on on the intensity in the endcap detector is close to uniform."
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
],
|
|
204
|
+
"metadata": {
|
|
205
|
+
"kernelspec": {
|
|
206
|
+
"display_name": "Python 3 (ipykernel)",
|
|
207
|
+
"language": "python",
|
|
208
|
+
"name": "python3"
|
|
209
|
+
},
|
|
210
|
+
"language_info": {
|
|
211
|
+
"codemirror_mode": {
|
|
212
|
+
"name": "ipython",
|
|
213
|
+
"version": 3
|
|
214
|
+
},
|
|
215
|
+
"file_extension": ".py",
|
|
216
|
+
"mimetype": "text/x-python",
|
|
217
|
+
"name": "python",
|
|
218
|
+
"nbconvert_exporter": "python",
|
|
219
|
+
"pygments_lexer": "ipython3",
|
|
220
|
+
"version": "3.10.14"
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"nbformat": 4,
|
|
224
|
+
"nbformat_minor": 5
|
|
225
|
+
}
|
{essdiffraction-25.2.0 → essdiffraction-25.2.1}/docs/user-guide/dream/workflow-widget-dream.ipynb
RENAMED
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"outputs": [],
|
|
49
49
|
"source": [
|
|
50
|
-
"from ess.powder.types import DspacingBins, Filename, SampleRun, VanadiumRun\n",
|
|
50
|
+
"from ess.powder.types import DspacingBins, Filename, SampleRun, TimeOfFlightLookupTableFilename, VanadiumRun\n",
|
|
51
51
|
"import ess.dream.data # noqa: F401\n",
|
|
52
52
|
"\n",
|
|
53
53
|
"select = widget.children[0].children[0]\n",
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
"# Set parameters\n",
|
|
67
67
|
"pbox._input_widgets[Filename[SampleRun]].children[0].value = dream.data.simulated_diamond_sample()\n",
|
|
68
68
|
"pbox._input_widgets[Filename[VanadiumRun]].children[0].value = dream.data.simulated_vanadium_sample()\n",
|
|
69
|
+
"pbox._input_widgets[TimeOfFlightLookupTableFilename].children[0].value = dream.data.tof_lookup_table_high_flux()\n",
|
|
69
70
|
"pbox._input_widgets[DspacingBins].fields[\"stop\"].value = 2.3434\n",
|
|
70
71
|
"# Run the workflow\n",
|
|
71
72
|
"rbox = wfw.result_box\n",
|
|
@@ -133,8 +134,7 @@
|
|
|
133
134
|
"mimetype": "text/x-python",
|
|
134
135
|
"name": "python",
|
|
135
136
|
"nbconvert_exporter": "python",
|
|
136
|
-
"pygments_lexer": "ipython3"
|
|
137
|
-
"version": "3.10.14"
|
|
137
|
+
"pygments_lexer": "ipython3"
|
|
138
138
|
}
|
|
139
139
|
},
|
|
140
140
|
"nbformat": 4,
|
|
@@ -239,7 +239,7 @@
|
|
|
239
239
|
"source": [
|
|
240
240
|
"results = workflow.compute(\n",
|
|
241
241
|
" (\n",
|
|
242
|
-
"
|
|
242
|
+
" TofData[SampleRun],\n",
|
|
243
243
|
" MaskedData[SampleRun],\n",
|
|
244
244
|
" FilteredData[SampleRun],\n",
|
|
245
245
|
" FilteredData[VanadiumRun],\n",
|
|
@@ -254,7 +254,7 @@
|
|
|
254
254
|
"metadata": {},
|
|
255
255
|
"outputs": [],
|
|
256
256
|
"source": [
|
|
257
|
-
"results[
|
|
257
|
+
"results[TofData[SampleRun]]"
|
|
258
258
|
]
|
|
259
259
|
},
|
|
260
260
|
{
|
|
@@ -393,8 +393,7 @@
|
|
|
393
393
|
"mimetype": "text/x-python",
|
|
394
394
|
"name": "python",
|
|
395
395
|
"nbconvert_exporter": "python",
|
|
396
|
-
"pygments_lexer": "ipython3"
|
|
397
|
-
"version": "3.10.14"
|
|
396
|
+
"pygments_lexer": "ipython3"
|
|
398
397
|
}
|
|
399
398
|
},
|
|
400
399
|
"nbformat": 4,
|
|
@@ -32,15 +32,16 @@ requires-python = ">=3.10"
|
|
|
32
32
|
# Make sure to list one dependency per line.
|
|
33
33
|
dependencies = [
|
|
34
34
|
"dask",
|
|
35
|
-
"essreduce>=
|
|
35
|
+
"essreduce>=25.02.4",
|
|
36
36
|
"graphviz",
|
|
37
37
|
"numpy",
|
|
38
38
|
"plopp",
|
|
39
39
|
"pythreejs",
|
|
40
40
|
"sciline>=24.06.0",
|
|
41
41
|
"scipp>=24.09.1",
|
|
42
|
-
"scippneutron>=
|
|
42
|
+
"scippneutron>=25.02.0",
|
|
43
43
|
"scippnexus>=23.12.0",
|
|
44
|
+
"tof>=25.01.2",
|
|
44
45
|
]
|
|
45
46
|
|
|
46
47
|
dynamic = ["version"]
|
|
@@ -3,12 +3,13 @@
|
|
|
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>=
|
|
6
|
+
essreduce>=25.02.4
|
|
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>=
|
|
13
|
+
scippneutron>=25.02.0
|
|
14
14
|
scippnexus>=23.12.0
|
|
15
|
+
tof>=25.01.2
|