source: sasmodels/example/model.py @ 8898d0f

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

add simple bumps fitting example

  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[15d2285]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    rpolar=15, requatorial=800,
20    sld=.291, solvent_sld=7.105,
21    background=0,
22    theta=90, phi=0,
23    theta_pd=15, theta_pd_n=40, theta_pd_nsigma=3,
24    rpolar_pd=0.222296, rpolar_pd_n=1, rpolar_pd_nsigma=0,
25    requatorial_pd=.000128, requatorial_pd_n=1, requatorial_pd_nsigma=0,
26    phi_pd=0, phi_pd_n=20, phi_pd_nsigma=3,
27    )
28
29# SET THE FITTING PARAMETERS
30model.rpolar.range(15, 1000)
31model.requatorial.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.