Changeset 5d3d7b4 in sasmodels
- Timestamp:
- Sep 4, 2014 11:40:26 AM (10 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 6798848
- Parents:
- 6ce1a29
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
README.rst
r19dcb933 r5d3d7b4 9 9 the distributed package. New models can be added if OpenCL or a C compiler 10 10 is available. 11 12 Example 13 ------- 14 15 The example directory contains a radial+tangential data set for an oriented 16 rod-like shape. 17 18 The data is loaded by sans.dataloader from the sasview package, so sasview 19 is needed to run the example. 20 21 To run the example, you need sasview, sasmodels and bumps. Assuming these 22 repositories are installed side by side, change to the sasmodels/example 23 directory and enter:: 24 25 PYTHONPATH=..:../../sasview/src ../../bumps/run.py fit.py \ 26 cylinder --preview 27 28 See bumps documentation for instructions on running the fit. With the 29 python packages installed, e.g., into a virtual environment, then the 30 python path need not be set, and the command would be:: 31 32 bumps fit.py cylinder --preview 33 34 The fit.py model accepts up to two arguments. The first argument is the 35 model type, which has been defined for cylinder, capped_cylinder, 36 core_shell_cylinder, ellipsoid, triaxial_ellipsoid and lamellar. The 37 second argument is view, which can be radial or tangential. To fit 38 both radial and tangential simultaneously, use the word "both". 39 40 Notes 41 ----- 11 42 12 43 cylinder.c + cylinder.py is the cylinder model with renamed variables and -
example/fit.py
r6ce1a29 r5d3d7b4 18 18 name = "ellipsoid" if len(sys.argv) < 2 else sys.argv[1] 19 19 section = "radial" if len(sys.argv) < 3 else sys.argv[2] 20 data = radial_data if section is not "tangent" else tan_data 20 if section not in ("radial","tangential","both"): 21 raise ValueError("section %r should be 'radial', 'tangential' or 'both'" 22 % section) 23 data = radial_data if section != "tangential" else tan_data 24 phi = 0 if section != "tangential" else 90 21 25 kernel = sas.load_model(name, dtype="single") 22 26 cutoff = 1e-3 … … 28 32 sld=.291, solvent_sld=7.105, 29 33 background=0, 30 theta=90, phi= 0,34 theta=90, phi=phi, 31 35 theta_pd=15, theta_pd_n=40, theta_pd_nsigma=3, 32 36 rpolar_pd=0.222296, rpolar_pd_n=1, rpolar_pd_nsigma=0, … … 65 69 pars = dict(scale=0.0023, radius=92.5, length=798.3, 66 70 sld=.29, solvent_sld=7.105, background=5, 67 theta=0, phi= 0,71 theta=0, phi=phi, 68 72 theta_pd=22.11, theta_pd_n=5, theta_pd_nsigma=3, 69 73 radius_pd=.0084, radius_pd_n=10, radius_pd_nsigma=3, … … 75 79 sld=.291, solvent_sld=5.77, 76 80 radius=250, length=178, 77 theta=90, phi= 0,81 theta=90, phi=phi, 78 82 radius_pd=0.1, radius_pd_n=5, radius_pd_nsigma=3, 79 83 length_pd=0.1,length_pd_n=5, length_pd_nsigma=3, … … 98 102 scale= .031, radius=19.5, thickness=30, length=22, 99 103 core_sld=7.105, shell_sld=.291, solvent_sld=7.105, 100 background=0, theta=0, phi= 0,104 background=0, theta=0, phi=phi, 101 105 102 106 radius_pd=0.26, radius_pd_n=10, radius_pd_nsigma=3, … … 125 129 scale=.08, radius=20, cap_radius=40, length=400, 126 130 sld_capcyl=1, sld_solv=6.3, 127 background=0, theta=0, phi= 0,131 background=0, theta=0, phi=phi, 128 132 radius_pd=.1, radius_pd_n=5, radius_pd_nsigma=3, 129 133 cap_radius_pd=.1, cap_radius_pd_n=5, cap_radius_pd_nsigma=3, … … 140 144 scale=0.08, req_minor=15, req_major=20, rpolar=500, 141 145 sldEll=7.105, solvent_sld=.291, 142 background=5, theta=0, phi= 0, psi=0,146 background=5, theta=0, phi=phi, psi=0, 143 147 theta_pd=20, theta_pd_n=40, theta_pd_nsigma=3, 144 148 phi_pd=.1, phi_pd_n=1, phi_pd_nsigma=0, … … 162 166 163 167 model.cutoff = cutoff 164 if section is"both":168 if section == "both": 165 169 tan_model = sas.BumpsModel(tan_data, model.model, model.parameters()) 166 170 tan_model.phi = model.phi - 90 171 tan_model.cutoff = cutoff 167 172 problem = FitProblem([model, tan_model]) 168 173 else:
Note: See TracChangeset
for help on using the changeset viewer.