From d952a1f277eafea424ee6269c4179e881b8c4b61 Mon Sep 17 00:00:00 2001 From: Aaron Brewster Date: Thu, 19 Sep 2024 11:37:45 -0700 Subject: [PATCH] Add test --- tests/nexus/test_mpccd_nexus.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/nexus/test_mpccd_nexus.py diff --git a/tests/nexus/test_mpccd_nexus.py b/tests/nexus/test_mpccd_nexus.py new file mode 100644 index 000000000..16d4a4286 --- /dev/null +++ b/tests/nexus/test_mpccd_nexus.py @@ -0,0 +1,24 @@ +from __future__ import annotations + +import dxtbx + + +def test_mpccd_nexus_gain(dials_data): + """ + Tests SACLA MPCCD image from CXI.DB 221 + Includs parameter data_scale_factor, which accounts for a gain of 10 + """ + + try: + h5path = ( + dials_data("image_examples", pathlib=True) + / "SACLA-MPCCD-run197287-0-nexus.h5" + ) + except Exception as e: + print(type(e), str(e)) + raise + img = dxtbx.load(h5path) + + d = img.get_detector() + + assert d[0].get_gain() == 10