source: sasmodels/README.md @ 3bcd03d

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 3bcd03d was 241b617, checked in by mathieu, 10 years ago

Create README.md

  • Property mode set to 100644
File size: 3.1 KB
RevLine 
[241b617]1Sasmodels
2=========
3
4Theory models for small angle scattering.
5
6The models provided are usable directly in the bumps fitting package and
7in the sasview analysis package.  If OpenCL is available, the models will
8run much faster.  If not, then precompiled versions will be included with
9the distributed package.  New models can be added if OpenCL or a C compiler
10is available.
11
12Example
13-------
14
15The example directory contains a radial+tangential data set for an oriented
16rod-like shape.
17
18The data is loaded by sas.dataloader from the sasview package, so sasview
19is needed to run the example.
20
21To run the example, you need sasview, sasmodels and bumps.  Assuming these
22repositories are installed side by side, change to the sasmodels/example
23directory and enter::
24
25    PYTHONPATH=..:../../sasview/src ../../bumps/run.py fit.py \
26        cylinder --preview
27
28See bumps documentation for instructions on running the fit.  With the
29python packages installed, e.g., into a virtual environment, then the
30python path need not be set, and the command would be::
31
32    bumps fit.py cylinder --preview
33
34The fit.py model accepts up to two arguments.  The first argument is the
35model type, which has been defined for cylinder, capped_cylinder,
36core_shell_cylinder, ellipsoid, triaxial_ellipsoid and lamellar.  The
37second argument is view, which can be radial or tangential.  To fit
38both radial and tangential simultaneously, use the word "both".
39
40Notes
41-----
42
43cylinder.c + cylinder.py is the cylinder model with renamed variables and
44sld scaled by 1e6 so the numbers are nicer.  The model name is "cylinder"
45
46cylinder_clone.c + cylinder_clone.py is the cylinder model using the
47same interface as the sasview, including calling the model CylinderModel,
48so that it can be used as a drop-in replacement for the sasview cylinder
49model.
50
51lamellar.py is an example of a single file model with embedded C code.
52
53Note: may want to rename form_volume to calc_volume and Iq/Iqxy to
54calc_Iq/calc_Iqxy in model interface. Similarly ER/VR go to calc_ER/calc_VR.
55
56Note: It is possible to translate python code automatically to opencl, using
57something like numba, clyther, shedskin or pypy, so maybe the kernel functions
58could be implemented without any C syntax.
59
60Note: angular dispersion in theta is probably not calculated correctly, but
61is left this way for compatibility with sasview.
62
63Magnetism hasn't been implemented yet.  We may want a separate Imagnetic
64calculator with the extra parameters and calculations.   We should
65return all desired spin states together so we can share the work of
66computing the form factors for the different magnetic contrasts.  This
67will mean extending the data handler to support multiple cross sections
68in the same data set.
69
70Need to implement an example kernel directly in python.  Polydispersity
71loops should be generated automatically as they are for the OpenCL models.
72The kernels should be vectorized across Q.  These will need vectorized
73versions of numerical quadrature if we want to get reasonable performance.
74
75[![Travis-CI Build Status](https://travis-ci.org/SasView/sasmodels.svg?branch=master)](https://travis-ci.org/SasView/sasmodels)
Note: See TracBrowser for help on using the repository browser.