コード例 #1
0
ファイル: stills_integration.py プロジェクト: dials/cctbx
    def analyze_one(self, solution):
        inputpd = self.Org.process()

        settings = pickle.load(open("LABELIT_possible", "rb"))
        setting = [
            setting for setting in settings if setting["counter"] == solution
        ][0]

        from labelit.preferences import labelit_commands as param

        pixel_size = float(inputpd['pixel_size'])
        self.pixel_size = pixel_size

        from labelit.dptbx import AutoIndexEngine, Parameters
        ai = AutoIndexEngine(inputpd['endstation'])

        P = Parameters(xbeam=setting["refined x beam"],
                       ybeam=setting["refined y beam"],
                       distance=setting["refined distance"],
                       twotheta=float(inputpd["twotheta"]))
        ai.setBase(P)
        ai.setWavelength(float(inputpd['wavelength']))
        ai.setMaxcell(float(inputpd['ref_maxcel']))
        print("Deltaphi is", float(inputpd['deltaphi']))
        ai.setDeltaphi(float(inputpd['deltaphi']) * math.pi / 180.)
        ai.setMosaicity(setting["mosaicity"])
        ai.setOrientation(setting["orient"])
        #why aren't hexagonal constraints applied here???
        print(inputpd["osc_start"])

        image_centers = [(math.pi / 180.) * float(x)
                         for x in inputpd["osc_start"].values()]

        limiting_resolution = param.distl_highres_limit
        print("Limiting resolution", limiting_resolution)

        #predict the spots
        spots = ai.predict_all(image_centers[0], limiting_resolution)
        pre2m = spots.vec3()
        self.pre2m = pre2m

        hkllist = spots.hkl()
        cell = ai.getOrientation().unit_cell()
        print(cell)
        for hkl in hkllist:
            #print "%25s %5.2f"%(str(hkl),cell.d(hkl))
            assert cell.d(hkl) >= limiting_resolution
        print("Number of hkls:", (hkllist).size(), end=' ')
        print("all inside the %4.2f Angstrom limiting sphere." %
              limiting_resolution)
        print("The unit cell is", cell)
        self.solution_setting_ai = ai
        self.solution_pd = inputpd
        self.image_centers = image_centers
        self.one_setting = setting
        return [ai.getOrientation().unit_cell(), hkllist]
コード例 #2
0
  def analyze_one(self,solution):
    inputpd = self.Org.process()

    settings = pickle.load(open("LABELIT_possible","rb"))
    setting = [setting for setting in settings if setting["counter"]==solution][0]

    from labelit.preferences import labelit_commands as param

    pixel_size = float(inputpd['pixel_size'])
    self.pixel_size = pixel_size

    from labelit.dptbx import AutoIndexEngine, Parameters
    ai = AutoIndexEngine(inputpd['endstation'])

    P = Parameters(xbeam=setting["refined x beam"],ybeam=setting["refined y beam"],
             distance=setting["refined distance"],twotheta=float(inputpd["twotheta"]))
    ai.setBase(P)
    ai.setWavelength(float(inputpd['wavelength']))
    ai.setMaxcell(float(inputpd['ref_maxcel']))
    print "Deltaphi is",float(inputpd['deltaphi'])
    ai.setDeltaphi(float(inputpd['deltaphi'])*math.pi/180.)
    ai.setMosaicity(setting["mosaicity"])
    ai.setOrientation(setting["orient"])
    #why aren't hexagonal constraints applied here???
    print inputpd["osc_start"]

    image_centers = [(math.pi/180.)*float(x) for x in inputpd["osc_start"].values()]

    limiting_resolution = param.distl_highres_limit
    print "Limiting resolution",limiting_resolution

    #predict the spots
    spots = ai.predict_all(image_centers[0],limiting_resolution)
    pre2m = spots.vec3()
    self.pre2m = pre2m

    hkllist = spots.hkl()
    cell = ai.getOrientation().unit_cell()
    print cell
    for hkl in hkllist:
      #print "%25s %5.2f"%(str(hkl),cell.d(hkl))
      assert cell.d(hkl)>=limiting_resolution
    print "Number of hkls:",(hkllist).size(),
    print "all inside the %4.2f Angstrom limiting sphere."%limiting_resolution
    print "The unit cell is",cell
    self.solution_setting_ai = ai
    self.solution_pd = inputpd
    self.image_centers = image_centers
    self.one_setting = setting
    return [ai.getOrientation().unit_cell(),hkllist]