source: sasmodels/example/model.py @ 4476951

core_shell_microgelsmagnetic_modelticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since 4476951 was 2e66ef5, checked in by Paul Kienzle <pkienzle@…>, 8 years ago

add a short scripting guide; start in on developer docs

  • Property mode set to 100644
File size: 1.2 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4import sys
5from bumps.names import *
6from sasmodels.core import load_model
7from sasmodels.bumps_model import Model, Experiment
8from sasmodels.data import load_data, set_beam_stop, set_top
9
10""" IMPORT THE DATA USED """
11radial_data = load_data('DEC07267.DAT')
12set_beam_stop(radial_data, 0.00669, outer=0.025)
13set_top(radial_data, -.0185)
14
15kernel = load_model("ellipsoid")
16
17model = Model(kernel,
18    scale=0.08,
19    radius_polar=15, radius_equatorial=800,
20    sld=.291, sld_solvent=7.105,
21    background=0,
22    theta=90, phi=0,
23    theta_pd=15, theta_pd_n=40, theta_pd_nsigma=3,
24    radius_polar_pd=0.222296, radius_polar_pd_n=1, radius_polar_pd_nsigma=0,
25    radius_equatorial_pd=.000128, radius_equatorial_pd_n=1, radius_equatorial_pd_nsigma=0,
26    phi_pd=0, phi_pd_n=20, phi_pd_nsigma=3,
27    )
28
29# SET THE FITTING PARAMETERS
30model.radius_polar.range(15, 1000)
31model.radius_equatorial.range(15, 1000)
32model.theta_pd.range(0, 360)
33model.background.range(0,1000)
34model.scale.range(0, 10)
35
36#cutoff = 0     # no cutoff on polydisperisity loops
37#cutoff = 1e-5  # default cutoff
38cutoff = 1e-3  # low precision cutoff
39M = Experiment(data=radial_data, model=model, cutoff=cutoff)
40problem = FitProblem(M)
Note: See TracBrowser for help on using the repository browser.