-
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.
Add support for Eiger detector at PETRA P13
- Loading branch information
Christian Becke
committed
Apr 24, 2023
1 parent
b5e6cdd
commit 1c12797
Showing
1 changed file
with
38 additions
and
0 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,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): | ||
"""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): | ||
return self._goniometer_factory.known_axis((1, 0, 0)) | ||
|
||
|
||
if __name__ == "__main__": | ||
for arg in sys.argv[1:]: | ||
print(FormatCBFMiniEigerPetraP13.understand(arg)) |