[a84a0ca] | 1 | r""" |
---|
| 2 | Definition |
---|
| 3 | ---------- |
---|
| 4 | |
---|
| 5 | This model fits the Guinier function |
---|
| 6 | |
---|
[45330ed] | 7 | .. math:: I(q) = scale \exp{\left[ \frac{-Q^2R_g^2}{3} \right]} |
---|
[a84a0ca] | 8 | |
---|
| 9 | to the data directly without any need for linearisation |
---|
[45330ed] | 10 | (*cf*. the usual plot of $\ln I(q)$ vs $q^2$\ ). Note that you may have to |
---|
| 11 | restrict the data range to include small q only, where the Guinier approximation |
---|
| 12 | actually applies. See also the guinier_porod model. |
---|
[a84a0ca] | 13 | |
---|
| 14 | For 2D data the scattering intensity is calculated in the same way as 1D, |
---|
| 15 | where the $q$ vector is defined as |
---|
| 16 | |
---|
| 17 | .. math:: q=\sqrt{q_x^2 + q_y^2} |
---|
| 18 | |
---|
| 19 | References |
---|
| 20 | ---------- |
---|
| 21 | |
---|
| 22 | A Guinier and G Fournet, *Small-Angle Scattering of X-Rays*, |
---|
| 23 | John Wiley & Sons, New York (1955) |
---|
| 24 | """ |
---|
| 25 | |
---|
| 26 | from numpy import inf |
---|
| 27 | |
---|
| 28 | name = "guinier" |
---|
| 29 | title = "" |
---|
| 30 | description = """ |
---|
[45330ed] | 31 | I(q) = scale.exp ( - rg^2 q^2 / 3.0 ) |
---|
[a84a0ca] | 32 | |
---|
| 33 | List of default parameters: |
---|
| 34 | scale = scale |
---|
| 35 | rg = Radius of gyration |
---|
| 36 | """ |
---|
| 37 | category = "shape-independent" |
---|
| 38 | |
---|
| 39 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
| 40 | parameters = [["rg", "Ang", 60.0, [0, inf], "", "Radius of Gyration"]] |
---|
| 41 | |
---|
| 42 | Iq = """ |
---|
| 43 | double exponent = rg*rg*q*q/3.0; |
---|
| 44 | double value = exp(-exponent); |
---|
| 45 | return value; |
---|
| 46 | """ |
---|
| 47 | |
---|
| 48 | Iqxy = """ |
---|
| 49 | return Iq(sqrt(qx*qx + qy*qy), rg); |
---|
| 50 | """ |
---|
| 51 | |
---|
| 52 | # parameters for demo |
---|
| 53 | demo = dict(scale=1.0, rg=60.0) |
---|
| 54 | |
---|
| 55 | # parameters for unit tests |
---|
| 56 | tests = [[{'rg' : 31.5}, 0.005, 0.992756]] |
---|