[19dcb933] | 1 | Sasmodels |
---|
| 2 | ========= |
---|
| 3 | |
---|
| 4 | Theory models for small angle scattering. |
---|
| 5 | |
---|
| 6 | The models provided are usable directly in the bumps fitting package and |
---|
| 7 | in the sasview analysis package. If OpenCL is available, the models will |
---|
| 8 | run much faster. If not, then precompiled versions will be included with |
---|
| 9 | the distributed package. New models can be added if OpenCL or a C compiler |
---|
| 10 | is available. |
---|
| 11 | |
---|
[a7684e5] | 12 | cylinder.c + cylinder.py is the cylinder model with renamed variables and |
---|
| 13 | sld scaled by 1e6 so the numbers are nicer. The model name is "cylinder" |
---|
| 14 | |
---|
| 15 | cylinder_clone.c + cylinder_clone.py is the cylinder model using the |
---|
| 16 | same interface as the sasview, including calling the model CylinderModel, |
---|
| 17 | so that it can be used as a drop-in replacement for the sasview cylinder |
---|
| 18 | model. |
---|
| 19 | |
---|
[5d4777d] | 20 | lamellar.py is an example of a single file model with embedded C code. |
---|
[a7684e5] | 21 | |
---|
| 22 | Note: may want to rename form_volume to calc_volume and Iq/Iqxy to |
---|
[19dcb933] | 23 | calc_Iq/calc_Iqxy in model interface. Similarly ER/VR go to calc_ER/calc_VR. |
---|
[a7684e5] | 24 | |
---|
| 25 | Note: It is possible to translate python code automatically to opencl, using |
---|
[5d4777d] | 26 | something like numba, clyther, shedskin or pypy, so maybe the kernel functions |
---|
| 27 | could be implemented without any C syntax. |
---|
[a7684e5] | 28 | |
---|
[19dcb933] | 29 | Note: angular dispersion in theta is probably not calculated correctly, but |
---|
| 30 | is left this way for compatibility with sasview. |
---|
| 31 | |
---|
[a7684e5] | 32 | Magnetism hasn't been implemented yet. We may want a separate Imagnetic |
---|
| 33 | calculator with the extra parameters and calculations. We should |
---|
| 34 | return all desired spin states together so we can share the work of |
---|
| 35 | computing the form factors for the different magnetic contrasts. This |
---|
| 36 | will mean extending the data handler to support multiple cross sections |
---|
| 37 | in the same data set. |
---|
[ff7119b] | 38 | |
---|
[19dcb933] | 39 | Need to implement an example kernel directly in python. Polydispersity |
---|
| 40 | loops should be generated automatically as they are for the OpenCL models. |
---|
| 41 | The kernels should be vectorized across Q. These will need vectorized |
---|
| 42 | versions of numerical quadrature if we want to get reasonable performance. |
---|
| 43 | |
---|