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

Fixes for EMBL beamlines at PETRA #626

Merged
merged 5 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
38 changes: 38 additions & 0 deletions src/dxtbx/format/FormatCBFMiniEigerPetraP13.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""An implementation of the CBF image reader for Eiger images"""


from __future__ import annotations

import sys

from dxtbx.format.FormatCBFMiniEiger import FormatCBFMiniEiger


class FormatCBFMiniEigerPetraP13(FormatCBFMiniEiger):
ndevenish marked this conversation as resolved.
Show resolved Hide resolved
"""A class for reading mini CBF format Eiger images, and correctly
constructing a model for the experiment from this. This tuned for Petra P13"""

@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" in record.lower()
and "eiger" in record.lower()
and "E-32-0107" in record
):
return True

return False

def _goniometer(self):
ndevenish marked this conversation as resolved.
Show resolved Hide resolved
return self._goniometer_factory.known_axis((1, 0, 0))


if __name__ == "__main__":
for arg in sys.argv[1:]:
print(FormatCBFMiniEigerPetraP13.understand(arg))
2 changes: 1 addition & 1 deletion src/dxtbx/format/FormatCBFMiniEigerPetraP14.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def understand(image_file):
if (
"# detector" in record.lower()
and "eiger" in record.lower()
and "E-32-0107" in record
and "E-32-0129" in record
):
return True

Expand Down