Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stap demo dream notebook #117

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
677 changes: 677 additions & 0 deletions docs/user-guide/dream/dream-simulation-si-wfm.ipynb

Large diffs are not rendered by default.

20 changes: 9 additions & 11 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# pip-compile-multi
#
asttokens==2.4.1
asttokens==3.0.0
# via stack-data
click==8.1.7
# via dask
Expand All @@ -19,7 +19,7 @@ cyclebane==24.10.0
# via sciline
cycler==0.12.1
# via matplotlib
dask==2024.11.2
dask==2024.12.0
# via -r base.in
decorator==5.1.1
# via ipython
Expand All @@ -29,7 +29,7 @@ exceptiongroup==1.2.2
# via ipython
executing==2.1.0
# via stack-data
fonttools==4.55.0
fonttools==4.55.3
# via matplotlib
fsspec==2024.10.0
# via dask
Expand All @@ -43,7 +43,7 @@ importlib-metadata==8.5.0
# via dask
ipydatawidgets==4.3.5
# via pythreejs
ipython==8.29.0
ipython==8.30.0
# via ipywidgets
ipywidgets==8.1.5
# via
Expand All @@ -57,7 +57,7 @@ kiwisolver==1.4.7
# via matplotlib
locket==1.0.0
# via partd
matplotlib==3.9.2
matplotlib==3.10.0
# via
# mpltoolbox
# plopp
Expand All @@ -67,7 +67,7 @@ mpltoolbox==24.5.1
# via scippneutron
networkx==3.4.2
# via cyclebane
numpy==2.1.3
numpy==2.2.0
# via
# -r base.in
# contourpy
Expand Down Expand Up @@ -123,7 +123,7 @@ scipp==24.11.2
# essreduce
# scippneutron
# scippnexus
scippneutron==24.11.0
scippneutron==24.12.0
# via
# -r base.in
# essreduce
Expand All @@ -136,10 +136,8 @@ scipy==1.14.1
# via
# scippneutron
# scippnexus
six==1.16.0
# via
# asttokens
# python-dateutil
six==1.17.0
# via python-dateutil
stack-data==0.6.3
# via ipython
toolz==1.0.0
Expand Down
8 changes: 4 additions & 4 deletions requirements/basetest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# pip-compile-multi
#
certifi==2024.8.30
certifi==2024.12.14
# via requests
charset-normalizer==3.4.0
# via requests
Expand All @@ -15,7 +15,7 @@ idna==3.10
# via requests
iniconfig==2.0.0
# via pytest
numpy==2.1.3
numpy==2.2.0
# via pandas
packaging==24.2
# via
Expand All @@ -29,15 +29,15 @@ pluggy==1.5.0
# via pytest
pooch==1.8.2
# via -r basetest.in
pytest==8.3.3
pytest==8.3.4
# via -r basetest.in
python-dateutil==2.9.0.post0
# via pandas
pytz==2024.2
# via pandas
requests==2.32.3
# via pooch
six==1.16.0
six==1.17.0
# via python-dateutil
tomli==2.2.1
# via pytest
Expand Down
2 changes: 1 addition & 1 deletion requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
cachetools==5.5.0
# via tox
certifi==2024.8.30
certifi==2024.12.14
# via requests
chardet==5.2.0
# via tox
Expand Down
18 changes: 8 additions & 10 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
-r wheels.txt
annotated-types==0.7.0
# via pydantic
anyio==4.6.2.post1
anyio==4.7.0
# via
# httpx
# jupyter-server
Expand All @@ -40,7 +40,7 @@ h11==0.14.0
# via httpcore
httpcore==1.0.7
# via httpx
httpx==0.27.2
httpx==0.28.1
# via jupyterlab
isoduration==20.11.0
# via jsonschema
Expand All @@ -67,7 +67,7 @@ jupyter-server==2.14.2
# notebook-shim
jupyter-server-terminals==0.5.3
# via jupyter-server
jupyterlab==4.3.1
jupyterlab==4.3.3
# via -r dev.in
jupyterlab-server==2.27.3
# via jupyterlab
Expand All @@ -83,15 +83,15 @@ pip-tools==7.4.1
# via pip-compile-multi
plumbum==1.9.0
# via copier
prometheus-client==0.21.0
prometheus-client==0.21.1
# via jupyter-server
pycparser==2.22
# via cffi
pydantic==2.10.2
pydantic==2.10.3
# via copier
pydantic-core==2.27.1
# via pydantic
python-json-logger==2.0.7
python-json-logger==3.2.1
# via jupyter-events
questionary==1.10.0
# via copier
Expand All @@ -106,16 +106,14 @@ rfc3986-validator==0.1.1
send2trash==1.8.3
# via jupyter-server
sniffio==1.3.1
# via
# anyio
# httpx
# via anyio
terminado==0.18.1
# via
# jupyter-server
# jupyter-server-terminals
toposort==1.10
# via pip-compile-multi
types-python-dateutil==2.9.0.20241003
types-python-dateutil==2.9.0.20241206
# via arrow
uri-template==1.3.0
# via jsonschema
Expand Down
12 changes: 6 additions & 6 deletions requirements/docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ accessible-pygments==0.0.5
# via pydata-sphinx-theme
alabaster==1.0.0
# via sphinx
attrs==24.2.0
attrs==24.3.0
# via
# jsonschema
# referencing
Expand All @@ -24,11 +24,11 @@ beautifulsoup4==4.12.3
# pydata-sphinx-theme
bleach==6.2.0
# via nbconvert
certifi==2024.8.30
certifi==2024.12.14
# via requests
charset-normalizer==3.4.0
# via requests
debugpy==1.8.9
debugpy==1.8.11
# via ipykernel
defusedxml==0.7.1
# via nbconvert
Expand All @@ -40,7 +40,7 @@ docutils==0.21.2
# pydata-sphinx-theme
# sphinx
# sphinxcontrib-bibtex
fastjsonschema==2.21.0
fastjsonschema==2.21.1
# via nbformat
idna==3.10
# via requests
Expand Down Expand Up @@ -93,7 +93,7 @@ mistune==3.0.2
# via nbconvert
myst-parser==4.0.0
# via -r docs.in
nbclient==0.10.0
nbclient==0.10.1
# via nbconvert
nbconvert==7.16.4
# via nbsphinx
Expand Down Expand Up @@ -142,7 +142,7 @@ requests==2.32.3
# via
# pooch
# sphinx
rpds-py==0.21.0
rpds-py==0.22.3
# via
# jsonschema
# referencing
Expand Down
10 changes: 5 additions & 5 deletions requirements/nightly.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# pip-compile-multi
#
-r basetest.txt
asttokens==2.4.1
asttokens==3.0.0
# via stack-data
click==8.1.7
# via dask
Expand All @@ -20,15 +20,15 @@ cyclebane==24.10.0
# via sciline
cycler==0.12.1
# via matplotlib
dask==2024.11.2
dask==2024.12.0
# via -r nightly.in
decorator==5.1.1
# via ipython
essreduce @ git+https://github.com/scipp/essreduce@main
# via -r nightly.in
executing==2.1.0
# via stack-data
fonttools==4.55.0
fonttools==4.55.3
# via matplotlib
fsspec==2024.10.0
# via dask
Expand All @@ -42,7 +42,7 @@ importlib-metadata==8.5.0
# via dask
ipydatawidgets==4.3.5
# via pythreejs
ipython==8.29.0
ipython==8.30.0
# via ipywidgets
ipywidgets==8.1.5
# via
Expand All @@ -56,7 +56,7 @@ kiwisolver==1.4.7
# via matplotlib
locket==1.0.0
# via partd
matplotlib==3.9.2
matplotlib==3.10.0
# via
# mpltoolbox
# plopp
Expand Down
38 changes: 38 additions & 0 deletions src/ess/dream/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ def _make_pooch():
"DREAM_simple_pwd_workflow/Cave_TOF_Monitor_diam_in_can.dat": "md5:ef24f4a4186c628574046e6629e31611", # noqa: E501
"DREAM_simple_pwd_workflow/Cave_TOF_Monitor_van_can.dat": "md5:e63456c347fb36a362a0b5ae2556b3cf", # noqa: E501
"DREAM_simple_pwd_workflow/Cave_TOF_Monitor_vana_inc_coh.dat": "md5:701d66792f20eb283a4ce76bae0c8f8f", # noqa: E501
"stap_demo_october_2024/268227_00024779_Si_BC_offset_240_deg.hdf": "md5:d0d89bcae5bee0619e0333adfda57d70", # noqa: E501
"stap_demo_october_2024/268227_00024779_Vana_inc_BC_offset_240_deg_wlgth.hdf": "md5:fbc8bde80c8889eea6ccea6f3f8eb9b8", # noqa: E501
"stap_demo_october_2024/Cave_TOF_Monitor_hf_si_bc240.dat": "md5:8cf6c0a1b42185662ddc579eda07d1e6", # noqa: E501
"stap_demo_october_2024/Cave_TOF_Monitor_hf_vanainc_bc240.dat": "md5:a9d5593d363a1c1fc51eb86757d6fa81", # noqa: E501
},
)

