def understand(image_file): hdr = FormatBruker.read_header_lines(image_file) hdr_dic = FormatBruker.parse_header(hdr) if 'FixedChiStage' not in hdr_dic['MODEL']: return False if 'PHOTONII' in hdr_dic['DETTYPE']: return False return True
def __init__(self, image_file, **kwargs): """Initialise the image structure from the given file, including a proper model of the experiment. Easy from Rigaku Saturn images as they contain everything pretty much we need...""" if not self.understand(image_file): raise IncorrectFormatError(self, image_file) self._image_file = image_file FormatBruker.__init__(self, image_file, **kwargs)
def understand(image_file): hdr = FormatBruker.read_header_lines(image_file) hdr_dic = FormatBruker.parse_header(hdr) if "FixedChiStage" not in hdr_dic["MODEL"]: return False if "PHOTONII" in hdr_dic["DETTYPE"]: return False return True
def understand(image_file): try: header_lines = FormatBruker.read_header_lines(image_file) except IOError: return False header_dic = FormatBruker.parse_header(header_lines) dettype = header_dic.get('DETTYPE') if dettype is None: return False if not dettype.startswith('CMOS-PHOTONII'): return False return True
def _start(self): try: header_lines = FormatBruker.read_header_lines(self._image_file) except IOError: return False self.header_dict = FormatBrukerPhotonII.parse_header(header_lines)
def understand(image_file): #return False try: tag = FormatBruker.open_file(image_file, 'rb').read(1024) except IOError: return False matches = [] for x in xrange(0, 1024, 80): word = tag[x:x + 16] if word[0:7].isupper() and word[7] == ":": matches.append(word) return len(matches) >= 12 and 'FixedChiStage' in tag
def _start(self): try: header_lines = FormatBruker.read_header_lines(self._image_file) except IOError: return False self.header_dict = FormatBrukerPhotonII.parse_header(header_lines) # The Photon II format can't currently use BrukerImage, see # https://github.com/cctbx/cctbx_project/issues/65 # from iotbx.detectors.bruker import BrukerImage # self.detectorbase = BrukerImage(self._image_file) return
def _start(self): try: header_lines = FormatBruker.read_header_lines(self._image_file) except IOError: return False self.header_dict = {} for l in header_lines: k, v = [v.strip() for v in l.split(':', 1)] if k in self.header_dict: self.header_dict[k] = self.header_dict[k] + "\n" + v else: self.header_dict[k] = v from iotbx.detectors.bruker import BrukerImage self.detectorbase = BrukerImage(self._image_file) return
def understand(image_file): try: header_lines = FormatBruker.read_header_lines(image_file) except IOError: return False header_dic = {} for l in header_lines: k_v = l.split(':', 1) if len(k_v) == 1: continue k, v = [v.strip() for v in k_v] if k in header_dic: header_dic[k] = header_dic[k] + "\n" + v else: header_dic[k] = v dettype = header_dic.get('DETTYPE') if dettype is None: return False if not dettype.startswith('CMOS-PHOTONII'): return False return True