Changeset 8a5f021 in sasmodels for example/model_ellipsoid_hayter_msa.py
- Timestamp:
- May 31, 2017 12:02:34 PM (7 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 8bc1a4b
- Parents:
- 1f7792e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
example/model_ellipsoid_hayter_msa.py
r1f7792e r8a5f021 1 #!/usr/bin/env python2 # -*- coding: utf-8 -*-3 4 # To Sasview/documents/scripts5 6 1 import sys 7 2 #sys.path.append('path_to_sasmodels') 3 4 import numpy as np 8 5 9 6 from bumps.names import * … … 11 8 from sasmodels.bumps_model import Model, Experiment 12 9 from sasmodels.data import load_data, plot_data 13 import numpy as np14 import matplotlib.pyplot as plt15 10 16 17 """ IMPORT THE DATA USED """ 18 data = load_data('data.txt') 11 # IMPORT THE DATA USED 12 data = load_data(sys.argv[1]) 19 13 20 14 #setattr(data, 'qmin', 0.0) 21 15 #setattr(data, 'qmax', 10.0) 22 16 23 """ DEFINE THE MODEL """ 24 kernel = load_model('ellipsoid*hayter_msa' , dtype="double")17 # DEFINE THE MODEL 18 kernel = load_model('ellipsoid*hayter_msa') 25 19 26 pars = dict(scale=6.4, background=0.06, sld=0.33, sld_solvent=2.15, radius_polar=14.0, 27 radius_equatorial=24.0, volfraction=0.075, charge=66.373, temperature=298.0, 20 pars = dict(scale=6.4, background=0.06, sld=0.33, sld_solvent=2.15, radius_polar=14.0, 21 radius_equatorial=24.0, volfraction=0.075, charge=66.373, temperature=298.0, 28 22 concentration_salt=0.001, dielectconst=71.0) 29 23 30 24 model = Model(kernel, **pars) 31 25 32 """ PARAMETER RANGES (ONLY THOSE PARAMETERS ARE FITTED) """ 26 # PARAMETER RANGES (ONLY THOSE PARAMETERS ARE FITTED) 33 27 model.scale.range(0, inf) 34 28 model.background.range(-inf, inf) … … 43 37 #model.dielectconst.range(0,inf) 44 38 45 46 39 M = Experiment(data=data, model=model) 47 40 48 41 problem = FitProblem(M) 49
Note: See TracChangeset
for help on using the changeset viewer.