Content
Problem
Meng sees a problem with interpretation of data. She observes in data large sample of events which have 2-peaks in the qH around two most probable positions 1.1 and 1.7 1/Å. In contrast, our model of lattice does not show these peaks simultaneously.
There may be different explanation of this problem:
- errors in generation of lattice,
- errors in generation of look-up table,
- errors in indexing - association of data with look-up table,
- wrong lattice model.
A few crosschecks are presented below in order to address this issue.
Lattice
Triclinic crystal cell primitive vectors
We use a few methods from pyimgalgos.FiberIndexing
to generate lattice:
triclinic_primitive_vectors
- generates triclinic crystal cell primitive vectors:
a= 18.55 # Angstrom b, c = 1.466*a, 0.262*a # Angstrom alpha, beta, gamma = 90, 90, 78.47 # 180 - 101.53 degree a1, a2, a3 = triclinic_primitive_vectors(a, b, c, alpha, beta, gamma)
Test print shows that everything looks as expected:
# Triclinic crystal cell parameters: # a = 18.55 A # b = 27.19 A # c = 4.86 A # alpha = 90.00 deg # beta = 90.00 deg # gamma = 78.47 deg # 3-d space primitive vectors: # a1 = (18.55, 0.0, 0.0) # a2 = (-5.435623727109098, 26.645523961582906, 0.0) # a3 = (0.0, 0.0, 4.8601)
Reciprocal space primitive vectors
b1, b2, b3 = reciprocal_from_bravias(a1, a2, a3)
- converts 3-d primitive vectors to reciprocal space primitive vectors.
Test print shows that everything looks as expected:
# reciprocal space primitive vectors: # b1 = [ 0.05390836 0.01099718 -0. ] # b2 = [ 0. 0.03752976 0. ] # b3 = [ 0. -0. 0.20575708]
Lattice generator and test
Then, call to method
x, y, z, r, h, k, l = lattice(b1, b2, b3, hmax, kmax, lmax, cdtype)
returns 2-d (or 3-d if lmax>0) arrays. They are tested by
hmax, kmax, lmax = 4, 6, 0 # size of lattice to consider # 2-d lattice test test_lattice (b1, b2, b3, hmax, kmax, lmax, cdtype=np.float32, do_plot=True, evald_rad=evald_rad, prefix=prefix) lattice_node_radius(b1, b2, b3, hmax, kmax, lmax, cdtype=np.float32)
Output of this 2-d test looks as expected:
h.shape: (13, 9) row: -4 -3 -2 -1 0 1 2 3 4 row: -4 -3 -2 -1 0 1 2 3 4 row: -4 -3 -2 -1 0 1 2 3 4 row: -4 -3 -2 -1 0 1 2 3 4 row: -4 -3 -2 -1 0 1 2 3 4 row: -4 -3 -2 -1 0 1 2 3 4 row: -4 -3 -2 -1 0 1 2 3 4 row: -4 -3 -2 -1 0 1 2 3 4 row: -4 -3 -2 -1 0 1 2 3 4 row: -4 -3 -2 -1 0 1 2 3 4 row: -4 -3 -2 -1 0 1 2 3 4 row: -4 -3 -2 -1 0 1 2 3 4 row: -4 -3 -2 -1 0 1 2 3 4 k.shape: (13, 9) row: -6 -6 -6 -6 -6 -6 -6 -6 -6 row: -5 -5 -5 -5 -5 -5 -5 -5 -5 row: -4 -4 -4 -4 -4 -4 -4 -4 -4 row: -3 -3 -3 -3 -3 -3 -3 -3 -3 row: -2 -2 -2 -2 -2 -2 -2 -2 -2 row: -1 -1 -1 -1 -1 -1 -1 -1 -1 row: 0 0 0 0 0 0 0 0 0 row: 1 1 1 1 1 1 1 1 1 row: 2 2 2 2 2 2 2 2 2 row: 3 3 3 3 3 3 3 3 3 row: 4 4 4 4 4 4 4 4 4 row: 5 5 5 5 5 5 5 5 5 row: 6 6 6 6 6 6 6 6 6 l.shape: (13, 9) row: 0 0 0 0 0 0 0 0 0 row: 0 0 0 0 0 0 0 0 0 row: 0 0 0 0 0 0 0 0 0 row: 0 0 0 0 0 0 0 0 0 row: 0 0 0 0 0 0 0 0 0 row: 0 0 0 0 0 0 0 0 0 row: 0 0 0 0 0 0 0 0 0 row: 0 0 0 0 0 0 0 0 0 row: 0 0 0 0 0 0 0 0 0 row: 0 0 0 0 0 0 0 0 0 row: 0 0 0 0 0 0 0 0 0 row: 0 0 0 0 0 0 0 0 0 row: 0 0 0 0 0 0 0 0 0 x coords.shape: (13, 9) row: -0.2156 -0.1617 -0.1078 -0.0539 0.0000 0.0539 0.1078 0.1617 0.2156 row: -0.2156 -0.1617 -0.1078 -0.0539 0.0000 0.0539 0.1078 0.1617 0.2156 row: -0.2156 -0.1617 -0.1078 -0.0539 0.0000 0.0539 0.1078 0.1617 0.2156 row: -0.2156 -0.1617 -0.1078 -0.0539 0.0000 0.0539 0.1078 0.1617 0.2156 row: -0.2156 -0.1617 -0.1078 -0.0539 0.0000 0.0539 0.1078 0.1617 0.2156 row: -0.2156 -0.1617 -0.1078 -0.0539 0.0000 0.0539 0.1078 0.1617 0.2156 row: -0.2156 -0.1617 -0.1078 -0.0539 0.0000 0.0539 0.1078 0.1617 0.2156 row: -0.2156 -0.1617 -0.1078 -0.0539 0.0000 0.0539 0.1078 0.1617 0.2156 row: -0.2156 -0.1617 -0.1078 -0.0539 0.0000 0.0539 0.1078 0.1617 0.2156 row: -0.2156 -0.1617 -0.1078 -0.0539 0.0000 0.0539 0.1078 0.1617 0.2156 row: -0.2156 -0.1617 -0.1078 -0.0539 0.0000 0.0539 0.1078 0.1617 0.2156 row: -0.2156 -0.1617 -0.1078 -0.0539 0.0000 0.0539 0.1078 0.1617 0.2156 row: -0.2156 -0.1617 -0.1078 -0.0539 0.0000 0.0539 0.1078 0.1617 0.2156 y coords.shape: (13, 9) row: -0.2692 -0.2582 -0.2472 -0.2362 -0.2252 -0.2142 -0.2032 -0.1922 -0.1812 row: -0.2316 -0.2206 -0.2096 -0.1986 -0.1876 -0.1767 -0.1657 -0.1547 -0.1437 row: -0.1941 -0.1831 -0.1721 -0.1611 -0.1501 -0.1391 -0.1281 -0.1171 -0.1061 row: -0.1566 -0.1456 -0.1346 -0.1236 -0.1126 -0.1016 -0.0906 -0.0796 -0.0686 row: -0.1190 -0.1081 -0.0971 -0.0861 -0.0751 -0.0641 -0.0531 -0.0421 -0.0311 row: -0.0815 -0.0705 -0.0595 -0.0485 -0.0375 -0.0265 -0.0155 -0.0045 0.0065 row: -0.0440 -0.0330 -0.0220 -0.0110 0.0000 0.0110 0.0220 0.0330 0.0440 row: -0.0065 0.0045 0.0155 0.0265 0.0375 0.0485 0.0595 0.0705 0.0815 row: 0.0311 0.0421 0.0531 0.0641 0.0751 0.0861 0.0971 0.1081 0.1190 row: 0.0686 0.0796 0.0906 0.1016 0.1126 0.1236 0.1346 0.1456 0.1566 row: 0.1061 0.1171 0.1281 0.1391 0.1501 0.1611 0.1721 0.1831 0.1941 row: 0.1437 0.1547 0.1657 0.1767 0.1876 0.1986 0.2096 0.2206 0.2316 row: 0.1812 0.1922 0.2032 0.2142 0.2252 0.2362 0.2472 0.2582 0.2692 z coords.shape: (13, 9) row: 0.0000 0.0000 0.0000 0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 row: 0.0000 0.0000 0.0000 0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 row: 0.0000 0.0000 0.0000 0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 row: 0.0000 0.0000 0.0000 0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 row: 0.0000 0.0000 0.0000 0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 row: 0.0000 0.0000 0.0000 0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 row: 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 row: 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 row: 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 row: 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 row: 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 row: 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 row: 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 r of lattice nodes.shape: (13, 9) row: 0.3449 0.3046 0.2697 0.2423 0.2252 0.2209 0.2300 0.2512 0.2817 row: 0.3165 0.2736 0.2357 0.2058 0.1876 0.1847 0.1977 0.2238 0.2591 row: 0.2901 0.2443 0.2031 0.1699 0.1501 0.1492 0.1675 0.1997 0.2403 row: 0.2665 0.2176 0.1724 0.1348 0.1126 0.1150 0.1408 0.1803 0.2263 row: 0.2463 0.1945 0.1451 0.1015 0.0751 0.0837 0.1202 0.1671 0.2179 row: 0.2305 0.1764 0.1232 0.0725 0.0375 0.0601 0.1089 0.1618 0.2157 row: 0.2201 0.1651 0.1100 0.0550 0.0000 0.0550 0.1100 0.1651 0.2201 row: 0.2157 0.1618 0.1089 0.0601 0.0375 0.0725 0.1232 0.1764 0.2305 row: 0.2179 0.1671 0.1202 0.0837 0.0751 0.1015 0.1451 0.1945 0.2463 row: 0.2263 0.1803 0.1408 0.1150 0.1126 0.1348 0.1724 0.2176 0.2665 row: 0.2403 0.1997 0.1675 0.1492 0.1501 0.1699 0.2031 0.2443 0.2901 row: 0.2591 0.2238 0.1977 0.1847 0.1876 0.2058 0.2357 0.2736 0.3165 row: 0.2817 0.2512 0.2300 0.2209 0.2252 0.2423 0.2697 0.3046 0.3449
Rotation of the crystal lattice
Both in test_lattice
and make_lookup_table
methods crystal lattice in reciprocal space is rotated around Z and Y axes by
xrot1, yrot1 = rotation(x, y, omega_deg) xrot2, zrot2 = rotation(xrot1, z, beta_deg)
Rotation in test_lattice
for omega_deg = 30; beta_deg = 15
gives consistent results:
xrot2.shape: (13, 9) row: -0.0504 -0.0106 0.0292 0.0690 0.1088 0.1485 0.1883 0.2281 0.2679 row: -0.0685 -0.0287 0.0111 0.0508 0.0906 0.1304 0.1702 0.2100 0.2498 row: -0.0866 -0.0469 -0.0071 0.0327 0.0725 0.1123 0.1521 0.1919 0.2316 row: -0.1048 -0.0650 -0.0252 0.0146 0.0544 0.0942 0.1339 0.1737 0.2135 row: -0.1229 -0.0831 -0.0433 -0.0035 0.0363 0.0760 0.1158 0.1556 0.1954 row: -0.1410 -0.1012 -0.0614 -0.0217 0.0181 0.0579 0.0977 0.1375 0.1773 row: -0.1591 -0.1194 -0.0796 -0.0398 0.0000 0.0398 0.0796 0.1194 0.1591 row: -0.1773 -0.1375 -0.0977 -0.0579 -0.0181 0.0217 0.0614 0.1012 0.1410 row: -0.1954 -0.1556 -0.1158 -0.0760 -0.0363 0.0035 0.0433 0.0831 0.1229 row: -0.2135 -0.1737 -0.1339 -0.0942 -0.0544 -0.0146 0.0252 0.0650 0.1048 row: -0.2316 -0.1919 -0.1521 -0.1123 -0.0725 -0.0327 0.0071 0.0469 0.0866 row: -0.2498 -0.2100 -0.1702 -0.1304 -0.0906 -0.0508 -0.0111 0.0287 0.0685 row: -0.2679 -0.2281 -0.1883 -0.1485 -0.1088 -0.0690 -0.0292 0.0106 0.0504 yrot1.shape: (13, 9) row: -0.3409 -0.3044 -0.2680 -0.2315 -0.1950 -0.1585 -0.1221 -0.0856 -0.0491 row: -0.3084 -0.2719 -0.2355 -0.1990 -0.1625 -0.1260 -0.0896 -0.0531 -0.0166 row: -0.2759 -0.2394 -0.2030 -0.1665 -0.1300 -0.0935 -0.0571 -0.0206 0.0159 row: -0.2434 -0.2069 -0.1705 -0.1340 -0.0975 -0.0610 -0.0245 0.0119 0.0484 row: -0.2109 -0.1744 -0.1380 -0.1015 -0.0650 -0.0285 0.0080 0.0444 0.0809 row: -0.1784 -0.1419 -0.1055 -0.0690 -0.0325 0.0040 0.0405 0.0769 0.1134 row: -0.1459 -0.1094 -0.0730 -0.0365 0.0000 0.0365 0.0730 0.1094 0.1459 row: -0.1134 -0.0769 -0.0405 -0.0040 0.0325 0.0690 0.1055 0.1419 0.1784 row: -0.0809 -0.0444 -0.0080 0.0285 0.0650 0.1015 0.1380 0.1744 0.2109 row: -0.0484 -0.0119 0.0245 0.0610 0.0975 0.1340 0.1705 0.2069 0.2434 row: -0.0159 0.0206 0.0571 0.0935 0.1300 0.1665 0.2030 0.2394 0.2759 row: 0.0166 0.0531 0.0896 0.1260 0.1625 0.1990 0.2355 0.2719 0.3084 row: 0.0491 0.0856 0.1221 0.1585 0.1950 0.2315 0.2680 0.3044 0.3409 zrot2.shape: (13, 9) row: -0.0135 -0.0028 0.0078 0.0185 0.0291 0.0398 0.0505 0.0611 0.0718 row: -0.0184 -0.0077 0.0030 0.0136 0.0243 0.0349 0.0456 0.0563 0.0669 row: -0.0232 -0.0126 -0.0019 0.0088 0.0194 0.0301 0.0407 0.0514 0.0621 row: -0.0281 -0.0174 -0.0068 0.0039 0.0146 0.0252 0.0359 0.0466 0.0572 row: -0.0329 -0.0223 -0.0116 -0.0009 0.0097 0.0204 0.0310 0.0417 0.0524 row: -0.0378 -0.0271 -0.0165 -0.0058 0.0049 0.0155 0.0262 0.0368 0.0475 row: -0.0426 -0.0320 -0.0213 -0.0107 0.0000 0.0107 0.0213 0.0320 0.0426 row: -0.0475 -0.0368 -0.0262 -0.0155 -0.0049 0.0058 0.0165 0.0271 0.0378 row: -0.0524 -0.0417 -0.0310 -0.0204 -0.0097 0.0009 0.0116 0.0223 0.0329 row: -0.0572 -0.0466 -0.0359 -0.0252 -0.0146 -0.0039 0.0068 0.0174 0.0281 row: -0.0621 -0.0514 -0.0407 -0.0301 -0.0194 -0.0088 0.0019 0.0126 0.0232 row: -0.0669 -0.0563 -0.0456 -0.0349 -0.0243 -0.0136 -0.0030 0.0077 0.0184 row: -0.0718 -0.0611 -0.0505 -0.0398 -0.0291 -0.0185 -0.0078 0.0028 0.0135
Look-up table
Look-up table is generated in method make_lookup_table
called as
lut = make_lookup_table(b1, b2, b3, hmax, kmax, lmax, np.float32, evald_rad, sigma_ql,
sigma_qt,
fout, bpq, bpomega, bpbeta)
NOTE: In order to tune tolerance separately for angle and detector plane (qh, qv) parameter sigma_q is split for sigma_ql and sigma_qt
for each crystal orientation in omega_deg and beta_deg method
dr, qv, qh = radial_distance(xrot2, yrot1, zrot2, evald_rad)
evaluates
dr [1/A] - distance between lattice node and Evald's sphere
qv, qh [1/A] - vertical and horizontal components of scattering vector q
in a simple code:
def radial_distance(X, Y, Z, evald_rad=0.5) : DX = X + evald_rad L = np.sqrt(DX*DX + Y*Y + Z*Z) dr = L - evald_rad qv = evald_rad * Z/L ql = evald_rad * (DX/L-1) qy = evald_rad * Y/L qh = np.sqrt(ql*ql + qy*qy) * np.select([Y<0], [-1], default=1) return dr, qv, qh
Finally, in method make_lookup_table
txt = str_omega_drhkl(ind, beta_deg, omega_deg, dr, r, qv, qh, h, k, l, sigma_ql)
generates text record for file with look-up table, and
lut[iomega,:] += fill_row(dr, qv, qh, h, k, l, sigma_ql
, sigma_qt
, bpq)
generates 2-d array, which presents look-up table in 2-d plot and its projection: