Changeset e806077 in sasmodels


Ignore:
Timestamp:
Feb 18, 2015 9:25:56 AM (5 years ago)
Author:
pkienzle
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
3a45c2c, 5428233, 0ac3db5
Parents:
c97724e
Message:

add example of sans/sesans simultaneous system

File:
1 edited

Legend:

Unmodified
Added
Removed
  • example/sesansfit.py

    rc97724e re806077  
    55kernel = sas.load_model('sphere', dtype='single') 
    66 
     7 
    78radius = 1000 
     9if False: # fix when data loader exists 
     10    from sasmodels.dataloader import load_sesans, load_sans 
     11    data = load_sesans('mydatfile.pz') 
     12    sans_data = load_sans('mysansfile.xml') 
     13else: 
     14    SElength = np.linspace(0, 2400, 61) # [A] 
     15    data = np.ones_like(SElength) 
     16    err_data = np.ones_like(SElength)*0.03 
    817 
    9 SElength = np.linspace(0, 2400, 61) # [A] 
    10 data = np.ones_like(SElength) 
    11 err_data = np.ones_like(SElength)*0.03 
    12  
    13 class SesansData: 
    14     #q_zmax = 0.23 # [A^-1] 
    15     q_zmax = 0.1 # [A^-1] 
    16     SElength = np.linspace(0, 2400, 61) # [A] 
    17     Rmax = 3*radius # [A] 
    18     wavelength = 2e-10 # [m] 
    19     thickness = 0.2 # [cm] 
    20     SElength = SElength 
    21     data = data 
    22     err_data = err_data 
    23 data = SesansData() 
     18    class SesansData: 
     19        #q_zmax = 0.23 # [A^-1] 
     20        q_zmax = 0.1 # [A^-1] 
     21        SElength = np.linspace(0, 2400, 61) # [A] 
     22        Rmax = 3*radius # [A] 
     23        wavelength = 2e-10 # [m] 
     24        thickness = 0.2 # [cm] 
     25        SElength = SElength 
     26        data = data 
     27        err_data = err_data 
     28    data = SesansData() 
    2429 
    2530phi = Parameter(0.1, name="phi") 
     
    3136model.background.range(0,5) 
    3237 
    33 problem = FitProblem(model) 
    3438 
     39if False: # have sans data 
     40    sansmodel = sas.BumpsModel(sans_data, kernel, **model.parameters()) 
     41    problem = FitProblem([model, sansmodel]) 
     42else: 
     43    problem = FitProblem(model) 
     44 
Note: See TracChangeset for help on using the changeset viewer.