Ejemplo n.º 1
0
from __future__ import division
from __future__ import print_function

from scitbx.array_family import flex
from dials.model.data import Reflection, ReflectionList
from dials.algorithms import shoebox

rl = ReflectionList()
r1 = Reflection()
r1.shoebox = (10, 20, 10, 20, 10, 20)
r2 = Reflection()
r2.shoebox = (15, 25, 15, 25, 15, 25)
r3 = Reflection()
r3.shoebox = (20, 30, 20, 30, 20, 30)
rl.append(r1)
rl.append(r2)
rl.append(r3)
overlapping = shoebox.find_overlapping(rl)

for e in overlapping.edges():
    print("Edge: ", overlapping.edge_vertices(e))

for v in overlapping.vertices():
    print("Vertex: ", v, " => ", [a for a in overlapping.adjacent_vertices(v)])
Ejemplo n.º 2
0
from __future__ import division

from scitbx.array_family import flex
from dials.model.data import Reflection, ReflectionList
from dials.algorithms import shoebox

rl = ReflectionList()
r1 = Reflection()
r1.shoebox = (10, 20, 10, 20, 10, 20)
r2 = Reflection()
r2.shoebox = (15, 25, 15, 25, 15, 25)
r3 = Reflection()
r3.shoebox = (20, 30, 20, 30, 20, 30)
rl.append(r1)
rl.append(r2)
rl.append(r3)
overlapping = shoebox.find_overlapping(rl)

for e in overlapping.edges():
    print "Edge: ", overlapping.edge_vertices(e)

for v in overlapping.vertices():
    print "Vertex: ", v, " => ", [a for a in overlapping.adjacent_vertices(v)]
data2d = flex.double(flex.grid(1, 3, 3),15)
data2d[0, 1, 1] = 50

for row in range(3):
  for col in range(3):
    data2d[0,row, col] += row * 2
    data2d[0,row, col] += col * 2

mask2d = flex.int(flex.grid(1, 3, 3),3)
mask2d[0, 1, 1] = 5

background2d = flex.double(flex.grid(1, 3, 3),0)
from dials.model.data import Reflection, ReflectionList
from scitbx.array_family import flex
r = Reflection()
r.shoebox = data2d
r.shoebox_mask = mask2d
r.shoebox_background = background2d

rlist = ReflectionList()
rlist.append(r)

#from dials.algorithms.background.flat_background_subtractor \
# import layering_and_background_avg
#layering_and_background_avg(rlist)

#from dials.algorithms.background.curved_background_subtractor \
# import layering_and_background_modl
#layering_and_background_modl(rlist)

from dials.algorithms.background.inclined_background_subtractor \
data2d[0, 1, 1] = 50

for row in range(3):
    for col in range(3):
        data2d[0, row, col] += row * 2
        data2d[0, row, col] += col * 2

mask2d = flex.int(flex.grid(1, 3, 3), 3)
mask2d[0, 1, 1] = 5

background2d = flex.double(flex.grid(1, 3, 3), 0)
from dials.model.data import Reflection, ReflectionList
from scitbx.array_family import flex

r = Reflection()
r.shoebox = data2d
r.shoebox_mask = mask2d
r.shoebox_background = background2d

rlist = ReflectionList()
rlist.append(r)

# from dials.algorithms.background.flat_background_subtractor \
# import layering_and_background_avg
# layering_and_background_avg(rlist)

# from dials.algorithms.background.curved_background_subtractor \
# import layering_and_background_modl
# layering_and_background_modl(rlist)

from dials.algorithms.background.inclined_background_subtractor import (