Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 7 additions & 15 deletions docs/user-guide/bifrost/bifrost-bragg-peak-monitor.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"workflow[LookupTableFilename] = lookup_table_simulation()\n",
"workflow[LookupTableRelativeErrorThreshold] = {\n",
" 'detector': np.inf,\n",
" '110_frame_3': np.inf,\n",
" 'normalization_monitor': np.inf,\n",
"}"
]
},
Expand All @@ -89,7 +89,7 @@
"metadata": {},
"outputs": [],
"source": [
"workflow[NeXusDetectorName] = \"309_channel_9_5_triplet\"\n",
"workflow[NeXusDetectorName] = \"channel_9_5_triplet\"\n",
"\n",
"\n",
"def assemble_detector_data_flatten(\n",
Expand Down Expand Up @@ -139,18 +139,10 @@
"workflow.visualize(CountsWithQMapCoords[SampleRun], graph_attr={\"rankdir\": \"LR\"})"
]
},
{
"cell_type": "markdown",
"id": "8",
"metadata": {},
"source": [
"Compute the data projected onto Q:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9",
"id": "8",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -159,7 +151,7 @@
},
{
"cell_type": "markdown",
"id": "10",
"id": "9",
"metadata": {},
"source": [
"Make an interactive figure.\n",
Expand All @@ -169,13 +161,13 @@
{
"cell_type": "code",
"execution_count": null,
"id": "11",
"id": "10",
"metadata": {},
"outputs": [],
"source": [
"make_q_map(counts,\n",
" q_parallel_bins=sc.linspace('Q_parallel', -3, 3, 100, unit='1/Å'),\n",
" q_perpendicular_bins=sc.linspace('Q_perpendicular', -3, 3, 100, unit='1/Å'),\n",
" q_parallel_bins=sc.linspace('Q_parallel', -4.5, 4.5, 100, unit='1/Å'),\n",
" q_perpendicular_bins=sc.linspace('Q_perpendicular', -4.5, 4.5, 100, unit='1/Å'),\n",
" sample_rotation_bins=sc.scalar(1.0, unit='deg'),\n",
" )"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"bifrost_workflow = BifrostSimulationWorkflow(detector_names)\n",
"bifrost_workflow[Filename[SampleRun]] = input_filename\n",
"\n",
"M = nexus.types.EmptyMonitor[SampleRun, FrameMonitor3]\n",
"M = nexus.types.EmptyMonitor[SampleRun, NormalizationMonitor]\n",
"C = RawChoppers[SampleRun]\n",
"SOURCE = Position[snx.NXsource, SampleRun]\n",
"SAMPLE = Position[snx.NXsample, SampleRun]\n",
Expand Down Expand Up @@ -128,6 +128,13 @@
" processed['phase'] = processed['phase'].data.mean()\n",
" # Guessing here as this is not stored in the file.\n",
" processed['beam_position'] = sc.scalar(0.0, unit='deg')\n",
"\n",
" # FIXME Get rid of this bad hack if/when McStas' DiskChopper is fixed\n",
" # Currently, it sets a delay-time by `delta = 2 * pi * phase/|frequency|`\n",
" # But it should set `delta = 2 * pi * phase / frequency`\n",
" # So phases reported here have the wrong sign if frequency < 0\n",
" processed['phase'] = -processed['phase'] if processed['rotation_speed'].value < 0 else processed['phase']\n",
"\n",
" return DiskChopper.from_nexus(processed)\n",
"\n",
"\n",
Expand Down Expand Up @@ -163,7 +170,7 @@
"workflow[SourcePosition] = source_position\n",
"\n",
"# Increase this number for more reliable results:\n",
"workflow[NumberOfSimulatedNeutrons] = 6000_000"
"workflow[NumberOfSimulatedNeutrons] = 6_000_000"
]
},
{
Expand Down
8 changes: 4 additions & 4 deletions docs/user-guide/bifrost/bifrost-reduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"# For this example, we do not mask anything:\n",
"workflow[LookupTableRelativeErrorThreshold] = {\n",
" 'detector': np.inf,\n",
" '110_frame_3': np.inf,\n",
" 'normalization_monitor': np.inf,\n",
"}\n",
"# We need to read many objects from the file,\n",
"# keeping it open improves performance: (optional)\n",
Expand Down Expand Up @@ -183,9 +183,9 @@
"outputs": [],
"source": [
"(\n",
" data['a4', 0]\n",
" data\n",
" .bins.concat()\n",
" .hist(energy_transfer=sc.linspace('energy_transfer', -0.05, 0.05, 200, unit='meV'))\n",
" .hist(energy_transfer=500)\n",
").plot()"
]
},
Expand All @@ -211,7 +211,7 @@
"metadata": {},
"outputs": [],
"source": [
"d = data['a4', 0].bins.concat().copy()\n",
"d = data.bins.concat().copy()\n",
"x = sc.vector([1, 0, 0])\n",
"z = sc.vector([0, 0, 1])\n",
"d.bins.coords['Qx'] = sc.dot(x, d.bins.coords['sample_table_momentum_transfer'])\n",
Expand Down
5 changes: 4 additions & 1 deletion docs/user-guide/bifrost/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# BIFROST

## Reduction Workflows

::::{grid} 3
Expand All @@ -11,10 +12,12 @@
:class: only-light
:width: 100%
```

```{image} ../../_static/thumbnails/bifrost_reduction_dark.svg
:class: only-dark
:width: 100%
```

:::

::::
Expand All @@ -25,7 +28,6 @@ hidden:
---

bifrost-reduction
bifrost-bragg-peak-monitor
```

## Advanced Tools
Expand All @@ -35,5 +37,6 @@ bifrost-bragg-peak-monitor
maxdepth: 1
---

bifrost-bragg-peak-monitor
bifrost-make-wavelength-lookup-table
```
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ requires-python = ">=3.11"
# Run 'tox -e deps' after making changes here. This will update requirement files.
# Make sure to list one dependency per line.
dependencies = [
"essreduce>=26.4.0",
"essreduce>=26.4.1",
"graphviz>=0.20",
"pandas>=2.1.2",
"sciline>=25.4.1",
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# will not be touched by ``make_base.py``
# --- END OF CUSTOM SECTION ---
# The following was generated by 'tox -e deps', DO NOT EDIT MANUALLY!
essreduce>=26.4.0
essreduce>=26.4.1
graphviz>=0.20
pandas>=2.1.2
sciline>=25.4.1
Expand Down
24 changes: 12 additions & 12 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SHA1:b30fe4f8b8899208801c1e28bbca8fdf94dbc938
# SHA1:db0b6133057674a1a7c9f64ad9fe7e4f411c9e8f
#
# This file was generated by pip-compile-multi.
# To update, run:
Expand All @@ -9,7 +9,7 @@ annotated-types==0.7.0
# via pydantic
certifi==2026.2.25
# via requests
charset-normalizer==3.4.6
charset-normalizer==3.4.7
# via requests
contourpy==1.3.3
# via matplotlib
Expand All @@ -21,7 +21,7 @@ dnspython==2.8.0
# via email-validator
email-validator==2.3.0
# via scippneutron
essreduce==26.4.0
essreduce==26.4.1
# via -r base.in
fonttools==4.62.1
# via matplotlib
Expand Down Expand Up @@ -50,7 +50,7 @@ mpltoolbox==26.2.0
# via scippneutron
networkx==3.6.1
# via cyclebane
numpy==2.4.3
numpy==2.4.4
# via
# contourpy
# h5py
Expand All @@ -59,26 +59,26 @@ numpy==2.4.3
# scipp
# scippneutron
# scipy
packaging==26.0
packaging==26.1
# via
# lazy-loader
# matplotlib
# pooch
pandas==3.0.1
pandas==3.0.2
# via -r base.in
pillow==12.1.1
pillow==12.2.0
# via matplotlib
platformdirs==4.9.4
platformdirs==4.9.6
# via pooch
plopp==26.3.1
plopp==26.4.0
# via
# scippneutron
# tof
pooch==1.9.0
# via tof
pydantic==2.12.5
pydantic==2.13.2
# via scippneutron
pydantic-core==2.41.5
pydantic-core==2.46.2
# via pydantic
pyparsing==3.3.2
# via matplotlib
Expand All @@ -87,7 +87,7 @@ python-dateutil==2.9.0.post0
# matplotlib
# pandas
# scippneutron
requests==2.32.5
requests==2.33.1
# via pooch
sciline==25.11.1
# via
Expand Down
12 changes: 6 additions & 6 deletions requirements/basetest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@
#
certifi==2026.2.25
# via requests
charset-normalizer==3.4.6
charset-normalizer==3.4.7
# via requests
idna==3.11
# via requests
iniconfig==2.3.0
# via pytest
packaging==26.0
packaging==26.1
# via
# pooch
# pytest
platformdirs==4.9.4
platformdirs==4.9.6
# via pooch
pluggy==1.6.0
# via pytest
pooch==1.9.0
# via -r basetest.in
pygments==2.19.2
pygments==2.20.0
# via pytest
pytest==9.0.2
pytest==9.0.3
# via -r basetest.in
requests==2.32.5
requests==2.33.1
# via pooch
urllib3==2.6.3
# via requests
20 changes: 11 additions & 9 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ cachetools==7.0.5
# via tox
certifi==2026.2.25
# via requests
charset-normalizer==3.4.6
charset-normalizer==3.4.7
# via requests
colorama==0.4.6
# via tox
distlib==0.4.0
# via virtualenv
filelock==3.25.2
filelock==3.29.0
# via
# python-discovery
# tox
Expand All @@ -26,12 +26,12 @@ gitpython==3.1.46
# via -r ci.in
idna==3.11
# via requests
packaging==26.0
packaging==26.1
# via
# -r ci.in
# pyproject-api
# tox
platformdirs==4.9.4
platformdirs==4.9.6
# via
# python-discovery
# tox
Expand All @@ -40,17 +40,19 @@ pluggy==1.6.0
# via tox
pyproject-api==1.10.0
# via tox
python-discovery==1.2.0
# via virtualenv
requests==2.32.5
python-discovery==1.2.2
# via
# tox
# virtualenv
requests==2.33.1
# via -r ci.in
smmap==5.0.3
# via gitdb
tomli-w==1.2.0
# via tox
tox==4.50.3
tox==4.53.0
# via -r ci.in
urllib3==2.6.3
# via requests
virtualenv==21.2.0
virtualenv==21.2.4
# via tox
Loading
Loading