core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change
on this file since efc517c was
0ac3db5,
checked in by jhbakker, 10 years ago
|
SESANSfit now uses sesans_reader dataloader
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | import numpy as np |
---|
2 | from bumps.names import * |
---|
3 | |
---|
4 | from sasmodels import bumps_model as sas |
---|
5 | kernel = sas.load_model('sphere', dtype='single') |
---|
6 | |
---|
7 | |
---|
8 | if True: # fix when data loader exists |
---|
9 | # from sas.dataloader.readers\ |
---|
10 | from sas.dataloader.loader import Loader |
---|
11 | loader=Loader() |
---|
12 | data=loader.load('testsasview1.ses') |
---|
13 | |
---|
14 | # data = load_sesans('mydatfile.pz') |
---|
15 | # sans_data = load_sans('mysansfile.xml') |
---|
16 | |
---|
17 | else: |
---|
18 | SElength = np.linspace(0, 2400, 61) # [A] |
---|
19 | data = np.ones_like(SElength) |
---|
20 | err_data = np.ones_like(SElength)*0.03 |
---|
21 | |
---|
22 | class SESANSData1D: |
---|
23 | #q_zmax = 0.23 # [A^-1] |
---|
24 | zacceptance = 0.1 # [A^-1] |
---|
25 | lam = 2e-10 # [m] |
---|
26 | thickness = 0.2 # [cm] |
---|
27 | x = SElength |
---|
28 | y = data |
---|
29 | dy = err_data |
---|
30 | data = SesansData() |
---|
31 | print dir(data) |
---|
32 | |
---|
33 | radius = 1000 |
---|
34 | data.Rmax = 3*radius # [A] |
---|
35 | |
---|
36 | phi = Parameter(0.1, name="phi") |
---|
37 | model = sas.BumpsModel(data, kernel, |
---|
38 | scale=phi*(1-phi), sld=7.0, solvent_sld=1.0, radius=radius) |
---|
39 | phi.pmp(10) |
---|
40 | model.radius.pmp(40) |
---|
41 | model.sld.pm(2) |
---|
42 | model.background.range(0,5) |
---|
43 | |
---|
44 | |
---|
45 | if False: # have sans data |
---|
46 | sansmodel = sas.BumpsModel(sans_data, kernel, **model.parameters()) |
---|
47 | problem = FitProblem([model, sansmodel]) |
---|
48 | else: |
---|
49 | problem = FitProblem(model) |
---|
50 | |
---|
Note: See
TracBrowser
for help on using the repository browser.