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