1 | r""" |
---|
2 | This model describes a Gaussian shaped peak on a flat background |
---|
3 | |
---|
4 | .. image:: img/image198.PNG |
---|
5 | |
---|
6 | with the peak having height of *I0* centered at *q0* and having a standard deviation of *B*. The FWHM (full-width |
---|
7 | half-maximum) is 2.354 B. |
---|
8 | |
---|
9 | For 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 | |
---|
17 | REFERENCE |
---|
18 | --------- |
---|
19 | |
---|
20 | None. |
---|
21 | """ |
---|
22 | |
---|
23 | from numpy import pi, inf |
---|
24 | |
---|
25 | name = "gaussian_peak" |
---|
26 | title = "Gaussian shaped peak" |
---|
27 | description = """ |
---|
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 | """ |
---|
31 | category = "shape-independent" |
---|
32 | |
---|
33 | parameters = [ |
---|
34 | # [ "name", "units", default, [lower, upper], "type", |
---|
35 | # "description" ], |
---|
36 | [ "q0", "1/Ang", 0.05, [-inf,inf], "", |
---|
37 | "Peak position" ], |
---|
38 | [ "sigma", "1/Ang", 0.005, [-inf,inf], "", |
---|
39 | "Peak width (standard deviation)" ], |
---|
40 | ] |
---|
41 | |
---|
42 | |
---|
43 | # No volume normalization despite having a volume parameter |
---|
44 | # This should perhaps be volume normalized? |
---|
45 | form_volume = """ |
---|
46 | return 1.0; |
---|
47 | """ |
---|
48 | |
---|
49 | Iq = """ |
---|
50 | return exp(-0.5*pow((q - q0)/sigma,2.0)); |
---|
51 | """ |
---|
52 | |
---|
53 | |
---|
54 | Iqxy = """ |
---|
55 | // never called since no orientation or magnetic parameters. |
---|
56 | //return -1.0; |
---|
57 | return Iq(sqrt(qx*qx + qy*qy), q0, sigma); |
---|
58 | """ |
---|
59 | |
---|
60 | |
---|
61 | # VR defaults to 1.0 |
---|
62 | |
---|
63 | demo = dict( |
---|
64 | scale=1, background=0, |
---|
65 | q0 = 0.05, sigma = 0.005, |
---|
66 | ) |
---|
67 | oldname = "PeakGaussModel" |
---|
68 | oldpars = dict(sigma='B') |
---|