1 | r""" |
---|
2 | This model calculates an empirical functional form for SAS data characterized |
---|
3 | by a broad scattering peak. Many SAS spectra are characterized by a broad peak |
---|
4 | even though they are from amorphous soft materials. For example, soft systems |
---|
5 | that show a SAS peak include copolymers, polyelectrolytes, multiphase systems, |
---|
6 | layered structures, etc. |
---|
7 | |
---|
8 | The d-spacing corresponding to the broad peak is a characteristic distance |
---|
9 | between the scattering inhomogeneities (such as in lamellar, cylindrical, or |
---|
10 | spherical morphologies, or for bicontinuous structures). |
---|
11 | |
---|
12 | Definition |
---|
13 | ---------- |
---|
14 | |
---|
15 | The scattering intensity $I(q)$ is calculated as |
---|
16 | |
---|
17 | .. math:: |
---|
18 | |
---|
19 | I(q) = \frac{A}{q^n} + \frac{C}{1 + (q\xi)^m} + B |
---|
20 | |
---|
21 | Here the peak position is related to the d-spacing as $q_o = 2\pi / d_o$. |
---|
22 | |
---|
23 | For 2D data the scattering intensity is calculated in the same way as 1D, |
---|
24 | where the $q$ vector is defined as |
---|
25 | |
---|
26 | .. math:: |
---|
27 | |
---|
28 | q = \sqrt{q_x^2 + q_y^2} |
---|
29 | |
---|
30 | |
---|
31 | .. figure:: img/broad_peak_1d.jpg |
---|
32 | |
---|
33 | 1D plot using the default values (w/200 data point). |
---|
34 | |
---|
35 | References |
---|
36 | ---------- |
---|
37 | |
---|
38 | None. |
---|
39 | |
---|
40 | *2013/09/09 - Description reviewed by King, S and Parker, P.* |
---|
41 | |
---|
42 | """ |
---|
43 | |
---|
44 | from numpy import inf, sqrt |
---|
45 | |
---|
46 | name = "broad_peak" |
---|
47 | title = "Broad Lorentzian type peak on top of a power law decay" |
---|
48 | description = """\ |
---|
49 | I(q) = scale_p/pow(q,exponent)+scale_l/ |
---|
50 | (1.0 + pow((fabs(q-q_peak)*length_l),exponent_l) )+ background |
---|
51 | |
---|
52 | List of default parameters: |
---|
53 | porod_scale = Porod term scaling |
---|
54 | porod_exp = Porod exponent |
---|
55 | lorentz_scale = Lorentzian term scaling |
---|
56 | lorentz_length = Lorentzian screening length [A] |
---|
57 | peak_pos = peak location [1/A] |
---|
58 | lorentz_exp = Lorentzian exponent |
---|
59 | background = Incoherent background""" |
---|
60 | category = "shape-independent" |
---|
61 | |
---|
62 | # ["name", "units", default, [lower, upper], "type", "description"], |
---|
63 | parameters = [["porod_scale", "", 1.0e-05, [-inf, inf], "", "Power law scale factor"], |
---|
64 | ["porod_exp", "", 3.0, [-inf, inf], "", "Exponent of power law"], |
---|
65 | ["lorentz_scale", "", 10.0, [-inf, inf], "", "Scale factor for broad Lorentzian peak"], |
---|
66 | ["lorentz_length", "Ang", 50.0, [-inf, inf], "", "Lorentzian screening length"], |
---|
67 | ["peak_pos", "1/Ang", 0.1, [-inf, inf], "", "Peak postion in q"], |
---|
68 | ["lorentz_exp", "", 2.0, [-inf, inf], "", "exponent of Lorentz function"], |
---|
69 | ] |
---|
70 | |
---|
71 | def Iq(q, porod_scale, porod_exp, lorentz_scale, lorentz_length, peak_pos, lorentz_exp): |
---|
72 | inten = (porod_scale / q ** porod_exp + lorentz_scale |
---|
73 | / (1.0 + (abs(q - peak_pos) * lorentz_length) ** lorentz_exp)) |
---|
74 | return inten |
---|
75 | Iq.vectorized = True # Iq accepts an array of q values |
---|
76 | |
---|
77 | def Iqxy(qx, qy, *args): |
---|
78 | return Iq(sqrt(qx ** 2 + qy ** 2), *args) |
---|
79 | Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values |
---|
80 | |
---|
81 | |
---|
82 | demo = dict(scale=1, background=0, |
---|
83 | porod_scale=1.0e-05, porod_exp=3, |
---|
84 | lorentz_scale=10, lorentz_length=50, peak_pos=0.1, lorentz_exp=2) |
---|
85 | |
---|
86 | oldname = "BroadPeakModel" |
---|
87 | oldpars = dict(porod_scale='scale_p', porod_exp='exponent_p', |
---|
88 | lorentz_scale='scale_l', lorentz_length='length_l', peak_pos='q_peak', |
---|
89 | lorentz_exp='exponent_l', scale=None) |
---|