core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change
on this file since c094758 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 = "core_shell_sphere*hardsphere" |
---|
| 10 | |
---|
[84db7a5] | 11 | # DO NOT MODIFY THIS LINE |
---|
| 12 | model = sesansfit.get_bumps_model(model_name) |
---|
| 13 | |
---|
[a98958b] | 14 | # Enter any custom parameters |
---|
| 15 | phi = Parameter(0.45, name='phi') |
---|
| 16 | pen = Parameter(0.95, name='solvent penetration') |
---|
| 17 | custom_params = {"phi" : phi, "pen" : pen} |
---|
| 18 | |
---|
| 19 | # SESANS data file |
---|
| 20 | sesans_file = "core_shell.ses" |
---|
| 21 | |
---|
| 22 | # Initial parameter values (if other than defaults) |
---|
| 23 | initial_vals = { |
---|
| 24 | "core_sld" : 1.0592, |
---|
| 25 | "solvent_sld" : 2.88, |
---|
| 26 | "radius" : 890, |
---|
[84db7a5] | 27 | "thickness" : 130 |
---|
[a98958b] | 28 | } |
---|
| 29 | |
---|
| 30 | # Ranges for parameters if other than default |
---|
| 31 | param_range = { |
---|
| 32 | "phi" : [0.2, 0.5], |
---|
| 33 | "pen" : [0,1], |
---|
| 34 | "radius" : [500, 3000], |
---|
| 35 | "thickness" : [0,200] |
---|
| 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 | model.volfraction = phi |
---|
| 44 | model.shell_sld = pen*2.88 |
---|
| 45 | |
---|
[a98958b] | 46 | # Send to the fitting engine |
---|
[84db7a5] | 47 | problem = sesansfit.sesans_fit(sesans_file, model_name, initial_vals, custom_params, param_range) |
---|
Note: See
TracBrowser
for help on using the repository browser.