source: sasmodels/sasmodels/models/gaussian_peak.py @ 4c8f9cd

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 4c8f9cd was 4c8f9cd, checked in by ajj, 9 years ago

gaussian peak fixes

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