Skip to content

Commit d7a67cc

Browse files
committed
test: sample rotation offset is used
1 parent 7769223 commit d7a67cc

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/amor/pipeline_test.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
Filename,
1818
ProtonCurrent,
1919
QBins,
20+
RawSampleRotation,
2021
ReducibleData,
2122
ReferenceRun,
2223
ReflectivityOverQ,
2324
SampleRotation,
25+
SampleRotationOffset,
2426
SampleRun,
2527
SampleSize,
2628
WavelengthBins,
@@ -226,3 +228,18 @@ def test_proton_current(amor_pipeline: sciline.Pipeline):
226228
np.testing.assert_allclose(
227229
proton_current[np.searchsorted(timestamps, t) - 1], w_without / w_with
228230
)
231+
232+
233+
@pytest.mark.filterwarnings("ignore:Failed to convert .* into a transformation")
234+
@pytest.mark.filterwarnings("ignore:Invalid transformation, missing attribute")
235+
def test_sample_rotation_offset(amor_pipeline: sciline.Pipeline):
236+
amor_pipeline[Filename[SampleRun]] = amor.data.amor_run(608)
237+
amor_pipeline[SampleRotationOffset[SampleRun]] = sc.scalar(1.0, unit='deg')
238+
mu, muoffset, muraw = amor_pipeline.compute(
239+
(
240+
SampleRotation[SampleRun],
241+
SampleRotationOffset[SampleRun],
242+
RawSampleRotation[SampleRun],
243+
)
244+
).values()
245+
assert mu == muoffset.to(unit=muraw.unit) + muraw

0 commit comments

Comments
 (0)