source: sasmodels/sasmodels/models/gaussian_peak.py @ 9d76d29

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

fix up docs to use latex

  • Property mode set to 100644
File size: 1.6 KB
RevLine 
[2eaae42]1r"""
[9d76d29]2
3Definition
4----------
5
[4c8f9cd]6This model describes a Gaussian shaped peak on a flat background
[2eaae42]7
[9d76d29]8.. math::
9
10    I(q) = (\text{scale}) \exp\left[ -\tfrac12 (q-q_0)^2 / \sigma^2 \right]
11        + \text{background}
12
13with the peak having height of *scale* centered at $q_0$ and having a standard
14deviation of $\sigma$. The FWHM (full-width half-maximum) is $2.354 \sigma$.
15
16For 2D data, scattering intensity is calculated in the same way as 1D,
17where the $q$ vector is defined as
[2eaae42]18
[9d76d29]19.. math::
[2eaae42]20
[9d76d29]21    q = \sqrt{q_x^2 + q_y^2}
[2eaae42]22
23
[9d76d29]24.. image:: img/gaussian_peak_1d.jpg
[2eaae42]25
[9d76d29]26    1D plot using the default values (w/500 data points).
[2eaae42]27
[9d76d29]28Reference
[a5d0d00]29---------
[2eaae42]30
[4c8f9cd]31None.
[2eaae42]32"""
33
[3c56da87]34from numpy import inf
[2eaae42]35
[4c8f9cd]36name = "gaussian_peak"
37title = "Gaussian shaped peak"
38description = """
39    Model describes a Gaussian shaped peak including a flat background
[9d76d29]40    Provide F(q) = scale*exp( -1/2 *[(q-q0)/sigma]^2 )+ background
[2eaae42]41"""
[a5d0d00]42category = "shape-independent"
[2eaae42]43
[3e428ec]44#             ["name", "units", default, [lower, upper], "type","description"],
45parameters = [["q0", "1/Ang", 0.05, [-inf, inf], "", "Peak position"],
[9d76d29]46              ["sigma", "1/Ang", 0.005, [0, inf], "",
[3e428ec]47               "Peak width (standard deviation)"],
48             ]
[2eaae42]49
50# No volume normalization despite having a volume parameter
51# This should perhaps be volume normalized?
52form_volume = """
[6ea6902]53    return 1.0;
[2eaae42]54    """
55
56Iq = """
[6ea6902]57    return exp(-0.5*pow((q - q0)/sigma,2.0));
[2eaae42]58    """
59
60
61Iqxy = """
62    // never called since no orientation or magnetic parameters.
63    //return -1.0;
[4c8f9cd]64    return Iq(sqrt(qx*qx + qy*qy), q0, sigma);
[2eaae42]65    """
66
67
68# VR defaults to 1.0
69
[3e428ec]70demo = dict(scale=1, background=0, q0=0.05, sigma=0.005)
[4c8f9cd]71oldname = "PeakGaussModel"
72oldpars = dict(sigma='B')
Note: See TracBrowser for help on using the repository browser.