Expand Down Expand Up @@ -146,3 +150,37 @@ def simulated_monitor_empty_can() -> str:
This is the DREAM cave monitor for ``simulated_empty_can``.
"""
return get_path("DREAM_simple_pwd_workflow/Cave_TOF_Monitor_van_can.dat")


def stap_demo_2024_si_sample() -> str:
"""
Path to a file containing detector event data for a McStas/Geant4 simulation with a
silicon sample.
"""
return get_path("stap_demo_october_2024/268227_00024779_Si_BC_offset_240_deg.hdf")


def stap_demo_2024_vanadium_sample() -> str:
"""
Path to a file containing detector event data for a McStas/Geant4 simulation with a
vanadium sample.
"""
return get_path(
"stap_demo_october_2024/268227_00024779_Vana_inc_BC_offset_240_deg_wlgth.hdf"
)


def stap_demo_2024_si_monitor() -> str:
"""
Path to a file containing histogrammed monitor data for a McStas/Geant4 simulation
with a silicon sample.
"""
return get_path("stap_demo_october_2024/Cave_TOF_Monitor_hf_si_bc240.dat")


def stap_demo_2024_vanadium_monitor() -> str:
"""
Path to a file containing histogrammed monitor data for a McStas/Geant4 simulation
with a vanadium sample.
"""
return get_path("stap_demo_october_2024/Cave_TOF_Monitor_hf_vanainc_bc240.dat")