Skip to content

Commit

Permalink
FormatCBFMiniEigerChessID7B2 (#649)
Browse files Browse the repository at this point in the history
  • Loading branch information
dagewa authored Aug 10, 2023
1 parent 39c4923 commit 206c7cb
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions newsfragments/649.feature
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.
30 changes: 30 additions & 0 deletions src/dxtbx/format/FormatCBFMiniEigerChessID7B2.py
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))

0 comments on commit 206c7cb

Please sign in to comment.