core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change
on this file since 0880966 was
84db7a5,
checked in by krzywon, 9 years ago
|
Updated sesans scripting to be more command line focused AND modified hardsphere to effect_radius.
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[a98958b] | 1 | """ |
---|
| 2 | This is a data file used to load in sesans data and fit it using the bumps engine |
---|
| 3 | """ |
---|
| 4 | from bumps.names import * |
---|
| 5 | |
---|
| 6 | import sesansfit |
---|
| 7 | |
---|
| 8 | # Enter the model name to use |
---|
| 9 | model_name = "sphere" |
---|
| 10 | |
---|
[84db7a5] | 11 | # DO NOT MODIFY THIS LINE |
---|
| 12 | model = sesansfit.get_bumps_model(model_name) |
---|
| 13 | |
---|
[a98958b] | 14 | # Enter any custom parameters |
---|
[84db7a5] | 15 | # name = Parameter(initial_value, name='name') |
---|
[a98958b] | 16 | phi = Parameter(0.10, name='phi') |
---|
[84db7a5] | 17 | # Add the parameters to this list that should be displayed in the fitting window |
---|
[a98958b] | 18 | custom_params = {"phi" : phi} |
---|
| 19 | |
---|
[84db7a5] | 20 | # SESANS data file name |
---|
[a98958b] | 21 | sesans_file = "sphere.ses" |
---|
| 22 | |
---|
| 23 | # Initial parameter values (if other than defaults) |
---|
[84db7a5] | 24 | # "model_parameter_name" : value |
---|
[a98958b] | 25 | initial_vals = { |
---|
| 26 | "sld" : 7.0, |
---|
| 27 | "radius" : 1000, |
---|
[84db7a5] | 28 | "solvent_sld" : 1.0, |
---|
[a98958b] | 29 | } |
---|
| 30 | |
---|
| 31 | # Ranges for parameters if other than default |
---|
[84db7a5] | 32 | # "model_parameter_name" : [min, max] |
---|
[a98958b] | 33 | param_range = { |
---|
| 34 | "phi" : [0.001, 0.5], |
---|
| 35 | "radius" : [1, 10000] |
---|
| 36 | } |
---|
| 37 | |
---|
[84db7a5] | 38 | # Constraints |
---|
| 39 | # model.param_name = f(other params) |
---|
| 40 | # EXAMPLE: model.scale = model.radius*model.radius*(1 - phi) - where radius and scale are model functions and phi is |
---|
| 41 | # a custom parameter |
---|
| 42 | model.scale = phi*(1-phi) |
---|
| 43 | |
---|
[a98958b] | 44 | # Send to the fitting engine |
---|
[84db7a5] | 45 | # DO NOT MODIFY THIS LINE |
---|
| 46 | problem = sesansfit.sesans_fit(sesans_file, model, initial_vals, custom_params, param_range) |
---|
| 47 | |
---|
Note: See
TracBrowser
for help on using the repository browser.