core_shell_microgelscostrafo411magnetic_modelrelease_v0.94release_v0.95ticket-1257-vesicle-productticket_1156ticket_1265_superballticket_822_more_unit_tests
Last change
on this file since 9cb1415 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
|
Rev | Line | |
---|
[c97724e] | 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 | |
---|
[0ac3db5] | 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 | |
---|
[e806077] | 17 | else: |
---|
[c97724e] | 18 | SElength = np.linspace(0, 2400, 61) # [A] |
---|
[e806077] | 19 | data = np.ones_like(SElength) |
---|
| 20 | err_data = np.ones_like(SElength)*0.03 |
---|
| 21 | |
---|
[0ac3db5] | 22 | class SESANSData1D: |
---|
[e806077] | 23 | #q_zmax = 0.23 # [A^-1] |
---|
[0ac3db5] | 24 | zacceptance = 0.1 # [A^-1] |
---|
| 25 | lam = 2e-10 # [m] |
---|
[e806077] | 26 | thickness = 0.2 # [cm] |
---|
[0ac3db5] | 27 | x = SElength |
---|
| 28 | y = data |
---|
| 29 | dy = err_data |
---|
[e806077] | 30 | data = SesansData() |
---|
[0ac3db5] | 31 | print dir(data) |
---|
| 32 | |
---|
| 33 | radius = 1000 |
---|
| 34 | data.Rmax = 3*radius # [A] |
---|
[c97724e] | 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 | |
---|
[e806077] | 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) |
---|
[c97724e] | 50 | |
---|
Note: See
TracBrowser
for help on using the repository browser.