1 | #!/usr/bin/env python |
---|
2 | # -*- coding: utf-8 -*- |
---|
3 | |
---|
4 | from bumps.names import * |
---|
5 | from cylcode import GpuCylinder |
---|
6 | from lamellarcode import GpuLamellar |
---|
7 | from ellipsecode import GpuEllipse |
---|
8 | from coreshellcylcode import GpuCoreShellCylinder |
---|
9 | from sasmodel import SasModel, load_data, set_beam_stop |
---|
10 | |
---|
11 | |
---|
12 | radial_data = load_data('JUN03289.DAT') |
---|
13 | set_beam_stop(radial_data, 0.004) |
---|
14 | trans_data = load_data('JUN03305.DAT') |
---|
15 | set_beam_stop(trans_data, 0.004) |
---|
16 | |
---|
17 | |
---|
18 | |
---|
19 | |
---|
20 | dtype='float32' |
---|
21 | radial = SasModel(radial_data, |
---|
22 | GpuCylinder, dtype=dtype, |
---|
23 | scale=1, radius=64.1, length=266.96, sldCyl=.291e-6, sldSolv=5.77e-6, background=0, |
---|
24 | cyl_theta=0, cyl_phi=0, radius_pd=0.1, radius_pd_n=10, radius_pd_nsigma=3,length_pd=0.1, |
---|
25 | length_pd_n=5, length_pd_nsigma=3, cyl_theta_pd=0.1, cyl_theta_pd_n=5, cyl_theta_pd_nsigma=3, |
---|
26 | cyl_phi_pd=0.1, cyl_phi_pd_n=10, cyl_phi_pd_nsigma=3) |
---|
27 | trans = SasModel(trans_data, |
---|
28 | GpuCylinder, dtype=dtype, |
---|
29 | **radial.parameters()) |
---|
30 | |
---|
31 | radial.radius.range(0,100) |
---|
32 | radial.length.range(0, 1000) |
---|
33 | radial.cyl_theta.range(0,90) |
---|
34 | radial.cyl_phi.range(0,90) |
---|
35 | radial.scale.range(0,10) |
---|
36 | |
---|
37 | |
---|
38 | fv = FreeVariables(names=['radial','trans'], |
---|
39 | cyl_theta=radial.cyl_theta, |
---|
40 | cyl_phi = radial.cyl_phi) |
---|
41 | problem = FitProblem([radial,trans], freevars=fv) |
---|
42 | |
---|
43 | |
---|
44 | |
---|