[3330bb4] | 1 | r""" |
---|
| 2 | Definition |
---|
| 3 | ---------- |
---|
| 4 | |
---|
| 5 | This model fits the Guinier function |
---|
| 6 | |
---|
| 7 | .. math:: |
---|
| 8 | |
---|
[4476951] | 9 | I(q) = \text{scale} \cdot \exp{\left[ \frac{-Q^2 R_g^2 }{3} \right]} |
---|
[3330bb4] | 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. |
---|
| 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 | |
---|
[751da81] | 20 | .. math:: q = \sqrt{q_x^2 + q_y^2} |
---|
[3ba2251] | 21 | |
---|
| 22 | In scattering, the radius of gyration $R_g$ quantifies the objects's |
---|
| 23 | distribution of SLD (not mass density, as in mechanics) from the objects's |
---|
[c9fc873] | 24 | SLD centre of mass. It is defined by |
---|
[3ba2251] | 25 | |
---|
[c9fc873] | 26 | .. math:: R_g^2 = \frac{\sum_i\rho_i\left(r_i-r_0\right)^2}{\sum_i\rho_i} |
---|
[3ba2251] | 27 | |
---|
[c9fc873] | 28 | where $r_0$ denotes the object's SLD centre of mass and $\rho_i$ is the SLD at |
---|
| 29 | a point $i$. |
---|
[3ba2251] | 30 | |
---|
| 31 | Notice that $R_g^2$ may be negative (since SLD can be negative), which happens |
---|
| 32 | when a form factor $P(Q)$ is increasing with $Q$ rather than decreasing. This |
---|
| 33 | can occur for core/shell particles, hollow particles, or for composite |
---|
| 34 | particles with domains of different SLDs in a solvent with an SLD close to the |
---|
| 35 | average match point. (Alternatively, this might be regarded as there being an |
---|
| 36 | internal inter-domain "structure factor" within a single particle which gives |
---|
| 37 | rise to a peak in the scattering). |
---|
[4476951] | 38 | |
---|
| 39 | To specify a negative value of $R_g^2$ in SasView, simply give $R_g$ a negative |
---|
[3b8a004] | 40 | value ($R_g^2$ will be evaluated as $R_g |R_g|$). Note that the physical radius |
---|
| 41 | of gyration, of the exterior of the particle, will still be large and positive. |
---|
| 42 | It is only the apparent size from the small $Q$ data that will give a small or |
---|
| 43 | negative value of $R_g^2$. |
---|
[4476951] | 44 | |
---|
[3330bb4] | 45 | References |
---|
| 46 | ---------- |
---|
| 47 | |
---|
| 48 | A Guinier and G Fournet, *Small-Angle Scattering of X-Rays*, |
---|
| 49 | John Wiley & Sons, New York (1955) |
---|
| 50 | """ |
---|
| 51 | |
---|
[2d81cfe] | 52 | import numpy as np |
---|
[3330bb4] | 53 | from numpy import inf |
---|
| 54 | |
---|
| 55 | name = "guinier" |
---|
| 56 | title = "" |
---|
| 57 | description = """ |
---|
| 58 | I(q) = scale.exp ( - rg^2 q^2 / 3.0 ) |
---|
[404ebbd] | 59 | |
---|
[3330bb4] | 60 | List of default parameters: |
---|
| 61 | scale = scale |
---|
| 62 | rg = Radius of gyration |
---|
| 63 | """ |
---|
| 64 | category = "shape-independent" |
---|
| 65 | |
---|
| 66 | # ["name", "units", default, [lower, upper], "type","description"], |
---|
[4476951] | 67 | parameters = [["rg", "Ang", 60.0, [-inf, inf], "", "Radius of Gyration"]] |
---|
[3330bb4] | 68 | |
---|
| 69 | Iq = """ |
---|
[05cd67f] | 70 | double exponent = fabs(rg)*rg*q*q/3.0; |
---|
[3330bb4] | 71 | double value = exp(-exponent); |
---|
| 72 | return value; |
---|
| 73 | """ |
---|
| 74 | |
---|
[404ebbd] | 75 | def random(): |
---|
[48462b0] | 76 | scale = 10**np.random.uniform(1, 4) |
---|
| 77 | # Note: compare.py has Rg cutoff of 1e-30 at q=1 for guinier, so use that |
---|
| 78 | # log_10 Ae^(-(q Rg)^2/3) = log_10(A) - (q Rg)^2/ (3 ln 10) > -30 |
---|
| 79 | # => log_10(A) > Rg^2/(3 ln 10) - 30 |
---|
[404ebbd] | 80 | q_max = 1.0 |
---|
| 81 | rg_max = np.sqrt(90*np.log(10) + 3*np.log(scale))/q_max |
---|
| 82 | rg = 10**np.random.uniform(0, np.log10(rg_max)) |
---|
| 83 | pars = dict( |
---|
| 84 | #background=0, |
---|
| 85 | scale=scale, |
---|
| 86 | rg=rg, |
---|
| 87 | ) |
---|
| 88 | return pars |
---|
| 89 | |
---|
[3330bb4] | 90 | # parameters for demo |
---|
[3b8a004] | 91 | demo = dict(scale=1.0, background=0.001, rg=60.0 ) |
---|
[3330bb4] | 92 | |
---|
| 93 | # parameters for unit tests |
---|
| 94 | tests = [[{'rg' : 31.5}, 0.005, 0.992756]] |
---|