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