Page History
...
Test print shows that everything looks as expected:
Code Block |
---|
# Triclinic3-d crystalspace cellprimitive parametersvectors: # aa1 = ( 18.55550000, A # 0.000000, b = 27.19 A0.000000) # ca2 = ( 4-5.86435624, A # 26.645524, alpha = 90.00 deg0.000000) # betaa3 = 90.00 deg # ( 0.000000, 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
0.000000, 4.860100) |
Reciprocal space primitive vectors
b1, b2, b3 = reciprocal_from_bravias(a1, a2, a3)
- converts 3-d primitive vectors to reciprocal space primitive vectors.
...
Code Block |
---|
# reciprocal space primitive vectors: # b1 = [( 0.05390836053908, 0.01099718010997, -0.000000) # b2 = ( ] #0.000000, b2 = [ 0. 037530, 0.03752976 0. ]0.000000) # b3 = [( 0. 000000, -0.000000, 0.20575708]205757) |
Lattice generator and test
...
Code Block |
---|
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 |
...
Table of
...
Both in test_lattice
and make_lookup_table
methods crystal lattice in reciprocal space is rotated around Z and Y axes by lattice node parameters sorted by radius
Code Block |
---|
( h, k) R(h,k)[1/A] ( 0, 0) 0.0000 ( 0, 1) 0.0375 ( 1, xrot10) 0.0550 (-1, 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:
1) 0.0601
( 1, 1) 0.0725
( 0, 2) 0.0751
(-1, 2) 0.0837
( 1, 2) 0.1015
(-2, 1) 0.1089
( 2, 0) 0.1100
( 0, 3) 0.1126
(-1, 3) 0.1150
(-2, 2) 0.1202
( 2, 1) 0.1232
( 1, 3) 0.1348
(-2, 3) 0.1408
( 2, 2) 0.1451
(-1, 4) 0.1492
( 0, 4) 0.1501
(-3, 1) 0.1618
( 3, 0) 0.1651
(-3, 2) 0.1671
(-2, 4) 0.1675
( 1, 4) 0.1699
( 2, 3) 0.1724
( 3, 1) 0.1764
(-3, 3) 0.1803
(-1, 5) 0.1847
( 0, 5) 0.1876
( 3, 2) 0.1945
(-2, 5) 0.1977
(-3, 4) 0.1997
( 2, 4) 0.2031
( 1, 5) 0.2058
(-4, 1) 0.2157
( 3, 3) 0.2176
(-4, 2) 0.2179
( 4, 0) 0.2201
(-1, 6) 0.2209
(-3, 5) 0.2238
( 0, 6) 0.2252
(-4, 3) 0.2263
(-2, 6) 0.2300
( 4, 1) 0.2305
( 2, 5) 0.2357
(-4, 4) 0.2403
( 1, 6) 0.2423
( 3, 4) 0.2443
( 4, 2) 0.2463
(-3, 6) 0.2512
(-4, 5) 0.2591
( 4, 3) 0.2665
( 2, 6) 0.2697
( 3, 5) 0.2736
(-4, 6) 0.2817
( 4, 4) 0.2901
( 3, 6) 0.3046
( 4, 5) 0.3165
( 4, 6) 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 omega_deg and beta_deg, respectively using calls:
Code Block |
---|
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:
Code Block |
---|
xrot2.shape: (13, 9) |
Code Block |
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.15910504 -0.11940106 -0.07960292 -0.03980690 0.00001088 0.03981485 0.07961883 0.11942281 0.15912679 row: -0.17730685 -0.13750287 -0.09770111 -0.05790508 -0.01810906 0.02171304 0.06141702 0.10122100 0.14102498 row: -0.19540866 -0.15560469 -0.11580071 -0.07600327 -0.03630725 0.00351123 0.04331521 0.08311919 0.12292316 row: -0.21351048 -0.17370650 -0.13390252 -0.09420146 -0.0544 - 0.01460942 0.02521339 0.06501737 0.10482135 row: -0.23161229 -0.19190831 -0.15210433 -0.11230035 -0.07250363 -0.03270760 0.00711158 0.04691556 0.08661954 row: -0.24981410 -0.21001012 -0.17020614 -0.13040217 -0.09060181 -0.05080579 -0.01110977 0.02871375 0.06851773 row: -0.26791591 -0.22811194 -0.18830796 -0.14850398 -0.10880000 -0.06900398 -0.02920796 0.01061194 0.05041591 yrot1.shape: (13, 9) row: -0.34091773 -0.30441375 -0.26800977 -0.23150579 -0.19500181 -0.15850217 -0.12210614 -0.08561012 -0.04911410 row: -0.30841954 -0.27191556 -0.23551158 -0.19900760 -0.16250363 -0.12600035 - 0.08960433 -0.05310831 -0.01661229 row: -0.27592135 -0.23941737 -0.20301339 -0.16650942 -0.13000544 -0.09350146 -0.05710252 -0.02060650 0.01591048 row: -0.24342316 -0.20691919 -0.17051521 -0.13401123 -0.09750725 -0.06100327 -0.02450071 0.01190469 0.04840866 row: -0.21092498 -0.17442100 -0.13801702 -0.10151304 -0.06500906 -0.02850508 -0.00800111 0.04440287 0.08090685 row: -0.17842679 -0.14192281 -0.10551883 -0.06901485 -0.03251088 -0.00400690 -0.04050292 0.07690106 0.11340504 row yrot1.shape: (13, 9) row: -0.14593409 -0.10943044 -0.07302680 -0.03652315 -0.00001950 -0.03651585 -0.07301221 -0.10940856 -0.14590491 row: -0.11343084 -0.07692719 -0.04052355 -0.00401990 -0.03251625 -0.06901260 -0.10550896 -0.14190531 -0.17840166 row: -0.08092759 -0.04442394 -0.00802030 -0.02851665 -0.06501300 -0.10150935 -0.13800571 -0.17440206 0.21090159 row: -0.04842434 -0.01192069 -0.02451705 -0.06101340 -0.0975 -0.13400610 -0.17050245 0.20690119 0.24340484 row: -0.01592109 -0.02061744 -0.05711380 -0.09351015 -0.13000650 -0.16650285 0.20300080 0.23940444 0.27590809 row: -0.01661784 -0.05311419 -0.08961055 -0.12600690 -0.16250325 0.19900040 0.23550405 0.27190769 0.30841134 row: -0.04911459 -0.08561094 -0.12210730 -0.15850365 0.19500000 0.23150365 0.26800730 0.30441094 0.3409 zrot2.shape: (13, 9)1459 row: -0.01351134 -0.00280769 -0.00780405 -0.01850040 0.02910325 0.03980690 0.05051055 0.06111419 0.07181784 row: -0.01840809 -0.00770444 -0.00300080 0.01360285 0.02430650 0.03491015 0.04561380 0.05631744 0.06692109 row: -0.02320484 -0.01260119 -0.00190245 0.00880610 0.01940975 0.03011340 0.04071705 0.05142069 0.06212434 row: -0.02810159 -0.01740206 -0.00680571 0.00390935 0.01461300 0.02521665 0.03592030 0.04662394 0.05722759 row: - 0.03290166 -0.02230531 -0.01160896 -0.00091260 0.00971625 0.02041990 0.03102355 0.04172719 0.05243084 row: - 0.03780491 -0.02710856 -0.01651221 -0.00581585 0.00491950 0.01552315 0.02622680 0.03683044 0.04753409 zrot2.shape: (13, 9) row: -0.04260135 -0.03200028 -0.02130078 -0.01070185 0.00000291 0.01070398 0.02130505 0.03200611 0.04260718 row: -0.04750184 -0.03680077 -0.02620030 -0.01550136 -0.00490243 0.00580349 0.01650456 0.02710563 0.03780669 row: -0.05240232 -0.04170126 -0.03100019 -0.02040088 -0.00970194 0.00090301 0.01160407 0.02230514 0.03290621 row: -0.05720281 -0.04660174 -0.03590068 -0.02520039 -0.0146 - 0.00390252 0.00680359 0.01740466 0.02810572 row: -0.06210329 -0.05140223 -0.04070116 -0.03010009 -0.01940097 -0.00880204 0.00190310 0.01260417 0.02320524 row: -0.06690378 -0.05630271 -0.04560165 -0.03490058 -0.02430049 -0.01360155 -0.00300262 0.00770368 0.01840475 row: -0.07180426 -0.06110320 -0.0213 -0.0107 0.0000 0.0107 0.0213 0.0320 0.0426 row: -0.05050475 -0.03980368 -0.02910262 -0.01850155 -0.0049 0.0058 0.00780165 0.00280271 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
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 |
Rotation in test_lattice
for omega_deg = 0; beta_deg = 9 produces the plot
Look-up table
Look-up table is generated in method make_lookup_table
_v2 called as
lut = make_lookup_table_v2(b1, b2, b3, hmax, kmax, lmax, np.float32, evald_rad, sigma_ql,
sigma_qt,
fout, bpq, bpomega, bpbeta)
NOTE v2
: In order to tune tolerance separately for angle and detector plane (qh, qv) parameter sigma_q in v2 is split for sigma_ql and sigma_qt
using parameters
Code Block |
---|
# photon energy = 6003.1936 eV
# wavelength = 2.0653 A
# wave number/Evald radius k = 1/lambda = 0.484187 1/A
# sigma_ql = 0.001453 1/A (approximately = k * <pixel size>/
# sigma_qt = 0.000484 1/A (approximately = k * <pixel size>/<sample-to-detector distance> = k*100um/100mm)
# 3*sigma_ql = 0.004358 1/A
# 3*sigma_qt = 0.001453 1/A |
for each crystal orientation in omega_deg and beta_deg method
...
dr [1/A] - distance between lattice node and Evald's sphere along the scattered photon propagation,
qv, qh [1/A] - vertical and horizontal components of scattering vector q.
in using a simple code:
Code Block |
---|
# NOTE: X, Y, Z, DX, L, dr, qv, qh, ql are the numpy arrays with shape=(2*hmax+1, 2*kmax+1, 2*lmax+1), evald_rad is a scalar
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 table
there are two calls:
txt = str_omega_drhkl(ind, beta_deg, omega_deg, dr, r, qv, qh, h, k, l, sigma_ql)
...