source: sasmodels/multi-fit.py @ d772f5d

core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change on this file since d772f5d was d772f5d, checked in by HMP1 <helen.park@…>, 10 years ago

Added 1D Fit, fixed fitting error

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[9a9f5b5]1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4from bumps.names import *
5from code_lamellar import GpuLamellar
6from code_ellipse import GpuEllipse
[d772f5d]7from multisasmodels import SasModel, load_data, set_beam_stop, set_half
[9a9f5b5]8import numpy as np
9
[d772f5d]10data = load_data('DEC07282.DAT')
[9a9f5b5]11set_beam_stop(data, 0.0052)#, outer=0.025)
12#set_half(data, 'left')
13
14truth = SasModel(data, GpuEllipse,
[d772f5d]15                scale=.0011, radius_a=45.265, radius_b=600.8, sldEll=.291e-6, sldSolv=7.105e-6,
[9a9f5b5]16                 background=8.30161, axis_theta=0, axis_phi=0,
17                 radius_a_pd=0.222296, radius_a_pd_n=1, radius_a_pd_nsigma=0,
18                 radius_b_pd=.000128, radius_b_pd_n=1, radius_b_pd_nsigma=0,
19                 axis_theta_pd=20, axis_theta_pd_n=40, axis_theta_pd_nsigma=3,
20                 axis_phi_pd=2.63698e-05, axis_phi_pd_n=20, axis_phi_pd_nsigma=0,
21                 dtype='float')
22
23#model.radius_a.range(15, 1000)
24#model.radius_b.range(15, 1000)
25#model.axis_theta_pd.range(0, 360)
26#model.background.range(0,1000)
27#truth.scale.range(0, 1)
28
29arrayone = truth.theory()
30
31
32lies = SasModel(data, GpuLamellar, scale=0, bi_thick=5, sld_bi=.291e-6, sld_sol=5.77e-6, background=85.23,
33                 bi_thick_pd= 0.0013, bi_thick_pd_n=5, bi_thick_pd_nsigma=3, dtype='float')
34
35
36#modeltwo.bi_thick.range(0, 1000)
37#modeltwo.scale.range(0, 1)
38#model.bi_thick_pd.range(0, 1000)
39#model.background.range(0, 1000)
40
41
42arraytwo = lies.theory()
43
44
45a = np.add(np.multiply(arrayone, .5), np.multiply(arraytwo, 0))
46truth.set_result(a)
47
48
49problem = FitProblem(truth)
50
Note: See TracBrowser for help on using the repository browser.