Skip to content

Commit fd13732

Browse files
authored
Merge pull request #67 from scipp/improve-impl
Re-run comparison to PSI + some minor fixes
2 parents e5b9763 + 0eea4e7 commit fd13732

File tree

5 files changed

+22
-10
lines changed

5 files changed

+22
-10
lines changed

docs/user-guide/amor/compare-to-eos.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"\n",
5353
"for i in `seq 608 613`\n",
5454
"do\n",
55-
" python amor/neos.py $args -f $i -o $i $args \n",
55+
" python amor/neos.py $args -f $i -o $i\n",
5656
"done\n",
5757
"```"
5858
]
@@ -223,7 +223,8 @@
223223
"mimetype": "text/x-python",
224224
"name": "python",
225225
"nbconvert_exporter": "python",
226-
"pygments_lexer": "ipython3"
226+
"pygments_lexer": "ipython3",
227+
"version": "3.10.13"
227228
}
228229
},
229230
"nbformat": 4,

src/ess/amor/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
NeXusDetectorName,
1515
RunType,
1616
SamplePosition,
17+
BeamDivergenceLimits,
1718
)
1819
from . import conversions, data, load, orso, resolution, utils
1920
from .instrument_view import instrument_view
@@ -64,6 +65,7 @@ def default_parameters() -> dict:
6465
NeXusDetectorName[RunType]: "detector",
6566
ChopperPhase[RunType]: sc.scalar(-5.0, unit="deg"),
6667
ChopperFrequency[RunType]: sc.scalar(8.333, unit="Hz"),
68+
BeamDivergenceLimits: (sc.scalar(-0.7, unit='deg'), sc.scalar(0.7, unit='deg')),
6769
}
6870

6971

src/ess/amor/data.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from ..reflectometry.types import Filename, ReferenceRun, SampleRun
55

6-
_version = "1"
6+
_version = "2"
77

88

99
def _make_pooch():
@@ -42,14 +42,14 @@ def _make_pooch():
4242
"amor2023n000614.hdf": "md5:18e8a755d6fd671758fe726de058e707",
4343
# Reflectivity curves obtained by applying Jochens Amor
4444
# software @ https://github.com/jochenstahn/amor.git
45-
# (repo commit hash e05fc9e1e124965919647f1856dbb9eb04221f1e).
45+
# (repo commit hash 05e35ca4e05436d7c69ff6e19f32bc1915cbb5d0).
4646
# to the above files.
47-
"608.Rqz.ort": "md5:60d8467796800f19c3aa1b6af5ad7b3d",
48-
"609.Rqz.ort": "md5:99af745e025423af64bc5a124a011826",
49-
"610.Rqz.ort": "md5:fa703dc9c5eed49d35e7a3d76a5746b9",
50-
"611.Rqz.ort": "md5:d6ea74d0525308a6a42938c106b62919",
51-
"612.Rqz.ort": "md5:f0b0eb269614645b4c6bbe24e29a6e10",
52-
"613.Rqz.ort": "md5:fff003552908c6a4a94b6213cfa08ac3",
47+
"608.Rqz.ort": "md5:e7e7d63a1ac1e727e9b2f12dc78a77ce",
48+
"609.Rqz.ort": "md5:3cb3fd11a743594f52a10f71b122b71a",
49+
"610.Rqz.ort": "md5:66d43993e76801655a1d629cb976abde",
50+
"611.Rqz.ort": "md5:0c51e8ac5c00041434417673be186151",
51+
"612.Rqz.ort": "md5:d785d27151e7f1edc05e86d35bef6a63",
52+
"613.Rqz.ort": "md5:e999c85f7a47665c4ddd1538b19d402d",
5353
},
5454
)
5555

src/ess/reflectometry/conversions.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from scippneutron.conversion.graph import beamline, tof
88

99
from .types import (
10+
BeamDivergenceLimits,
1011
DataWithScatteringCoordinates,
1112
Gravity,
1213
IncidentBeam,
@@ -148,7 +149,11 @@ def add_masks(
148149
ylim: YIndexLimits,
149150
wb: WavelengthBins,
150151
zlim: ZIndexLimits,
152+
bdlim: BeamDivergenceLimits,
151153
) -> MaskedData[RunType]:
154+
da.masks["beam_divergence_too_large"] = (
155+
da.coords["angle_from_center_of_beam"] < bdlim[0]
156+
) | (da.coords["angle_from_center_of_beam"] > bdlim[1])
152157
da.masks["y_index_range"] = (da.coords["y_index"] < ylim[0]) | (
153158
da.coords["y_index"] > ylim[1]
154159
)

src/ess/reflectometry/types.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,9 @@ class SampleSize(sciline.Scope[RunType, sc.Variable], sc.Variable):
124124
"""Limit of the (logical) 'z' detector pixel index"""
125125

126126

127+
BeamDivergenceLimits = NewType("BeamDivergenceLimits", tuple[sc.Variable, sc.Variable])
128+
"""Limit of the beam divergence"""
129+
130+
127131
ReferenceFilePath = NewType("ReferenceFilePath", str)
128132
"""Path to the cached normalization matrix"""

0 commit comments

Comments
 (0)