forked from cctbx/dxtbx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NXmx: read data_scale_factor (cctbx#756)
New parameter as of nexusformat/definitions#1343. This is not full support of the parameter or of data_offset, but it's one of the use cases needed, namely reading a single gain value Co-authored-by: Nicholas Devenish <[email protected]>
- Loading branch information
Showing
5 changed files
with
34 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add support for reading the detector gain for nexus files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
Includes 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 |