Skip to content
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions packages/esssans/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@

:::

:::{grid-item-card} SKADI
:link: user-guide/skadi/index.md

:::

:::{grid-item-card} ISIS instruments
:link: user-guide/isis/index.md

Expand Down
1 change: 1 addition & 0 deletions packages/esssans/docs/user-guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ maxdepth: 1

installation
loki/index
skadi/index
isis/index
common/index
```
31 changes: 31 additions & 0 deletions packages/esssans/docs/user-guide/skadi/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# SKADI

## Detector diagnostics

::::{grid} 3

:::{grid-item-card} Detector view
:link: skadi-detector-view.ipynb
:text-align: center

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

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

:::

::::

```{toctree}
---
hidden:
---

skadi-detector-view
```
74 changes: 74 additions & 0 deletions packages/esssans/docs/user-guide/skadi/skadi-detector-view.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "0",
"metadata": {},
"source": [
"# SKADI detector view\n",
"\n",
"This example uses the SKADI McStas workflow to load detector events and display them in an interactive instrument view. The reduced example file is downloaded on first use and cached by pooch."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1",
"metadata": {},
"outputs": [],
"source": [
"import scippneutron as scn\n",
"\n",
"from ess.skadi import SkadiMcStasWorkflow\n",
"from ess.skadi.data import skadi_mcstas_sample\n",
"from ess.sans.types import Filename, RawDetector, SampleRun"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2",
"metadata": {},
"outputs": [],
"source": [
"workflow = SkadiMcStasWorkflow()\n",
"workflow[Filename[SampleRun]] = skadi_mcstas_sample()\n",
"detector = workflow.compute(RawDetector[SampleRun])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3",
"metadata": {},
"outputs": [],
"source": [
"detector_view = scn.instrument_view(\n",
" detector.bins.sum(), size=0.006, norm=\"log\", cbar=True\n",
")\n",
"detector_view"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.15"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
1 change: 1 addition & 0 deletions packages/esssans/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dynamic = ["version"]
dependencies = [
"dask>=2022.1.0",
"graphviz>=0.20",
"h5py>=3.11",
"essreduce>=26.6.0",
"numpy>=1.26.4",
"pandas>=2.1.2",
Expand Down
24 changes: 24 additions & 0 deletions packages/esssans/src/ess/skadi/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2026 Scipp contributors (https://github.com/scipp)

import importlib.metadata

from . import mcstas, workflow
from .mcstas import load_skadi_mcstas
from .workflow import SkadiMcStasWorkflow, SkadiWorkflow, skadi_default_parameters

try:
__version__ = importlib.metadata.version(__package__ or __name__)
except importlib.metadata.PackageNotFoundError:
__version__ = "0.0.0"

del importlib

__all__ = [
'SkadiMcStasWorkflow',
'SkadiWorkflow',
'load_skadi_mcstas',
'mcstas',
'skadi_default_parameters',
'workflow',
]
25 changes: 25 additions & 0 deletions packages/esssans/src/ess/skadi/data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2026 Scipp contributors (https://github.com/scipp)
"""Data for SKADI documentation examples."""

from pathlib import Path

from ess.reduce.data import make_registry

_registry = make_registry(
"ess/skadi",
files={
"skadi_mcstas_1e8_sample10_1_of_50.h5": (
"md5:37883335a05c41d420cff2b38f883fc2"
),
},
version="1",
)


def skadi_mcstas_sample() -> Path:
"""Return the reduced SKADI McStas sample used in the user guide."""
return _registry.get_path("skadi_mcstas_1e8_sample10_1_of_50.h5")


__all__ = ["skadi_mcstas_sample"]
Loading
Loading