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