source: sasmodels/sasmodels/models/gaussian_peak.py @ d1fe925

gh-pages
Last change on this file since d1fe925 was d1fe925, checked in by ajj, 8 years ago

Creating gh_pages branch for docs

  • 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---------
19
20None.
21"""
22
23from numpy import inf
24
25name = "gaussian_peak"
26title = "Gaussian shaped peak"
27description = """
28    Model describes a Gaussian shaped peak including a flat background
29    Provide F(q) = scale*exp( -1/2 *[(q-q0)/B]^2 )+ background
30"""
31category = "shape-independent"
32
33#             ["name", "units", default, [lower, upper], "type","description"],
34parameters = [["q0", "1/Ang", 0.05, [-inf, inf], "", "Peak position"],
35              ["sigma", "1/Ang", 0.005, [-inf, inf], "",
36               "Peak width (standard deviation)"],
37             ]
38
39# No volume normalization despite having a volume parameter
40# This should perhaps be volume normalized?
41form_volume = """
42    return 1.0;
43    """
44
45Iq = """
46    return exp(-0.5*pow((q - q0)/sigma,2.0));
47    """
48
49
50Iqxy = """
51    // never called since no orientation or magnetic parameters.
52    //return -1.0;
53    return Iq(sqrt(qx*qx + qy*qy), q0, sigma);
54    """
55
56
57# VR defaults to 1.0
58
59demo = dict(scale=1, background=0, q0=0.05, sigma=0.005)
60oldname = "PeakGaussModel"
61oldpars = dict(sigma='B')
Note: See TracBrowser for help on using the repository browser.