source: sasmodels/multi-fit.py @ ae7d639

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

Speed-up of 3X, compare.py working

  • Property mode set to 100644
File size: 1.6 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4from bumps.names import *
5from Models.code_lamellar import GpuLamellar
6from Models.code_ellipse import GpuEllipse
7from Models.code_cylinder import GpuCylinder
8from multisasmodels import SasModel, load_data, set_beam_stop, set_half
9import numpy as np
10
11data = load_data('December/DEC07238.DAT')
12set_beam_stop(data, 0.0052)#, outer=0.025)
13#set_half(data, 'left')
14
15truth = SasModel(data, GpuCylinder,
16scale=0.08, radius=46, length=719,
17sldCyl=.291e-6, sldSolv=5.77e-6, background=0,
18cyl_theta=90, cyl_phi=0,
19cyl_theta_pd=23, cyl_theta_pd_n=40, cyl_theta_pd_nsigma=3,
20radius_pd=0.1, radius_pd_n=10, radius_pd_nsigma=3,
21length_pd=0.1, length_pd_n=10, length_pd_nsigma=3,
22cyl_phi_pd=0.1, cyl_phi_pd_n=10, cyl_phi_pd_nsigma=3,
23dtype='float')
24
25
26#model.radius_a.range(15, 1000)
27#model.radius_b.range(15, 1000)
28#model.axis_theta_pd.range(0, 360)
29#model.background.range(0,1000)
30#truth.scale.range(0, 1)
31
32arrayone = truth.theory()
33
34
35lies = SasModel(data, GpuCylinder,
36scale=0.08, radius=46, length=719,
37sldCyl=.291e-6, sldSolv=5.77e-6, background=0,
38cyl_theta=90, cyl_phi=0,
39cyl_theta_pd=23, cyl_theta_pd_n=40, cyl_theta_pd_nsigma=3,
40radius_pd=0.1, radius_pd_n=10, radius_pd_nsigma=3,
41length_pd=0.1, length_pd_n=10, length_pd_nsigma=3,
42cyl_phi_pd=0.1, cyl_phi_pd_n=10, cyl_phi_pd_nsigma=3,
43dtype='float')
44
45
46
47#modeltwo.bi_thick.range(0, 1000)
48#modeltwo.scale.range(0, 1)
49#model.bi_thick_pd.range(0, 1000)
50#model.background.range(0, 1000)
51
52
53arraytwo = lies.theory()
54
55
56a = np.add(np.multiply(arrayone, .08), np.multiply(arraytwo, .08))
57truth.set_result(a)
58
59
60problem = FitProblem(truth)
61
Note: See TracBrowser for help on using the repository browser.