source: sasmodels/example/sesans_parameters_sphere.py @ b0696e1

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since b0696e1 was 9217ef8, checked in by Paul Kienzle <pkienzle@…>, 9 years ago

add data saving to sesansfit; nicer errors when parameters don't exist

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