示例#1
0
 def __init__(self, filename):
     DetectorImageBase.__init__(self, filename)
     try:
         from cbflib_adaptbx import CBFAdaptor  # optional package
         self.adaptor = CBFAdaptor(filename)
         # for testing only:
         '''
   self.adaptor.read_header()
   print "     size1:", self.adaptor.size1()
   print "     size2:", self.adaptor.size2()
   print "  overload:", self.adaptor.overload()
   print "wavelength:", self.adaptor.wavelength()
   print "  distance:", self.adaptor.distance()
   print "pixel size:", self.adaptor.pixel_size()
   print "     beamx:", self.adaptor.beam_index_slow*self.adaptor.pixel_size()
   print "     beamy:", self.adaptor.beam_index_fast*self.adaptor.pixel_size()
   print " osc_start:", self.adaptor.osc_start()
   print " osc_range:", self.adaptor.osc_range()
   print self.adaptor.raster_description()
   flags = self.adaptor.transform_flags()
   print flags.transpose, flags.reverse_slow, flags.reverse_fast
   '''
     except Exception:
         from iotbx.detectors.marIP import NullAdaptor
         self.adaptor = NullAdaptor()
     self.vendortype = "CBF"
     self.readHeader()
     try:
         self.vendor_specific_null_value = int(
             self.adaptor.undefined_value())
     except RuntimeError as e:
         self.vendor_specific_null_value = 0
示例#2
0
 def __init__(self, filename, index=0):
     DetectorImageBase.__init__(self, filename)
     self.vendortype = "EigerX"
     self.supports_multiple_images = True
     self.img_number = index  # 0-indexed to clients, internally 1-indexed
     if self.img_number == None: self.img_number = 0
     self.vendor_specific_null_value = -1
示例#3
0
 def __init__(self,filename):
   DetectorImageBase.__init__(self,filename)
   try:
     from cbflib_adaptbx import CBFAdaptor # optional package
     self.adaptor = CBFAdaptor(filename)
     # for testing only:
     '''
     self.adaptor.read_header()
     print "     size1:", self.adaptor.size1()
     print "     size2:", self.adaptor.size2()
     print "  overload:", self.adaptor.overload()
     print "wavelength:", self.adaptor.wavelength()
     print "  distance:", self.adaptor.distance()
     print "pixel size:", self.adaptor.pixel_size()
     print "     beamx:", self.adaptor.beam_index_slow*self.adaptor.pixel_size()
     print "     beamy:", self.adaptor.beam_index_fast*self.adaptor.pixel_size()
     print " osc_start:", self.adaptor.osc_start()
     print " osc_range:", self.adaptor.osc_range()
     print self.adaptor.raster_description()
     flags = self.adaptor.transform_flags()
     print flags.transpose, flags.reverse_slow, flags.reverse_fast
     '''
   except Exception:
     from iotbx.detectors.marIP import NullAdaptor
     self.adaptor = NullAdaptor()
   self.vendortype = "CBF"
   self.readHeader()
   self.vendor_specific_null_value = int(self.adaptor.undefined_value())
示例#4
0
 def __init__(self,filename):
   DetectorImageBase.__init__(self,filename)
   try:
     from cbflib_adaptbx import Mar345Adaptor # optional package
     self.adaptor = Mar345Adaptor(filename)
   except Exception:
     self.adaptor = NullAdaptor()
   self.vendortype = "MARIP"
示例#5
0
    def __init__(self, filename):
        DetectorImageBase.__init__(self, filename)
        try:
            from cbflib_adaptbx import Mar345Adaptor  # optional package

            self.adaptor = Mar345Adaptor(filename)
        except Exception:
            self.adaptor = NullAdaptor()
        self.vendortype = "MARIP"
示例#6
0
  def __init__(self,filename):
    DetectorImageBase.__init__(self,filename)
    self.vendortype = "MARCCD"

    byte_order = str(open(self.filename,"rb").read(2))
    if byte_order == 'II':
      self.endian = 0
    else:
      self.endian = 1

    assert not self.isCompressed()
示例#7
0
    def __init__(self, filename):
        DetectorImageBase.__init__(self, filename)
        self.vendortype = "MARCCD"

        with open(self.filename, "rb") as fh:
            byte_order = fh.read(2)
            if byte_order == b"II":
                self.endian = 0
            else:
                self.endian = 1

        assert not self.isCompressed()
