Ejemplo n.º 1
0
 def _filter_by_sphericity(self):
     sel = flex.bool(self.xrs_water.scatterers().size(), False)
     for i, site_frac in enumerate(self.xrs_water.sites_frac()):
         site_cart = self.unit_cell.orthogonalize(site_frac)
         o = maptbx.sphericity_by_heuristics(map_data=self.map_data,
                                             unit_cell=self.unit_cell,
                                             center_cart=site_cart,
                                             radius=1.0)
         mi, ma, me = o.rho
         #if(self.debug):
         #  _debug_show_all_plots(
         #    map_data    = self.map_data,
         #    unit_cell   = self.unit_cell,
         #    center_cart = site_cart,
         #    radius      = 1.0,
         #    plot_number = str("%d_%4.2f_%4.2f"%(i, o.ccs[0],o2.ccs[0])))
         if (o.ccs[0] > self.scc):
             sel[i] = True
             #print i, "%6.3f %6.3f %6.3f"%mv.min_max_mean().as_tuple(),\
             #  "%6.3f %6.3f %6.3f"%ccs.min_max_mean().as_tuple(),\
             #  "%6.3f %6.3f %6.3f"%ccs2.min_max_mean().as_tuple()
         #  print(hoh_str%(i,i,sc[0],sc[1],sc[2]), file=of)
         #else:
         #  print(hoh_str%(i,i,sc[0],sc[1],sc[2]), file=of2)
         #  #print i, "%6.3f %6.3f %6.3f"%mv.min_max_mean().as_tuple(),\
         #  #  "%6.3f %6.3f %6.3f"%ccs.min_max_mean().as_tuple(),\
         #  #  "%6.3f %6.3f %6.3f"%ccs2.min_max_mean().as_tuple(), "<<< REJECTED"
     self.xrs_water = self.xrs_water.select(sel)
     self.ma.add("  peaks left: %d" % self.xrs_water.scatterers().size())
Ejemplo n.º 2
0
 def _show_peak_profiles(self):
     for i, site_frac in enumerate(self.sites_frac_water):
         site_cart = self.unit_cell.orthogonalize(site_frac)
         o = maptbx.sphericity_by_heuristics(map_data=self.map_data,
                                             unit_cell=self.unit_cell,
                                             center_cart=site_cart,
                                             radius=0.5)
         o2 = maptbx.sphericity_by_heuristics(map_data=self.map_data,
                                              unit_cell=self.unit_cell,
                                              center_cart=site_cart,
                                              radius=1.0)
         _debug_show_all_plots(
             map_data=self.map_data,
             unit_cell=self.unit_cell,
             center_cart=site_cart,
             radius=1.0,
             plot_number=str("%d_%4.2f_%4.2f" %
                             (i + 1, o.ccs[0], o2.ccs[0])))
Ejemplo n.º 3
0
 def _filter_by_sphericity(self):
     tmp = flex.vec3_double()
     for i, site_frac in enumerate(self.sites_frac_water):
         site_cart = self.unit_cell.orthogonalize(site_frac)
         # XXX make it so it is called once! XXX
         o = maptbx.sphericity_by_heuristics(map_data=self.map_data,
                                             unit_cell=self.unit_cell,
                                             center_cart=site_cart,
                                             radius=0.5)
         o2 = maptbx.sphericity_by_heuristics(map_data=self.map_data,
                                              unit_cell=self.unit_cell,
                                              center_cart=site_cart,
                                              radius=1.0)
         mi, ma, me = o.rho
         if (self.debug):
             _debug_show_all_plots(
                 map_data=self.map_data,
                 unit_cell=self.unit_cell,
                 center_cart=site_cart,
                 radius=1.0,
                 plot_number=str("%d_%4.2f_%4.2f" %
                                 (i, o.ccs[0], o2.ccs[0])))
         fl = (mi > 0 and ma > 0 and me > 0 and o.ccs[0] > 0.95
               and o2.ccs[0] > 0.90)
         if (fl):
             tmp.append(site_frac)
             #print i, "%6.3f %6.3f %6.3f"%mv.min_max_mean().as_tuple(),\
             #  "%6.3f %6.3f %6.3f"%ccs.min_max_mean().as_tuple(),\
             #  "%6.3f %6.3f %6.3f"%ccs2.min_max_mean().as_tuple()
         #  print(hoh_str%(i,i,sc[0],sc[1],sc[2]), file=of)
         #else:
         #  print(hoh_str%(i,i,sc[0],sc[1],sc[2]), file=of2)
         #  #print i, "%6.3f %6.3f %6.3f"%mv.min_max_mean().as_tuple(),\
         #  #  "%6.3f %6.3f %6.3f"%ccs.min_max_mean().as_tuple(),\
         #  #  "%6.3f %6.3f %6.3f"%ccs2.min_max_mean().as_tuple(), "<<< REJECTED"
     self.sites_frac_water = tmp
     self.ma.add("  peaks left: %d" % self.sites_frac_water.size())