[6272968] | 1 | r""" |
---|
[b0c4271] | 2 | Definition |
---|
| 3 | ---------- |
---|
| 4 | |
---|
[a5d0d00] | 5 | Calculates the scattering from a **body-centered cubic lattice** with |
---|
| 6 | paracrystalline distortion. Thermal vibrations are considered to be negligible, |
---|
| 7 | and the size of the paracrystal is infinitely large. Paracrystalline distortion |
---|
| 8 | is assumed to be isotropic and characterized by a Gaussian distribution. |
---|
[754c454] | 9 | |
---|
[a5d0d00] | 10 | The scattering intensity $I(q)$ is calculated as |
---|
[754c454] | 11 | |
---|
[eb69cce] | 12 | .. math:: |
---|
[754c454] | 13 | |
---|
[eb69cce] | 14 | I(q) = \frac{\text{scale}}{V_p} V_\text{lattice} P(q) Z(q) |
---|
[754c454] | 15 | |
---|
| 16 | |
---|
[eb69cce] | 17 | where *scale* is the volume fraction of spheres, $V_p$ is the volume of the |
---|
| 18 | primary particle, $V_\text{lattice}$ is a volume correction for the crystal |
---|
[a5d0d00] | 19 | structure, $P(q)$ is the form factor of the sphere (normalized), and $Z(q)$ |
---|
| 20 | is the paracrystalline structure factor for a body-centered cubic structure. |
---|
[754c454] | 21 | |
---|
[b0c4271] | 22 | Equation (1) of the 1990 reference\ [#CIT1990]_ is used to calculate $Z(q)$, |
---|
| 23 | using equations (29)-(31) from the 1987 paper\ [#CIT1987]_ for $Z1$, $Z2$, and |
---|
| 24 | $Z3$. |
---|
[754c454] | 25 | |
---|
[a5d0d00] | 26 | The lattice correction (the occupied volume of the lattice) for a |
---|
| 27 | body-centered cubic structure of particles of radius $R$ and nearest neighbor |
---|
| 28 | separation $D$ is |
---|
[754c454] | 29 | |
---|
[eb69cce] | 30 | .. math:: |
---|
[754c454] | 31 | |
---|
[a5d0d00] | 32 | V_\text{lattice} = \frac{16\pi}{3} \frac{R^3}{\left(D\sqrt{2}\right)^3} |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | The distortion factor (one standard deviation) of the paracrystal is included |
---|
| 36 | in the calculation of $Z(q)$ |
---|
| 37 | |
---|
[eb69cce] | 38 | .. math:: |
---|
[a5d0d00] | 39 | |
---|
| 40 | \Delta a = g D |
---|
| 41 | |
---|
| 42 | where $g$ is a fractional distortion based on the nearest neighbor distance. |
---|
[754c454] | 43 | |
---|
| 44 | |
---|
[2f0c07d] | 45 | .. figure:: img/bcc_geometry.jpg |
---|
[d138d43] | 46 | |
---|
| 47 | Body-centered cubic lattice. |
---|
[754c454] | 48 | |
---|
| 49 | For a crystal, diffraction peaks appear at reduced q-values given by |
---|
| 50 | |
---|
[eb69cce] | 51 | .. math:: |
---|
[a5d0d00] | 52 | |
---|
| 53 | \frac{qD}{2\pi} = \sqrt{h^2 + k^2 + l^2} |
---|
| 54 | |
---|
| 55 | where for a body-centered cubic lattice, only reflections where |
---|
| 56 | $(h + k + l) = \text{even}$ are allowed and reflections where |
---|
| 57 | $(h + k + l) = \text{odd}$ are forbidden. Thus the peak positions |
---|
| 58 | correspond to (just the first 5) |
---|
[754c454] | 59 | |
---|
[eb69cce] | 60 | .. math:: |
---|
[754c454] | 61 | |
---|
[eb69cce] | 62 | \begin{array}{lccccc} |
---|
| 63 | q/q_o & 1 & \sqrt{2} & \sqrt{3} & \sqrt{4} & \sqrt{5} \\ |
---|
| 64 | \text{Indices} & (110) & (200) & (211) & (220) & (310) \\ |
---|
| 65 | \end{array} |
---|
[754c454] | 66 | |
---|
[eda8b30] | 67 | .. note:: |
---|
| 68 | |
---|
| 69 | The calculation of $Z(q)$ is a double numerical integral that |
---|
| 70 | must be carried out with a high density of points to properly capture |
---|
[1f159bd] | 71 | the sharp peaks of the paracrystalline scattering. |
---|
| 72 | So be warned that the calculation is slow. Fitting of any experimental data |
---|
[eda8b30] | 73 | must be resolution smeared for any meaningful fit. This makes a triple integral |
---|
| 74 | which may be very slow. |
---|
[1f159bd] | 75 | |
---|
[a5d0d00] | 76 | This example dataset is produced using 200 data points, |
---|
| 77 | *qmin* = 0.001 |Ang^-1|, *qmax* = 0.1 |Ang^-1| and the above default values. |
---|
[754c454] | 78 | |
---|
[a5d0d00] | 79 | The 2D (Anisotropic model) is based on the reference below where $I(q)$ is |
---|
| 80 | approximated for 1d scattering. Thus the scattering pattern for 2D may not |
---|
[1f159bd] | 81 | be accurate, particularly at low $q$. For general details of the calculation and angular |
---|
[eda8b30] | 82 | dispersions for oriented particles see :ref:`orientation` . |
---|
| 83 | Note that we are not responsible for any incorrectness of the 2D model computation. |
---|
[754c454] | 84 | |
---|
[1f65db5] | 85 | .. figure:: img/parallelepiped_angle_definition.png |
---|
[d138d43] | 86 | |
---|
[0bdddc2] | 87 | Orientation of the crystal with respect to the scattering plane, when |
---|
[1f65db5] | 88 | $\theta = \phi = 0$ the $c$ axis is along the beam direction (the $z$ axis). |
---|
[754c454] | 89 | |
---|
[eb69cce] | 90 | References |
---|
| 91 | ---------- |
---|
[754c454] | 92 | |
---|
[b0c4271] | 93 | .. [#CIT1987] Hideki Matsuoka et. al. *Physical Review B*, 36 (1987) 1754-1765 |
---|
| 94 | (Original Paper) |
---|
| 95 | .. [#CIT1990] Hideki Matsuoka et. al. *Physical Review B*, 41 (1990) 3854 -3856 |
---|
| 96 | (Corrections to FCC and BCC lattice structure calculation) |
---|
[754c454] | 97 | |
---|
[b0c4271] | 98 | Authorship and Verification |
---|
| 99 | ---------------------------- |
---|
| 100 | |
---|
| 101 | * **Author:** NIST IGOR/DANSE **Date:** pre 2010 |
---|
| 102 | * **Last Modified by:** Paul Butler **Date:** September 29, 2016 |
---|
| 103 | * **Last Reviewed by:** Richard Heenan **Date:** March 21, 2016 |
---|
[754c454] | 104 | """ |
---|
| 105 | |
---|
[2d81cfe] | 106 | import numpy as np |
---|
[0b56f38] | 107 | from numpy import inf, pi |
---|
[754c454] | 108 | |
---|
[e166cb9] | 109 | name = "bcc_paracrystal" |
---|
[754c454] | 110 | title = "Body-centred cubic lattic with paracrystalline distortion" |
---|
| 111 | description = """ |
---|
[dcdf29d] | 112 | Calculates the scattering from a **body-centered cubic lattice** with |
---|
| 113 | paracrystalline distortion. Thermal vibrations are considered to be |
---|
| 114 | negligible, and the size of the paracrystal is infinitely large. |
---|
| 115 | Paracrystalline distortion is assumed to be isotropic and characterized |
---|
| 116 | by a Gaussian distribution. |
---|
[754c454] | 117 | """ |
---|
[485aee2] | 118 | category = "shape:paracrystal" |
---|
[13ed84c] | 119 | |
---|
[b0c4271] | 120 | #note - calculation requires double precision |
---|
[13ed84c] | 121 | single = False |
---|
| 122 | |
---|
[dcdf29d] | 123 | # pylint: disable=bad-whitespace, line-too-long |
---|
[485aee2] | 124 | # ["name", "units", default, [lower, upper], "type","description" ], |
---|
[dcdf29d] | 125 | parameters = [["dnn", "Ang", 220, [-inf, inf], "", "Nearest neighbour distance"], |
---|
| 126 | ["d_factor", "", 0.06, [-inf, inf], "", "Paracrystal distortion factor"], |
---|
| 127 | ["radius", "Ang", 40, [0, inf], "volume", "Particle radius"], |
---|
[42356c8] | 128 | ["sld", "1e-6/Ang^2", 4, [-inf, inf], "sld", "Particle scattering length density"], |
---|
| 129 | ["sld_solvent", "1e-6/Ang^2", 1, [-inf, inf], "sld", "Solvent scattering length density"], |
---|
[9b79f29] | 130 | ["theta", "degrees", 60, [-360, 360], "orientation", "c axis to beam angle"], |
---|
| 131 | ["phi", "degrees", 60, [-360, 360], "orientation", "rotation about beam"], |
---|
| 132 | ["psi", "degrees", 60, [-360, 360], "orientation", "rotation about c axis"] |
---|
[485aee2] | 133 | ] |
---|
[dcdf29d] | 134 | # pylint: enable=bad-whitespace, line-too-long |
---|
[485aee2] | 135 | |
---|
[925ad6e] | 136 | source = ["lib/sas_3j1x_x.c", "lib/gauss150.c", "lib/sphere_form.c", "bcc_paracrystal.c"] |
---|
[754c454] | 137 | |
---|
[0bdddc2] | 138 | def random(): |
---|
| 139 | # Define lattice spacing as a multiple of the particle radius |
---|
| 140 | # using the formulat a = 4 r/sqrt(3). Systems which are ordered |
---|
| 141 | # are probably mostly filled, so use a distribution which goes from |
---|
| 142 | # zero to one, but leaving 90% of them within 80% of the |
---|
| 143 | # maximum bcc packing. Lattice distortion values are empirically |
---|
| 144 | # useful between 0.01 and 0.7. Use an exponential distribution |
---|
| 145 | # in this range 'cuz its easy. |
---|
[1511c37c] | 146 | radius = 10**np.random.uniform(1.3, 4) |
---|
| 147 | d_factor = 10**np.random.uniform(-2, -0.7) # sigma_d in 0.01-0.7 |
---|
[0bdddc2] | 148 | dnn_fraction = np.random.beta(a=10, b=1) |
---|
[1511c37c] | 149 | dnn = radius*4/np.sqrt(3)/dnn_fraction |
---|
[0bdddc2] | 150 | pars = dict( |
---|
| 151 | #sld=1, sld_solvent=0, scale=1, background=1e-32, |
---|
[1511c37c] | 152 | dnn=dnn, |
---|
| 153 | d_factor=d_factor, |
---|
| 154 | radius=radius, |
---|
[0bdddc2] | 155 | ) |
---|
| 156 | return pars |
---|
| 157 | |
---|
[0b56f38] | 158 | # april 6 2017, rkh add unit tests, NOT compared with any other calc method, assume correct! |
---|
[e2d6e3b] | 159 | # add 2d test later |
---|
[1f159bd] | 160 | # TODO: fix the 2d tests |
---|
[8f04da4] | 161 | q = 4.*pi/220. |
---|
[0b56f38] | 162 | tests = [ |
---|
[8f04da4] | 163 | [{}, [0.001, q, 0.215268], [1.46601394721, 2.85851284174, 0.00866710287078]], |
---|
[1f159bd] | 164 | #[{'theta': 20.0, 'phi': 30, 'psi': 40.0}, (-0.017, 0.035), 2082.20264399], |
---|
| 165 | #[{'theta': 20.0, 'phi': 30, 'psi': 40.0}, (-0.081, 0.011), 0.436323144781], |
---|
[69e1afc] | 166 | ] |
---|