Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormatCBFMiniEigerChessID7B2 #649

Merged
merged 5 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, with an inverted rotation axis.
ndevenish marked this conversation as resolved.
Show resolved Hide resolved
39 changes: 39 additions & 0 deletions src/dxtbx/format/FormatCBFMiniEigerChessID7B2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""
dagewa marked this conversation as resolved.
Show resolved Hide resolved
An implementation of the FormatCBFMiniEiger image reader for the Eiger2 16M
detector at the CHESS ID7B2 beamline, which has an inverted goniometer axis.
"""

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:
dagewa marked this conversation as resolved.
Show resolved Hide resolved
return True

return False

def _goniometer(self):
"""Return a model for a simple single-axis goniometer. This should
dagewa marked this conversation as resolved.
Show resolved Hide resolved
probably be checked against the image header, though for miniCBF
there are limited options for this."""

return self._goniometer_factory.known_axis((-1, 0, 0))


if __name__ == "__main__":
for arg in sys.argv[1:]:
print(FormatCBFMiniEigerChessID7B2.understand(arg))
Loading