-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into add_sample_to_source_distance
- Loading branch information
Showing
9 changed files
with
196 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
NXmx files with multidimensional arrays (images, modules, or both) are now handled. |
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 CBFMini support for the EIGER2 16M detector at CHESS beamline ID7B2, which has an inverted rotation axis. |
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 Eiger 9M on ESRF ID23-2, which has an undeclared vertical goniometer. |
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 @@ | ||
``dxtbx``: add fix for Eiger / NXmx data from i19-2 to correctly assign the image bit depth |
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,30 @@ | ||
from __future__ import annotations | ||
|
||
import sys | ||
|
||
from dxtbx.format.FormatCBFMiniEiger import FormatCBFMiniEiger | ||
|
||
|
||
class FormatCBFMiniEigerChessID7B2(FormatCBFMiniEiger): | ||
"""A class for reading mini CBF format Eiger16M images for S/N E-32-0123 | ||
installed at CHESS ID7B2, which has an inverted goniometer axis.""" | ||
|
||
@staticmethod | ||
def understand(image_file): | ||
"""Check to see if this looks like an Eiger mini CBF format image, | ||
i.e. we can make sense of it.""" | ||
|
||
header = FormatCBFMiniEiger.get_cbf_header(image_file) | ||
for record in header.split("\n"): | ||
if "# Detector: Dectris EIGER2 Si 16M, S/N E-32-0123" in record: | ||
return True | ||
|
||
return False | ||
|
||
def _goniometer(self): | ||
return self._goniometer_factory.known_axis((-1, 0, 0)) | ||
|
||
|
||
if __name__ == "__main__": | ||
for arg in sys.argv[1:]: | ||
print(FormatCBFMiniEigerChessID7B2.understand(arg)) |
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,34 @@ | ||
from __future__ import annotations | ||
|
||
import re | ||
|
||
import h5py | ||
|
||
from dxtbx.format.FormatNXmxEigerFilewriter import FormatNXmxEigerFilewriter | ||
|
||
DATA_FILE_RE = re.compile(r"data_\d{6}") | ||
|
||
|
||
class FormatNXmxEigerFilewriterESRFID232(FormatNXmxEigerFilewriter): | ||
_cached_file_handle = None | ||
|
||
@staticmethod | ||
def understand(image_file): | ||
with h5py.File(image_file) as handle: | ||
if "/entry/instrument/detector/detector_number" in handle: | ||
if ( | ||
handle["/entry/instrument/detector/detector_number"][()] | ||
== b"E-18-0133" | ||
): | ||
return True | ||
return False | ||
|
||
def __init__(self, image_file, **kwargs): | ||
"""Initialise the image structure from the given file.""" | ||
super().__init__(image_file, **kwargs) | ||
|
||
def _start(self): | ||
super()._start() | ||
|
||
def _goniometer(self): | ||
return self._goniometer_factory.known_axis((0, 1, 0)) |
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