示例#8
0
  def __init__(self, file_name):
    DetectorImageBase.__init__(self, file_name)
    raw = open(file_name, "rb").read()
    self.binary_sections = get_binary_sections(raw)
    self.header_sections = get_header_sections(raw, self.binary_sections)

    assert len(self.binary_sections)==1

    cif = iotbx.cif.fast_reader(input_string=self.header_sections)
    self.cif_model = cif.model()
    im1 = self.cif_model["image_1"]

    self.vendortype = "CBF"
    self.readHeader()
    def __init__(self, file_name):
        DetectorImageBase.__init__(self, file_name)
        raw = open(file_name, "rb").read()
        self.binary_sections = get_binary_sections(raw)
        self.header_sections = get_header_sections(raw, self.binary_sections)

        assert len(self.binary_sections) == 1

        cif = iotbx.cif.fast_reader(input_string=self.header_sections)
        self.cif_model = cif.model()
        im1 = self.cif_model["image_1"]

        self.vendortype = "CBF"
        self.readHeader()
示例#10
0
文件: mar.py 项目: RAPD/RAPD
    def __init__(self, filename):
        """Initialize the instance"""

        # Make sure the image name is a string for iotbx
        try:
            image_str = unicodedata.normalize("NFKD", filename).encode("ascii", "ignore")
        except TypeError:
            image_str = filename

        DetectorImageBase.__init__(self, image_str)
        # self.vendortype = "MARCCD"

        byte_order = str(open(self.filename, "rb").read(2))
        if byte_order == "II":
            self.endian = 0
        else:
            self.endian = 1

        assert not self.isCompressed()
示例#11
0
 def __init__(self,filename):
   DetectorImageBase.__init__(self,filename)
   self.vendortype = "Eiger"
   self.vendor_specific_null_value = -1
示例#12
0
 def __init__(self,filename):
   DetectorImageBase.__init__(self,filename)
   self.vendortype = "ADSC"
示例#13
0
 def __init__(self,filename):
   DetectorImageBase.__init__(self,filename)
   self.vendortype = "ADSC"
   self.open_file = open # default: open files with built-in, unless otherwise instructed by dxtbx format
示例#14
0
 def __init__(self, filename):
     DetectorImageBase.__init__(self, filename)
     self.vendortype = "Pilatus"
     self.vendor_specific_null_value = -1
示例#15
0
 def __init__(self,filename):
   DetectorImageBase.__init__(self,filename)
   Raxis.__init__(self,filename)
   self.vendortype = "RAXIS"
示例#16
0
 def __init__(self, filename):
     DetectorImageBase.__init__(self, filename)
     self.vendortype = "SMV(Generic)"
示例#17
0
 def __init__(self,filename):
   DetectorImageBase.__init__(self,filename)
   self.filename = filename
   self.vendortype = "MacScience"
   self.getImageSize()
示例#18
0
 def __init__(self,filename):
   DetectorImageBase.__init__(self,filename)
   self.vendortype = "SMV(Generic)"
示例#19
0
 def __init__(self,filename):
   DetectorImageBase.__init__(self,filename)
   self.vendortype = "EIGER"
   self.supports_multiple_images = True
   self.img_number = 0 # 0-indexed to clients, internally 1-indexed
示例#20
0
 def __init__(self,filename):
   DetectorImageBase.__init__(self,filename)
   self.vendortype = "RigakuSaturn"
示例#21
0
 def __init__(self,filename):
   DetectorImageBase.__init__(self,filename)
   self.filename = filename
   self.vendortype = "MacScience"
   self.getImageSize()
示例#22
0
 def __init__(self, filename, source_data=None):
     DetectorImageBase.__init__(self, filename)
     self.vendortype = "npy_raw"
     self.source_data = source_data
示例#23
0
 def __init__(self,filename):
   DetectorImageBase.__init__(self,filename)
   self.vendortype = "RigakuSaturn"
示例#24
0
 def __init__(self, filename):
     DetectorImageBase.__init__(self, filename)
     self.vendortype = "Hamamatsu"
示例#25
0
 def __init__(self, filename, source_data = None):
   DetectorImageBase.__init__(self, filename)
   self.vendortype = "npy_raw"
   self.source_data = source_data
示例#26
0
 def __init__(self, filename):
     DetectorImageBase.__init__(self, filename)
     Raxis.__init__(self, filename)
     self.vendortype = "RAXIS"
示例#27
0
文件: npy.py 项目: dials/cctbx
 def __init__(self, filename, source_data=None):
     DetectorImageBase.__init__(self, filename)
     self.vendortype = "npy_raw"
     self.source_data = image_dict_to_unicode(source_data)