Changeset a0494e9 in sasmodels


Ignore:
Timestamp:
Jul 18, 2016 11:43:54 PM (8 years ago)
Author:
Paul Kienzle <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:
c7ff92c
Parents:
263daec
Message:

allow comparison between onion/spherical_sld and sasview

Location:
sasmodels
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/convert.json

    r263daec ra0494e9  
    475475  ],  
    476476  "onion": [ 
    477     "OnionModel", 
    478     { 
     477    "OnionExpShellModel", 
     478    { 
     479      "n_shells": "n_shells", 
    479480      "A": "A_shell",  
    480481      "sld_core": "sld_core0", 
    481       "core_radius": "rad_core0",  
    482       "n": "n_shells", 
     482      "core_radius": "rad_core0", 
    483483      "sld_solvent": "sld_solv", 
    484484      "thickness": "thick_shell",  
     
    636636  ], 
    637637  "spherical_sld": [ 
    638     "SphereSLDModel",  
    639     { 
    640       "n": "n_shells", 
    641       "radius_core": "rad_core",  
     638    "SphericalSLDModel", 
     639    { 
     640      "radius_core": "rad_core0", 
     641      "sld_core": "sld_core0", 
    642642      "sld_solvent": "sld_solv" 
    643643    } 
  • sasmodels/convert.py

    r51ec7e8 ra0494e9  
    243243            _remove_pd(oldpars, 'rimB', name) 
    244244            _remove_pd(oldpars, 'rimC', name) 
     245        elif name == 'spherical_sld': 
     246            for k in range(1, int(pars['n_shells'])+1): 
     247                _remove_pd(oldpars, 'thick_flat'+str(k), 'thick_flat') 
     248                _remove_pd(oldpars, 'thick_inter'+str(k), 'thick_inter') 
    245249        elif name == 'rpa': 
    246250            # convert scattering lengths from femtometers to centimeters 
     
    263267        elif name in ['mono_gauss_coil','poly_gauss_coil']: 
    264268            del oldpars['i_zero'] 
     269        elif name == 'onion': 
     270            oldpars.pop('n_shells', None) 
    265271 
    266272    return oldpars 
     
    302308        elif name == 'core_multi_shell': 
    303309            pars['n'] = min(math.ceil(pars['n']), 4) 
    304  
     310        elif name == 'spherical_sld': 
     311            for k in range(1, 11): 
     312                pars['thick_flat%d_pd_n'%k] = 0 
     313                pars['thick_inter%d_pd_n'%k] = 0 
     314 
  • sasmodels/models/onion.py

    r46ed760 ra0494e9  
    312312 
    313313source = ["lib/sph_j1c.c", "onion.c"] 
     314single = False 
    314315 
    315316#def Iq(q, *args, **kw): 
     
    375376    "sld_core": 1.0, 
    376377    "core_radius": 100, 
    377     "n": 4, 
     378    "n_shells": 4, 
    378379    "sld_in": [0.5, 1.5, 0.9, 2.0], 
    379380    "sld_out": [nan, 0.9, 1.2, 1.6], 
     
    381382    "A": [0, -1, 1e-4, 1], 
    382383    # Could also specify them individually as 
    383     # "A[1]": 0, "A[2]": -1, "A[3]": 1e-4, "A[4]": 1, 
     384    # "A1": 0, "A2": -1, "A3": 1e-4, "A4": 1, 
    384385    } 
    385386 
  • sasmodels/models/spherical_sld.py

    r46ed760 ra0494e9  
    202202# pylint: disable=bad-whitespace, line-too-long 
    203203#            ["name", "units", default, [lower, upper], "type", "description"], 
    204 parameters = [["n_shells",          "",               1,      [0, 9],         "volume", "number of shells"], 
    205               ["npts_inter",        "",               35,     [0, inf],        "", "number of points in each sublayer Must be odd number"], 
     204parameters = [["n_shells",          "",               1,      [0, 10],        "volume", "number of shells"], 
     205              ["npts_inter",        "",               35,     [0, inf],       "", "number of points in each sublayer Must be odd number"], 
    206206              ["radius_core",       "Ang",            50.0,   [0, inf],       "volume", "intern layer thickness"], 
    207207              ["sld_core",          "1e-6/Ang^2",     2.07,   [-inf, inf],    "", "sld function flat"], 
     
    218218# pylint: enable=bad-whitespace, line-too-long 
    219219source = ["lib/librefl.c",  "lib/sph_j1c.c", "spherical_sld.c"] 
     220single = False 
    220221 
    221222profile_axes = ['Radius (A)', 'SLD (1e-6/A^2)'] 
Note: See TracChangeset for help on using the changeset viewer.