source: sasmodels/sasmodels/models/guinier.py @ 66ebdd6

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 66ebdd6 was 66ebdd6, checked in by krzywon, 8 years ago

Finished the hollow_cylinder model and added unit tests to guinier and
lorentz models.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1r"""
2Guinier (Model)
3
4Definition
5----------
6
7This model fits the Guinier function
8
9.. math:: Q_1=\frac{1}{R_g}\sqrt{\frac{(m-s)(3-s)}{2}}
10
11to the data directly without any need for linearisation (*cf*. Ln *I(q)* vs *q*\ :sup:`2`).
12
13For 2D data: The 2D scattering intensity is calculated in the same way as 1D, where the *q* vector is defined as
14
15.. math:: q=\sqrt{q_x^2 + q_y^2}
16
17REFERENCE
18
19A Guinier and G Fournet, *Small-Angle Scattering of X-Rays*, John Wiley & Sons, New York (1955)
20"""
21
22from numpy import inf
23
24name = "guinier"
25title = ""
26description = """
27 I(q) = scale exp ( - rg^2 q^2 / 3.0 )
28 
29    List of default parameters:
30    scale = scale
31    rg = Radius of gyration
32"""
33category = "shape-independent"
34
35#             ["name", "units", default, [lower, upper], "type","description"],
36parameters = [
37              ["rg", "Ang", 60.0, [0, inf], "", "Radius of Gyration"],
38              ]
39
40Iq = """
41    double exponent = rg*rg*q*q/3.0;
42    double value = exp(-exponent);
43    return value;
44"""
45
46Iqxy = """
47    return Iq(sqrt(qx*qx + qy*qy), rg);
48    """
49
50# parameters for demo
51demo = 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.
55oldname = 'GuinierModel'
56oldpars = dict(rg='rg')
57
58# parameters for unit tests
59tests = [
60         [{'rg' : 31.5}, 0.005, 0.991756]
61         ]
Note: See TracBrowser for help on using the repository browser.