Esempio n. 1
0
data2d_tmp = ref2d.as_numpy_array()
data2d[:, :] += numpy.float64(data2d_tmp)


#n = write_2d(flex.double(data2d))


from matplotlib import pyplot as plt
print "Plotting data2d"
plt.imshow(data2d, interpolation = "nearest")
plt.show()



n_times = 1
data2dsmoth_tmp = smooth_2d(flex.int(data2d), n_times).as_numpy_array()
data2dsmoth = numpy.float64(data2dsmoth_tmp)


n_times = 5
data2dsmoth_2t_tmp = smooth_2d(flex.int(data2d), n_times).as_numpy_array()
data2dsmoth_2t = numpy.float64(data2dsmoth_2t_tmp)


#n = write_2d(flex.double(data2dsmoth))

print "Plotting data2dsmoth"
plt.imshow(data2dsmoth, interpolation = "nearest", cmap = pylab.gray())
plt.show()

Esempio n. 2
0
data2d = flex.int(flex.grid(550, 950))
for x_loc in range(950):
  for y_loc in range(550):
    data2d[y_loc, x_loc] = int(np_data2d[y_loc, x_loc])


#'''
#    code that will become production code:
#    from data2d flex array that contains an image
#    it should return a flex array with the mask

from dials.algorithms.peak_finding import smooth_2d
from dials.algorithms.peak_finding import find_mask_2d
n_times = 3
data2dsmoth = smooth_2d(data2d, n_times)
mask2d = find_mask_2d(data2d, data2dsmoth, n_times)

# end code that will become production code


from matplotlib import pyplot as plt
col_from = 0
col_to = 950
row_from = 0
row_to = 550

print "Plotting data2d"
data2d = data2d.as_numpy_array()
data2d = data2d[row_from:row_to,col_from:col_to]
plt.imshow(data2d, interpolation = "nearest")
Esempio n. 3
0
data2d = flex.int(flex.grid(550, 950))
for x_loc in range(950):
    for y_loc in range(550):
        data2d[y_loc, x_loc] = int(np_data2d[y_loc, x_loc])

#'''
#    code that will become production code:
#    from data2d flex array that contains an image
#    it should return a flex array with the mask

from dials.algorithms.peak_finding import smooth_2d
from dials.algorithms.peak_finding import find_mask_2d

n_times = 3
data2dsmoth = smooth_2d(data2d, n_times)
mask2d = find_mask_2d(data2d, data2dsmoth, n_times)

# end code that will become production code

from matplotlib import pyplot as plt

col_from = 0
col_to = 950
row_from = 0
row_to = 550

print("Plotting data2d")
data2d = data2d.as_numpy_array()
data2d = data2d[row_from:row_to, col_from:col_to]
plt.imshow(data2d, interpolation="nearest")