[9a11937] | 1 | """ |
---|
[b9a5f0e] | 2 | P(r) inversion for SAS |
---|
[9a11937] | 3 | """ |
---|
[b9a5f0e] | 4 | ## \mainpage P(r) inversion for SAS |
---|
[9a11937] | 5 | # |
---|
| 6 | # \section intro_sec Introduction |
---|
| 7 | # This module provides calculations to transform scattering intensity data |
---|
| 8 | # I(q) into distance distribution function P(r). A description of the |
---|
| 9 | # technique can be found elsewhere [1-5]. The module is useable as a |
---|
| 10 | # standalone application but its functionality is meant to be presented |
---|
[b9a5f0e] | 11 | # to end-users through the user interface developed as part of the SAS |
---|
[9a11937] | 12 | # flagship application. |
---|
| 13 | # |
---|
| 14 | # Procedure: We will follow the procedure of Moore [1]. |
---|
| 15 | # |
---|
| 16 | # [1] P.B. Moore, J.Appl. Cryst (1980) 13, 168-175. |
---|
[896abb3] | 17 | # |
---|
[9a11937] | 18 | # [2] O. Glatter, J.Appl. Cryst (1977) 10, 415-421. |
---|
[896abb3] | 19 | # |
---|
[9a11937] | 20 | # [3] D.I. Svergun, J.Appl. Cryst (1991) 24, 485-492. |
---|
[896abb3] | 21 | # |
---|
[9a11937] | 22 | # [4] D.I. Svergun, J.Appl. Cryst (1992) 25, 495-503. |
---|
[896abb3] | 23 | # |
---|
[9a11937] | 24 | # [5] S. Hansen and J. Skov Pedersen, J.Appl. Cryst (1991) 24, 541-548. |
---|
| 25 | # |
---|
[ffca8f2] | 26 | ## \subsection class Class Diagram: |
---|
[a3efdeb] | 27 | # The following shows a partial class diagram with the main attributes |
---|
| 28 | # and methods of the invertor. |
---|
[ffca8f2] | 29 | # |
---|
| 30 | # \image html architecture.png |
---|
[9a11937] | 31 | # |
---|
| 32 | # \section install_sec Installation |
---|
| 33 | # |
---|
| 34 | # \subsection obtain Obtaining the Code |
---|
| 35 | # |
---|
| 36 | # The code is available here: |
---|
| 37 | # \verbatim |
---|
[79492222] | 38 | #$ svn co svn://danse.us/sas/pr_inversion |
---|
[9a11937] | 39 | # \endverbatim |
---|
| 40 | # |
---|
| 41 | # \subsection depends External Dependencies |
---|
[97d69d9] | 42 | # scipy, numpy |
---|
[9a11937] | 43 | # |
---|
| 44 | # \subsection build Building the code |
---|
| 45 | # The standard python package can be built with distutils. |
---|
| 46 | # \verbatim |
---|
| 47 | #$ python setup.py build |
---|
| 48 | #$ python setup.py install |
---|
| 49 | # \endverbatim |
---|
| 50 | # |
---|
| 51 | # |
---|
[896abb3] | 52 | # \subsection Tutorial |
---|
| 53 | # To create an inversion object: |
---|
| 54 | # \verbatim |
---|
[79492222] | 55 | #from sas.pr.invertor import Invertor |
---|
[896abb3] | 56 | # invertor = Invertor() |
---|
| 57 | # \endverbatim |
---|
| 58 | # |
---|
| 59 | # To set the maximum distance between any two points: |
---|
| 60 | # \verbatim |
---|
| 61 | # invertor.d_max = 160.0 |
---|
| 62 | # \endverbatim |
---|
| 63 | # |
---|
| 64 | # To set the regularization constant: |
---|
| 65 | # \verbatim |
---|
| 66 | # invertor.alpha = 0.0007 |
---|
| 67 | # \endverbatim |
---|
| 68 | # |
---|
| 69 | # To set the q, I(q) and error on I(q): |
---|
| 70 | # \verbatim |
---|
| 71 | # invertor.x = q_vector |
---|
| 72 | # invertor.y = Iq_vector |
---|
| 73 | # invertor.err = dIq_vector |
---|
| 74 | # \endverbatim |
---|
| 75 | # |
---|
| 76 | # To perform the inversion. In this example, we choose |
---|
| 77 | # a P(r) expension wit 10 base functions. |
---|
| 78 | # \verbatim |
---|
| 79 | # c_out, c_cov = invertor.invert(10) |
---|
| 80 | # \endverbatim |
---|
| 81 | # The c_out and c_cov are the set of coefficients and the covariance |
---|
| 82 | # matrix for those coefficients, respectively. |
---|
| 83 | # |
---|
[ffca8f2] | 84 | # To get P(r): |
---|
| 85 | # \verbatim |
---|
| 86 | # r = 10.0 |
---|
| 87 | # pr = invertor.pr(c_out, r) |
---|
| 88 | # \endverbatim |
---|
| 89 | # Alternatively, one can get P(r) with the error on P(r): |
---|
| 90 | # \verbatim |
---|
| 91 | # r = 10.0 |
---|
| 92 | # pr, dpr = invertor.pr_err(c_out, c_cov, r) |
---|
| 93 | # \endverbatim |
---|
| 94 | # |
---|
| 95 | # To get the output I(q) from the set of coefficients found: |
---|
| 96 | # \verbatim |
---|
| 97 | # q = 0.001 |
---|
| 98 | # iq = invertor.iq(c_out, q) |
---|
| 99 | # \endverbatim |
---|
| 100 | # |
---|
[79492222] | 101 | # Examples are available as unit tests under sas.pr_inversion.test. |
---|
[9a11937] | 102 | # |
---|
| 103 | # \section help_sec Contact Info |
---|
| 104 | # Code and Documentation produced as part of the DANSE project. |
---|
| 105 | |
---|
| 106 | __author__ = 'University of Tennessee' |
---|