示例#1
0
 def intersect(m1,m2, use_average):
   maptbx.intersection(
     map_data_1 = m1,
     map_data_2 = m2,
     thresholds = flex.double([0,0.1,0.2,0.3,0.4,0.5]),
     average    = False)
   if(use_average): return (m1+m2)/2
   else:            return m1
示例#2
0
 def intersect(m1, m2, use_average):
     maptbx.intersection(map_data_1=m1,
                         map_data_2=m2,
                         thresholds=flex.double(
                             [0, 0.1, 0.2, 0.3, 0.4, 0.5]),
                         average=False)
     if (use_average): return (m1 + m2) / 2
     else: return m1
示例#3
0
def compute_map_and_combine(map_coeffs,
                            crystal_gridding,
                            map_data,
                            thresholds=[0, 0.1, 0.2, 0.3, 0.4, 0.5]):
    m = get_map(map_coeffs=map_coeffs, crystal_gridding=crystal_gridding)
    if (map_data is None): map_data = m
    else:
        maptbx.intersection(map_data_1=m,
                            map_data_2=map_data,
                            thresholds=flex.double(thresholds),
                            average=True)
    return map_data
示例#4
0
def compute_map_and_combine(
      map_coeffs,
      crystal_gridding,
      map_data,
      thresholds = [0,0.1,0.2,0.3,0.4,0.5]):
  m = get_map(map_coeffs=map_coeffs, crystal_gridding=crystal_gridding)
  if(map_data is None): map_data = m
  else:
    maptbx.intersection(
      map_data_1 = m,
      map_data_2 = map_data,
      thresholds = flex.double(thresholds),
      average    = True)
  return map_data
示例#5
0
def exercise_intersection():
  thresholds = flex.double([0,0.1,0.2,0.3,0.4,0.5, 0.6,0.7,0.8,0.8, 1.0])
  def get_map():
    av = [random.random() for i in xrange(10*20*30)]
    m = flex.double(av)
    m.resize(flex.grid((10,20,30)))
    return m
  m1 = get_map()
  m2 = get_map()
  for average in [True, False]:
    maptbx.intersection(
      map_data_1 = m1,
      map_data_2 = m2,
      thresholds = thresholds,
      average    = average)