source: sasmodels/sasmodels/models/guinier.py @ a0fb06a

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since a0fb06a was 6dd90c1, checked in by Paul Kienzle <pkienzle@…>, 8 years ago

update model tests for default background of 0.001

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