Ejemplo n.º 1
0
__author__ = 'christopher'

# atoms = Atoms('Au4', [[0, 0, 0], [3, 0, 0], [0, 3, 0], [3, 3, 0]])
atoms = ase.io.read('/mnt/work-data/dev/IID_data/db_test/PDF_LAMMPS_587.traj')
scat = ElasticScatter()
scat.update_experiment({'qmax': 8, 'qmin': .5})
s = scat.get_scatter_vector()

k = 100
i_max, j_max = k, k

pixel_array = np.zeros((i_max, j_max))
for i in range(i_max):
    for j in range(j_max):
        pixel_array[i, j] = np.sqrt(i**2 + j**2)

pixel_array /= np.max(pixel_array)
pixel_array *= np.max(s)

img = scat.get_2d_scatter(atoms, pixel_array)
print img.shape

# plt.imshow(pixel_array)
print np.max(img), np.min(img)
plt.imshow(img, aspect='auto')
plt.colorbar()
plt.show()

plt.plot(scat.get_iq(atoms))
plt.show()
Ejemplo n.º 2
0
# atoms = Atoms('Au4', [[0, 0, 0], [3, 0, 0], [0, 3, 0], [3, 3, 0]])
atoms = ase.io.read('/mnt/work-data/dev/IID_data/db_test/PDF_LAMMPS_587.traj')
scat = ElasticScatter()
scat.update_experiment({'qmax': 8, 'qmin': .5})
s = scat.get_scatter_vector()

k = 100
i_max, j_max = k, k

pixel_array = np.zeros((i_max, j_max))
for i in range(i_max):
    for j in range(j_max):
        pixel_array[i, j] = np.sqrt(i ** 2 + j ** 2)

pixel_array /= np.max(pixel_array)
pixel_array *= np.max(s)

img = scat.get_2d_scatter(atoms, pixel_array)
print img.shape


# plt.imshow(pixel_array)
print np.max(img), np.min(img)
plt.imshow(img, aspect='auto')
plt.colorbar()
plt.show()

plt.plot(scat.get_iq(atoms))
plt.show()