def _start(self): '''Open the image file as a cbf file handle, and keep this somewhere safe.''' FormatCBFFull._start(self) return
def __init__(self, image_file): '''Initialise the image structure from the given file.''' assert(self.understand(image_file)) FormatCBFFull.__init__(self, image_file) return
def __init__(self, image_file, **kwargs): '''Initialise the image structure from the given file.''' from dxtbx import IncorrectFormatError if not self.understand(image_file): raise IncorrectFormatError(self, image_file) FormatCBFFull.__init__(self, image_file, **kwargs) self._raw_data = None
def __init__(self, image_file, **kwargs): '''Initialise the image structure from the given file.''' assert (self.understand(image_file)) FormatCBFFull.__init__(self, image_file, **kwargs) self._raw_data = None return
def __init__(self, image_file, **kwargs): '''Initialise the image structure from the given file.''' assert(self.understand(image_file)) FormatCBFFull.__init__(self, image_file, **kwargs) self._raw_data = None return
def understand(image_file): """Check to see if this looks like an CBF format image, i.e. we can make sense of it.""" header = FormatCBFFull.get_cbf_header(image_file) for record in header.split("\n"): if "_array_data.header_convention" in record and "PILATUS" in record: return True return False
def understand(image_file): '''Check to see if this looks like an CBF format image, i.e. we can make sense of it.''' header = FormatCBFFull.get_cbf_header(image_file) for record in header.split('\n'): if '_array_data.header_convention' in record and \ 'PILATUS' in record: return True return False
def understand(image_file): '''Check to see if this looks like an CBF format image, i.e. we can make sense of it.''' header = FormatCBFFull.get_cbf_header(image_file) recognise = 0 records = header.split('\n') for i, record in enumerate(records): if '_diffrn_measurement.diffrn_id' in record and 'BRUKER' in record: recognise += 1 if '_array_element_size.size' in record: try: size1 = float(records[i + 1].split()[-1]) size2 = float(records[i + 2].split()[-1]) except ValueError: return False if size1 == 0.000135 and size2 == 0.000135: recognise += 1 if recognise == 2: return True return False
def _start(self): """Open the image file as a cbf file handle, and keep this somewhere safe.""" FormatCBFFull._start(self)