Changes in / [f4878dc:d8509a6] in sasmodels


Ignore:
Files:
1 added
2 deleted
55 edited

Legend:

Unmodified
Added
Removed
  • doc/genmodel.py

    r70bbb74 raa2edb2  
    2525        'xscale'    : 'log', 
    2626        'yscale'    : 'log' if not info['structure_factor'] else 'linear', 
    27         'qmin'      : 0.005, 
     27        'qmin'      : 0.001, 
    2828        'qmax'      : 1.0, 
    2929        'nq'        : 1000, 
     
    6868fig = plt.figure() 
    6969ax = fig.add_subplot(1,1,1) 
    70 ax.plot(q, Iq1D, color='blue', lw=2, label=model_name) 
     70ax.plot(q, Iq1D, color='blue', lw=2, label=info['name']) 
    7171ax.set_xlabel(r'$Q \/(\AA^{-1})$') 
    7272ax.set_xscale(opts['xscale'])    
     
    101101    docstr = docstr1 + captionstr + docstr2 
    102102else: 
     103    print '------------------------------------------------------------------' 
    103104    print 'References NOT FOUND for model: ', model_name 
     105    print '------------------------------------------------------------------' 
    104106    docstr = docstr + captionstr 
    105107 
  • example/sesans_parameters_css-hs.py

    ra98958b r84db7a5  
    88# Enter the model name to use 
    99model_name = "core_shell_sphere*hardsphere" 
     10 
     11# DO NOT MODIFY THIS LINE 
     12model = sesansfit.get_bumps_model(model_name) 
    1013 
    1114# Enter any custom parameters 
     
    1922# Initial parameter values (if other than defaults) 
    2023initial_vals = { 
    21     "scale" : 0.09, 
    2224    "core_sld" : 1.0592, 
    2325    "solvent_sld" : 2.88, 
    24     "shell_sld" : 2.88, 
    2526    "radius" : 890, 
    26     "thickness" : 130, 
    27     "volfraction" : 0.45 
     27    "thickness" : 130 
    2828} 
    2929 
     
    3636} 
    3737 
     38# Constraints 
     39# model.param_name = f(other params) 
     40# EXAMPLE: model.scale = model.radius*model.radius*(1 - phi) - where radius and scale are model functions and phi is 
     41# a custom parameter 
     42model.scale = phi*(1-phi) 
     43model.volfraction = phi 
     44model.shell_sld = pen*2.88 
     45 
    3846# Send to the fitting engine 
    3947problem = sesansfit.sesans_fit(sesans_file, model_name, initial_vals, custom_params, param_range) 
  • example/sesans_parameters_sphere.py

    ra98958b r84db7a5  
    99model_name = "sphere" 
    1010 
     11# DO NOT MODIFY THIS LINE 
     12model = sesansfit.get_bumps_model(model_name) 
     13 
    1114# Enter any custom parameters 
     15# name = Parameter(initial_value, name='name') 
    1216phi = Parameter(0.10, name='phi') 
     17# Add the parameters to this list that should be displayed in the fitting window 
    1318custom_params = {"phi" : phi} 
    1419 
    15 # SESANS data file 
     20# SESANS data file name 
    1621sesans_file = "sphere.ses" 
    1722 
    1823# Initial parameter values (if other than defaults) 
     24# "model_parameter_name" : value 
    1925initial_vals = { 
    20     "scale" : phi*(1 - phi), 
    2126    "sld" : 7.0, 
     27    "radius" : 1000, 
    2228    "solvent_sld" : 1.0, 
    23     "radius" : 1000, 
    2429} 
    2530 
    2631# Ranges for parameters if other than default 
     32# "model_parameter_name" : [min, max] 
    2733param_range = { 
    2834    "phi" : [0.001, 0.5], 
     
    3036} 
    3137 
     38# Constraints 
     39# model.param_name = f(other params) 
     40# EXAMPLE: model.scale = model.radius*model.radius*(1 - phi) - where radius and scale are model functions and phi is 
     41# a custom parameter 
     42model.scale = phi*(1-phi) 
     43 
    3244# Send to the fitting engine 
    33 problem = sesansfit.sesans_fit(sesans_file, model_name, initial_vals, custom_params, param_range) 
     45# DO NOT MODIFY THIS LINE 
     46problem = sesansfit.sesans_fit(sesans_file, model, initial_vals, custom_params, param_range) 
     47 
  • example/sesansfit.py

    ra98958b r84db7a5  
    1 #TODO: Convert units properly (nm -> A) 
    2 #TODO: Implement constraints 
    3  
    41from bumps.names import * 
    5 from sasmodels import core, bumps_model 
     2from sasmodels import core, bumps_model, sesans 
    63 
    74HAS_CONVERTER = True 
     
    118    HAS_CONVERTER = False 
    129 
    13 def sesans_fit(file, model_name, initial_vals={}, custom_params={}, param_range=[]): 
     10def get_bumps_model(model_name): 
     11    kernel = core.load_model(model_name) 
     12    model = bumps_model.Model(kernel) 
     13    return model 
     14 
     15def sesans_fit(file, model, initial_vals={}, custom_params={}, param_range=[]): 
    1416    """ 
    15  
    1617    @param file: SESANS file location 
    17     @param model_name: model name string - can be model, model_1 * model_2, and/or model_1 + model_2 
     18    @param model: Bumps model object or model name - can be model, model_1 * model_2, and/or model_1 + model_2 
    1819    @param initial_vals: dictionary of {param_name : initial_value} 
    1920    @param custom_params: dictionary of {custom_parameter_name : Parameter() object} 
    2021    @param param_range: dictionary of {parameter_name : [minimum, maximum]} 
     22    @param constraints: dictionary of {parameter_name : constraint} 
    2123    @return: FitProblem for Bumps usage 
    2224    """ 
     
    2931            default_unit = "A" 
    3032            data_conv_q = Converter(data._xunit) 
     33            for x in data.x: 
     34                print x 
    3135            data.x = data_conv_q(data.x, units=default_unit) 
     36            for x in data.x: 
     37                print x 
    3238            data._xunit = default_unit 
    3339 
     
    5157        data = SESANSData1D() 
    5258 
    53     radius = 1000 
     59    if "radius" in initial_vals: 
     60        radius = initial_vals.get("radius") 
     61    else: 
     62        radius = 1000 
    5463    data.Rmax = 3*radius # [A] 
    5564 
    56     kernel = core.load_model(model_name) 
    57     model = bumps_model.Model(kernel) 
     65    if isinstance(model, basestring): 
     66        model = get_bumps_model(model) 
    5867 
    59     # Load custom parameters, initial values and parameter constraints 
     68    # Load custom parameters, initial values and parameter ranges 
    6069    for k, v in custom_params.items(): 
    6170        setattr(model, k, v) 
     
    6978            setattr(param.bounds, "limits", v) 
    7079 
    71     if False: # have sans data 
     80    if False: # for future implementation 
    7281        M_sesans = bumps_model.Experiment(data=data, model=model) 
    7382        M_sans = bumps_model.Experiment(data=sans_data, model=model) 
  • example/sesansfit.sh

    • Property mode changed from 100644 to 100755
  • sasmodels/compare.py

    rfcd7bbd rd6850fa  
    301301            pars['Phi'+c] /= total 
    302302 
    303 def parlist(pars): 
     303def parlist(model_info, pars, is2d): 
    304304    """ 
    305305    Format the parameter list for printing. 
    306306    """ 
    307     active = None 
    308     fields = {} 
     307    if is2d: 
     308        exclude = lambda n: False 
     309    else: 
     310        partype = model_info['partype'] 
     311        par1d = set(partype['fixed-1d']+partype['pd-1d']) 
     312        exclude = lambda n: n not in par1d 
    309313    lines = [] 
    310     for k, v in sorted(pars.items()): 
    311         parts = k.split('_pd') 
    312         #print(k, active, parts) 
    313         if len(parts) == 1: 
    314             if active: lines.append(_format_par(active, **fields)) 
    315             active = k 
    316             fields = {'value': v} 
    317         else: 
    318             assert parts[0] == active 
    319             if parts[1]: 
    320                 fields[parts[1][1:]] = v 
    321             else: 
    322                 fields['pd'] = v 
    323     if active: lines.append(_format_par(active, **fields)) 
     314    for p in model_info['parameters']: 
     315        if exclude(p.name): continue 
     316        fields = dict( 
     317            value=pars.get(p.name, p.default), 
     318            pd=pars.get(p.name+"_pd", 0.), 
     319            n=int(pars.get(p.name+"_pd_n", 0)), 
     320            nsigma=pars.get(p.name+"_pd_nsgima", 3.), 
     321            type=pars.get(p.name+"_pd_type", 'gaussian')) 
     322        lines.append(_format_par(p.name, **fields)) 
    324323    return "\n".join(lines) 
    325324 
     
    837836    constrain_new_to_old(model_info, pars) 
    838837    if opts['show_pars']: 
    839         print(str(parlist(pars))) 
     838        print(str(parlist(model_info, pars, opts['is2d']))) 
    840839 
    841840    # Create the computational engines 
  • sasmodels/convert.py

    r228cbd3 r78d3341  
    7272    new model definition end with sld. 
    7373    """ 
    74     return dict((p, (v*1e-6 if p.endswith('sld') 
     74    return dict((p, (v*1e-6 if p.startswith('sld') or p.endswith('sld') 
    7575                     else v*1e15 if 'ndensity' in p 
    7676                     else v)) 
  • sasmodels/data.py

    r7824276 r84db7a5  
    440440 
    441441    if use_data or use_theory: 
     442        is_tof = np.any(data.lam!=data.lam[0]) 
    442443        if num_plots > 1: 
    443444            plt.subplot(1, num_plots, 1) 
    444445        if use_data: 
    445             plt.errorbar(data.x, data.y, yerr=data.dy) 
     446            if is_tof: 
     447                plt.errorbar(data.x, np.log(data.y)/(data.lam*data.lam), yerr=data.dy/data.y/(data.lam*data.lam)) 
     448            else: 
     449                plt.errorbar(data.x, data.y, yerr=data.dy) 
    446450        if theory is not None: 
    447             plt.plot(data.x, theory, '-', hold=True) 
     451            if is_tof: 
     452                plt.plot(data.x, np.log(theory)/(data.lam*data.lam), '-', hold=True) 
     453            else: 
     454                plt.plot(data.x, theory, '-', hold=True) 
    448455        if limits is not None: 
    449456            plt.ylim(*limits) 
    450         plt.xlabel('spin echo length (nm)') 
    451         plt.ylabel('polarization (P/P0)') 
     457 
     458        plt.xlabel('spin echo length ({})'.format(data._xunit)) 
     459        if is_tof: 
     460            plt.ylabel('(Log (P/P$_0$))/$\lambda^2$') 
     461        else: 
     462            plt.ylabel('polarization (P/P0)') 
     463 
    452464 
    453465    if resid is not None: 
     
    455467            plt.subplot(1, num_plots, (use_data or use_theory) + 1) 
    456468        plt.plot(data.x, resid, 'x') 
    457         plt.xlabel('spin echo length (nm)') 
     469        plt.xlabel('spin echo length ({})'.format(data._xunit)) 
    458470        plt.ylabel('residuals (P/P0)') 
    459471 
  • sasmodels/generate.py

    rfcd7bbd r78d3341  
    9191    in *Iqxy* and *Imagnetic*.  "magnetic* parameters will be used in 
    9292    *Imagnetic* only.  If *type* is the empty string, the parameter will 
    93     be used in all of *Iq*, *Iqxy* and *Imagnetic*. 
     93    be used in all of *Iq*, *Iqxy* and *Imagnetic*.  "sld" parameters 
     94    can automatically be promoted to magnetic parameters, each of which 
     95    will have a magnitude and a direction, which may be different from 
     96    other sld parameters. 
    9497 
    9598    *description* is a short description of the parameter.  This will 
     
    216219import re 
    217220import string 
     221import warnings 
    218222from collections import namedtuple 
    219223 
     
    604608    """ 
    605609    partype = { 
    606         'volume': [], 'orientation': [], 'magnetic': [], '': [], 
     610        'volume': [], 'orientation': [], 'magnetic': [], 'sld': [], '': [], 
    607611        'fixed-1d': [], 'fixed-2d': [], 'pd-1d': [], 'pd-2d': [], 
    608612        'pd-rel': set(), 
     
    618622        elif p.type == 'orientation': 
    619623            partype['pd-2d'].append(p.name) 
    620         elif p.type == '': 
     624        elif p.type in ('', 'sld'): 
    621625            partype['fixed-1d'].append(p.name) 
    622626            partype['fixed-2d'].append(p.name) 
     
    632636    """ 
    633637    # convert parameters into named tuples 
     638    for p in model_info['parameters']: 
     639        if p[4] == '' and (p[0].startswith('sld') or p[0].endswith('sld')): 
     640            p[4] = 'sld' 
     641            # TODO: make sure all models explicitly label their sld parameters 
     642            #raise ValueError("%s.%s needs to be explicitly set to type 'sld'" %(model_info['id'], p[0])) 
     643 
    634644    pars = [Parameter(*p) for p in model_info['parameters']] 
    635645    # Fill in the derived attributes 
  • sasmodels/models/adsorbed_layer.py

    r2f0c07d rf10bc52  
    1717     I(q) = \text{scale} \cdot(\rho_\text{poly}-\rho_\text{solvent})^2    \left[\frac{6\pi\phi_\text{core}}{Q^2}\frac{\Gamma^2}{\delta_\text{poly}^2R_\text{core}} \exp(-Q^2\sigma^2)\right] + \text{background} 
    1818 
    19 where *scale* is a scale factor, |rho|\ :sub:`poly` is the sld of the polymer (or surfactant) layer, |rho|\ :sub:`solv` is the sld of the solvent/medium and cores, |phi|\ :sub:`core` is the volume fraction of the core paraticles, |delta|\ :sub:`poly` is the bulk density of the polymer, |biggamma| is the adsorbed amount, and |sigma| is the second moment of the thickness distribution. 
     19where *scale* is a scale factor, |rho|\ :sub:`poly` is the sld of the polymer (or surfactant) layer, |rho|\ :sub:`solv` is the sld of the solvent/medium and cores, |phi|\ :sub:`core` is the volume fraction of the core particles, |delta|\ :sub:`poly` is the bulk density of the polymer, |biggamma| is the adsorbed amount, and |sigma| is the second moment of the thickness distribution. 
    2020 
    2121Note that all parameters except the |sigma| are correlated so fitting more than one of these parameters will generally fail. Also note that unlike other shape models, no volume normalization is applied to this model (the calculation is exact). 
     
    4646              ["density_poly", "g/cm3", 0.7, [0.0, inf], "", "Polymer density"], 
    4747              ["radius", "Ang", 500.0, [0.0, inf], "", "Particle radius"], 
    48               ["vol_frac", "None", 0.14, [0.0, inf], "", "Particle vol fraction"], 
     48              ["volfraction", "None", 0.14, [0.0, inf], "", "Particle vol fraction"], 
    4949              ["polymer_sld", "1/Ang^2", 1.5e-06, [-inf, inf], "", "Polymer SLD"], 
    5050              ["solvent_sld", "1/Ang^2", 6.3e-06, [-inf, inf], "", "Solvent SLD"]] 
     
    5252# NB: Scale and Background are implicit parameters on every model 
    5353def Iq(q, second_moment, adsorbed_amount, density_poly, radius,  
    54         vol_frac, polymer_sld, solvent_sld): 
     54        volfraction, polymer_sld, solvent_sld): 
    5555    # pylint: disable = missing-docstring 
    5656    deltarhosqrd =  (polymer_sld - solvent_sld) * (polymer_sld - solvent_sld) 
    57     numerator =  6.0 * pi * vol_frac * (adsorbed_amount * adsorbed_amount) 
     57    numerator =  6.0 * pi * volfraction * (adsorbed_amount * adsorbed_amount) 
    5858    denominator =  (q * q) * (density_poly * density_poly) * radius 
    5959    eterm =  exp(-1.0 * (q * q) * (second_moment * second_moment)) 
     
    7373            density_poly = 0.7, 
    7474            radius = 500.0, 
    75             vol_frac = 0.14, 
     75            volfraction = 0.14, 
    7676            polymer_sld = 1.5e-06, 
    7777            solvent_sld = 6.3e-06, 
     
    8484               density_poly = 'density_poly', 
    8585               radius = 'radius_core', 
    86                vol_frac = 'volf_cores', 
     86               volfraction = 'volf_cores', 
    8787               polymer_sld = 'sld_poly', 
    8888               solvent_sld = 'sld_solv', 
    8989               background = 'background') 
    9090 
     91# these unit test values taken from SasView 3.1.2 
    9192tests =  [ 
    9293    [{'scale': 1.0, 'second_moment': 23.0, 'adsorbed_amount': 1.9,  
    93      'density_poly': 0.7, 'radius': 500.0, 'vol_frac': 0.14,  
     94     'density_poly': 0.7, 'radius': 500.0, 'volfraction': 0.14,  
    9495     'polymer_sld': 1.5e-06, 'solvent_sld': 6.3e-06, 'background': 0.0}, 
    9596     [0.0106939, 0.469418], [73.741, 9.65391e-53]], 
  • sasmodels/models/core_shell_parallelepiped.py

    r6dd90c1 raa2edb2  
    9292by the NIST Center for Neutron Research (Kline, 2006). 
    9393 
    94 REFERENCE 
     94References 
     95---------- 
    9596 
    9697P Mittelbach and G Porod, *Acta Physica Austriaca*, 14 (1961) 185-211 
  • sasmodels/models/core_shell_sphere.py

    r7d4b2ae raa2edb2  
    4242our model and the output of the NIST software. 
    4343 
    44 .. figure:: img/core_shell_sphere_1d.jpg 
    45  
    46     Comparison of the SasView scattering intensity for a core-shell sphere with 
    47     the output of the NIST SANS analysis software. The parameters were set to: 
    48     *scale* = 1.0, *radius* = 60 , *contrast* = 1e-6 |Ang^-2|, and 
    49     *background* = 0.001 |cm^-1|. 
    5044""" 
    5145 
  • sasmodels/models/correlation_length.py

    r6dd90c1 raa2edb2  
    2525    q = \sqrt{q_x^2 + q_y^2} 
    2626 
    27 .. figure:: img/correlation_length_1d.jpg 
     27References 
     28---------- 
    2829 
    29     1D plot using the default values (w/500 data points). 
    30  
    31 REFERENCE 
    3230B Hammouda, D L Ho and S R Kline, Insight into Clustering in 
    3331Poly(ethylene oxide) Solutions, Macromolecules, 37 (2004) 6932-6937 
  • sasmodels/models/cylinder.py

    r6dd90c1 raa2edb2  
    6060---------- 
    6161 
    62 Validation of our code was done by comparing the output of the 1D model 
     62Validation of the code was done by comparing the output of the 1D model 
    6363to the output of the software provided by the NIST (Kline, 2006). 
    64 :num:`Figure #cylinder-compare` shows a comparison of 
    65 the 1D output of our model and the output of the NIST software. 
    66  
    67 .. _cylinder-compare: 
    68  
    69 .. figure:: img/cylinder_compare.jpg 
    70  
    71     Comparison of the SasView scattering intensity for a cylinder with the 
    72     output of the NIST SANS analysis software. 
    73     The parameters were set to: *scale* = 1.0, *radius* = 20 |Ang|, 
    74     *length* = 400 |Ang|, *contrast* = 3e-6 |Ang^-2|, and 
    75     *background* = 0.01 |cm^-1|. 
    76  
    77 In general, averaging over a distribution of orientations is done by 
    78 evaluating the following 
     64The implementation of the intensity for fully oriented cylinders was done 
     65by averaging over a uniform distribution of orientations using 
    7966 
    8067.. math:: 
     
    8673where $p(\theta,\phi)$ is the probability distribution for the orientation 
    8774and $P_0(q,\alpha)$ is the scattering intensity for the fully oriented 
    88 system. Since we have no other software to compare the implementation of 
    89 the intensity for fully oriented cylinders, we can compare the result of 
    90 averaging our 2D output using a uniform distribution $p(\theta, \phi) = 1.0$. 
    91 :num:`Figure #cylinder-crosscheck` shows the result of 
    92 such a cross-check. 
     75system, and then comparing to the 1D result. 
    9376 
    94 .. _cylinder-crosscheck: 
     77References 
     78---------- 
    9579 
    96 .. figure:: img/cylinder_crosscheck.jpg 
     80None 
    9781 
    98     Comparison of the intensity for uniformly distributed cylinders 
    99     calculated from our 2D model and the intensity from the NIST SANS 
    100     analysis software. 
    101     The parameters used were: *scale* = 1.0, *radius* = 20 |Ang|, 
    102     *length* = 400 |Ang|, *contrast* = 3e-6 |Ang^-2|, and 
    103     *background* = 0.0 |cm^-1|. 
    10482""" 
    10583 
  • sasmodels/models/dab.py

    r94bd809 raa2edb2  
    2626 
    2727.. math:: q = \sqrt{q_x^2 + q_y^2} 
    28  
    29 .. figure:: img/dab_1d.jpg 
    30  
    31    1D plot using the default values (w/200 data point). 
    3228 
    3329 
  • sasmodels/models/ellipsoid.py

    r2f0c07d raa2edb2  
    5959---------- 
    6060 
    61 Validation of our code was done by comparing the output of the 1D model 
     61Validation of the code was done by comparing the output of the 1D model 
    6262to the output of the software provided by the NIST (Kline, 2006). 
    63 :num:`Figure ellipsoid-comparison-1d` below shows a comparison of 
    64 the 1D output of our model and the output of the NIST software. 
    6563 
    66 .. _ellipsoid-comparison-1d: 
     64The implementation of the intensity for fully oriented ellipsoids was 
     65validated by averaging the 2D output using a uniform distribution 
     66$p(\theta,\phi) = 1.0$ and comparing with the output of the 1D calculation. 
    6767 
    68 .. figure:: img/ellipsoid_comparison_1d.jpg 
    69  
    70     Comparison of the SasView scattering intensity for an ellipsoid 
    71     with the output of the NIST SANS analysis software.  The parameters 
    72     were set to: *scale* = 1.0, *rpolar* = 20 |Ang|, 
    73     *requatorial* =400 |Ang|, *contrast* = 3e-6 |Ang^-2|, 
    74     and *background* = 0.01 |cm^-1|. 
    75  
    76 Averaging over a distribution of orientation is done by evaluating the 
    77 equation above. Since we have no other software to compare the 
    78 implementation of the intensity for fully oriented ellipsoids, we can 
    79 compare the result of averaging our 2D output using a uniform distribution 
    80 $p(\theta,\phi) = 1.0$.  :num:`Figure #ellipsoid-comparison-2d` 
    81 shows the result of such a cross-check. 
    8268 
    8369.. _ellipsoid-comparison-2d: 
  • sasmodels/models/elliptical_cylinder.py

    r5111921 raa2edb2  
    6464---------- 
    6565 
    66 Validation of our code was done by comparing the output of the 1D calculation to the angular average of the output of 
    67 the 2D calculation over all possible angles. The figure below shows the comparison where the solid dot refers to 
    68 averaged 2D values while the line represents the result of the 1D calculation (for the 2D averaging, values of 76, 180, 
    69 and 76 degrees are taken for the angles of |theta|, |phi|, and |bigpsi| respectively). 
     66Validation of our code was done by comparing the output of the 1D calculation to the  
     67angular average of the output of the 2D calculation over all possible angles.  
    7068 
    71 .. figure:: img/elliptical_cylinder_validation_1d.png 
    72  
    73     Comparison between 1D and averaged 2D. 
    74  
    75 In the 2D average, more binning in the angle |phi| is necessary to get the proper result. The following figure shows 
    76 the results of the averaging by varying the number of angular bins. 
     69In the 2D average, more binning in the angle |phi| is necessary to get the proper result.  
     70The following figure shows the results of the averaging by varying the number of angular bins. 
    7771 
    7872.. figure:: img/elliptical_cylinder_averaging.png 
  • sasmodels/models/flexible_cylinder.py

    re7678b2 raa2edb2  
    3434In the parameters, the sldCyl and sldSolv represent the SLD of the chain/cylinder 
    3535and solvent respectively. 
    36  
    37  
    38 .. figure:: img/flexible_cylinder_1d.jpg 
    39  
    40     1D plot using the default values (w/1000 data point). 
    41  
    4236 
    4337Our model uses the form factor calculations implemented in a c-library provided 
  • sasmodels/models/flexible_cylinder_ex.py

    re7678b2 raa2edb2  
    7070 
    7171**No inter-cylinder interference effects are included in this calculation.** 
    72  
    73 .. figure:: img/flexible_cylinder_ex_1d.jpg 
    74  
    75     1D plot using the default values (w/1000 data point). 
    7672 
    7773References 
  • sasmodels/models/fractal_core_shell.py

    r7d4b2ae raa2edb2  
    4343 
    4444    q = \sqrt{q_x^2 + q_y^2} 
    45  
    46 .. figure:: img/fractal_core_shell_1d.jpg 
    47  
    48     1D plot using the default values (w/500 data point). 
    4945 
    5046Reference 
  • sasmodels/models/fuzzy_sphere.py

    r8dca856 raa2edb2  
    4848 
    4949    q = \sqrt{{q_x}^2 + {q_y}^2} 
    50  
    51  
    52 .. figure:: img/fuzzy_sphere.jpg 
    53  
    54      This example dataset is produced by running the FuzzySphereModel, 
    55      using 200 data points, *qmin* = 0.001 -1, 
    56      *qmax* = 0.7 |Ang^-1|, background = 0.001 |cm^-1| and the default values. 
    57  
    5850 
    5951 
  • sasmodels/models/gauss_lorentz_gel.py

    r6dd90c1 raa2edb2  
    3232 
    3333    q = \sqrt{q_x^2 + q_y^2} 
    34  
    35  
    36 .. figure:: img/gauss_lorentz_gel_1d.jpg 
    37  
    38     1D plot using the default values (w/500 data point). 
    3934 
    4035 
  • sasmodels/models/gaussian_peak.py

    r13ed84c raa2edb2  
    2121    q = \sqrt{q_x^2 + q_y^2} 
    2222 
    23  
    24 .. figure:: img/gaussian_peak_1d.jpg 
    25  
    26     1D plot using the default values (w/500 data points). 
    2723 
    2824References 
  • sasmodels/models/gel_fit.py

    r6dd90c1 raa2edb2  
    3232~2.6 to 2.8. 
    3333 
    34  
    35 .. figure:: img/gel_fit_1d.png 
    36  
    37     1D plot using the default values (with 300 data points). 
    3834 
    3935Reference 
  • sasmodels/models/guinier_porod.py

    rfa8011eb raa2edb2  
    5050.. math:: 
    5151    q = \sqrt{q_x^2+q_y^2} 
    52  
    53 .. figure:: img/guinier_porod_model.jpg 
    54  
    55     Guinier-Porod model for $R_g=100$ |Ang|, $s=1$, $m=3$, and $background=0.1$. 
    5652 
    5753 
  • sasmodels/models/hardsphere.py

    rd529d93 r3bcd03d  
    3535    q = \sqrt{q_x^2 + q_y^2} 
    3636 
    37  
    38 .. figure:: img/hardSphere_1d.jpg 
    39  
    40     1D plot using the default values (in linear scale). 
    4137 
    4238References 
  • sasmodels/models/hayter_msa.py

    rd529d93 r54954e1  
    5151#  dp[2] = volfraction(); 
    5252#  dp[3] = temperature(); 
    53 #  dp[4] = saltconc(); 
     53#  dp[4] = salt_concentration(); 
    5454#  dp[5] = dielectconst(); 
    5555 
     
    7676    ["volfraction",   "None",     0.0192, [0, 0.74],   "", "volume fraction of spheres"], 
    7777    ["temperature",   "K",  318.16,   [0, inf],    "", "temperature, in Kelvin, for Debye length calculation"], 
    78     ["saltconc",      "M",    0.0,    [-inf, inf], "", "conc of salt, moles/litre, 1:1 electolyte, for Debye length"], 
     78    ["salt_concentration",      "M",    0.0,    [-inf, inf], "", "conc of salt, moles/litre, 1:1 electolyte, for Debye length"], 
    7979    ["dielectconst",  "None",    71.08,   [-inf, inf], "", "dielectric constant (relative permittivity) of solvent, default water, for Debye length"] 
    8080    ] 
     
    9696oldname = 'HayterMSAStructure' 
    9797#oldpars = dict(effect_radius="radius_effective",effect_radius_pd="radius_effective_pd",effect_radius_pd_n="radius_effective_pd_n") 
    98 oldpars = dict(radius_effective="effect_radius",radius_effective_pd="effect_radius_pd",radius_effective_pd_n="effect_radius_pd_n") 
     98oldpars = dict(radius_effective="effect_radius",radius_effective_pd="effect_radius_pd",radius_effective_pd_n="effect_radius_pd_n",salt_concentration="saltconc") 
    9999#oldpars = dict( ) 
    100100# default parameter set,  use  compare.sh -midQ -linear 
    101101# note the calculation varies in different limiting cases so a wide range of 
    102102# parameters will be required for a thorough test! 
    103 # odd that the default st has saltconc zero 
     103# odd that the default st has salt_concentration zero 
    104104demo = dict(radius_effective=20.75, 
    105105            charge=19.0, 
    106106            volfraction=0.0192, 
    107107            temperature=318.16, 
    108             saltconc=0.05, 
     108            salt_concentration=0.05, 
    109109            dielectconst=71.08, 
    110110            radius_effective_pd=0.1, 
     
    120120      'volfraction': 0.0192, 
    121121      'temperature': 298.0, 
    122       'saltconc': 0, 
     122      'salt_concentration': 0, 
    123123      'dielectconst': 78.0, 
    124124      'radius_effective_pd': 0}, 
     
    130130      'volfraction': 0.0192, 
    131131      'temperature': 298.0, 
    132       'saltconc': 0.05, 
     132      'salt_concentration': 0.05, 
    133133      'dielectconst': 78.0, 
    134134      'radius_effective_pd': 0.1, 
  • sasmodels/models/hollow_rectangular_prism.py

    r6dd90c1 raa2edb2  
    7575of the 1D model to the curves shown in (Nayuk, 2012). 
    7676 
    77 REFERENCES 
     77 
     78References 
     79---------- 
    7880 
    7981R Nayuk and K Huber, *Z. Phys. Chem.*, 226 (2012) 837-854 
  • sasmodels/models/hollow_rectangular_prism_infinitely_thin_walls.py

    r6dd90c1 raa2edb2  
    6767of the 1D model to the curves shown in (Nayuk, 2012). 
    6868 
    69 REFERENCES 
     69 
     70References 
     71---------- 
    7072 
    7173R Nayuk and K Huber, *Z. Phys. Chem.*, 226 (2012) 837-854 
  • sasmodels/models/lamellar.py

    r348557a raa2edb2  
    2727 
    2828    q = \sqrt{q_x^2 + q_y^2} 
    29  
    30  
    31 .. figure:: img/lamellar_1d.jpg 
    32  
    33     1D plot using the default values (w/1000 data point). 
    3429 
    3530 
  • sasmodels/models/lamellarCaille.py

    rec2ca99 raa2edb2  
    6060    q = \sqrt{q_x^2 + q_y^2} 
    6161 
    62 .. figure:: img/lamellarCaille_1d.jpg 
    63  
    64     1D plot using the default values (w/6000 data point). 
    6562 
    6663References 
  • sasmodels/models/lamellarCailleHG.py

    r652a78a raa2edb2  
    6363    q = \sqrt{q_x^2 + q_y^2} 
    6464 
    65 .. figure:: img/lamellarCailleHG_1d.jpg 
    66  
    67     1D plot using the default values (w/6000 data point). 
    6865 
    6966References 
  • sasmodels/models/lamellarFFHG.py

    r3eb6b90 raa2edb2  
    3636    q = \sqrt{q_x^2 + q_y^2} 
    3737 
    38  
    39 .. figure:: img/lamellarFFHG_1d.jpg 
    40  
    41     1D plot using the default values (w/1000 data point). 
    4238 
    4339References 
  • sasmodels/models/lamellarPC.py

    r13ed84c raa2edb2  
    8484 
    8585 
    86 .. figure:: img/lamellarPC_1d.jpg 
    87  
    88     1D plot using the default values above (w/20000 data point). 
    89  
    9086Reference 
    9187--------- 
  • sasmodels/models/lorentz.py

    r6dd90c1 raa2edb2  
    1616.. math:: q=\sqrt{q_x^2 + q_y^2} 
    1717 
    18 .. figure:: img/lorentz_1d.jpg 
    19  
    20     1D plot using the default values (w/200 data point). 
    2118 
    2219References 
  • sasmodels/models/mass_fractal.py

    r684eff9 r684eff9  
    4545    $q$ range (see the reference for details). 
    4646 
    47 .. figure:: img/mass_fractal_1d.jpg 
    48  
    49     1D plot using the default values. 
    5047 
    5148Reference 
  • sasmodels/models/mass_surface_fractal.py

    r6dd90c1 raa2edb2  
    4545    $(surface_dim + mass_dim ) < 6$ . 
    4646 
    47 .. figure:: img/mass_surface_fractal_1d.jpg 
    48  
    49     1D plot using the default values. 
    5047 
    5148Reference 
  • sasmodels/models/mono_gauss_coil.py

    r246517d rf10bc52  
    8686               background = 'background') 
    8787 
     88# these unit test values taken from SasView 3.1.2 
    8889tests =  [ 
    89     [{'scale': 70.0, 'radius_gyration': 75.0, 'background': 0.0}, 
     90    [{'scale': 1.0, 'i_zero': 70.0, 'radius_gyration': 75.0, 'background': 0.0}, 
    9091     [0.0106939, 0.469418], [57.1241, 0.112859]], 
    9192    ] 
  • sasmodels/models/parallelepiped.py

    r6dd90c1 raa2edb2  
    143143Validation of the code was done by comparing the output of the 1D calculation 
    144144to the angular average of the output of a 2D calculation over all possible 
    145 angles. The Figure below shows the comparison where the solid dot refers to 
    146 averaged 2D while the line represents the result of the 1D calculation (for 
    147 the averaging, 76, 180, 76 points are taken for the angles of $\theta$, 
    148 $\phi$, and $\Psi$ respectively). 
    149  
    150 .. _parallelepiped-compare: 
    151  
    152 .. figure:: img/parallelepiped_compare.png 
    153  
    154    Comparison between 1D and averaged 2D. 
     145angles.  
    155146 
    156147This model is based on form factor calculations implemented in a c-library 
    157148provided by the NIST Center for Neutron Research (Kline, 2006). 
     149 
     150References 
     151---------- 
     152 
     153None. 
    158154""" 
    159155 
  • sasmodels/models/peak_lorentz.py

    r04b0b30 raa2edb2  
    2121    q = \sqrt{q_x^2 + q_y^2} 
    2222 
    23  
    24 .. figure:: img/peak_lorentz_1d.jpg 
    25  
    26     1D plot using the default values (w/200 data point). 
    2723 
    2824References 
  • sasmodels/models/polymer_excl_volume.py

    r6dd90c1 raa2edb2  
    8181 
    8282    q = \sqrt{q_x^2 + q_y^2} 
    83  
    84 This example dataset is produced using 200 data points, $qmin=0.001Ang^{-1}$, 
    85 $qmax=0.2Ang^{-1}$ and the default values 
    86  
    87 .. figure:: img/polymer_excl_volume_1d.jpg 
    88  
    89     1D plot using the default values (w/500 data point). 
    9083 
    9184 
  • sasmodels/models/power_law.py

    rb15849c raa2edb2  
    2020combining this model with other models. 
    2121 
    22 .. figure:: img/power_law_1d.jpg 
    23  
    24     1D plot using the default values (w/200 data point). 
    2522 
    2623References 
  • sasmodels/models/rectangular_prism.py

    r6dd90c1 raa2edb2  
    7171to the output of the existing :ref:`parallelepiped` model. 
    7272 
    73 REFERENCES 
     73 
     74References 
     75---------- 
    7476 
    7577P Mittelbach and G Porod, *Acta Physica Austriaca*, 14 (1961) 185-211 
  • sasmodels/models/rpa.py

    r5cfda00 raa2edb2  
    4343component. 
    4444 
    45 .. figure:: img/rpa_1d.jpg 
    46  
    47     1D plot using the default values (w/500 data points). 
    4845 
    4946References 
  • sasmodels/models/sphere.py

    rad90df9 raa2edb2  
    3333Validation of our code was done by comparing the output of the 1D model 
    3434to the output of the software provided by the NIST (Kline, 2006). 
    35 Figure :num:`figure #sphere-comparison` shows a comparison of the output 
    36 of our model and the output of the NIST software. 
    37  
    38 .. _sphere-comparison: 
    39  
    40 .. figure:: img/sphere_comparison.jpg 
    41  
    42     Comparison of the DANSE scattering intensity for a sphere with the 
    43     output of the NIST SANS analysis software. The parameters were set to: 
    44     *scale* = 1.0, *radius* = 60 |Ang|, *contrast* = 1e-6 |Ang^-2|, and 
    45     *background* = 0.01 |cm^-1|. 
    4635 
    4736 
  • sasmodels/models/spherepy.py

    rd2950f4 raa2edb2  
    3333Validation of our code was done by comparing the output of the 1D model 
    3434to the output of the software provided by the NIST (Kline, 2006). 
    35 Figure :num:`figure #spherepy-comparison` shows a comparison of the output 
    36 of our model and the output of the NIST software. 
    37  
    38 .. _spherepy-comparison: 
    39  
    40 .. figure:: img/sphere_comparison.jpg 
    41  
    42     Comparison of the DANSE scattering intensity for a sphere with the 
    43     output of the NIST SANS analysis software. The parameters were set to: 
    44     *scale* = 1.0, *radius* = 60 |Ang|, *contrast* = 1e-6 |Ang^-2|, and 
    45     *background* = 0.01 |cm^-1|. 
    4635 
    4736 
  • sasmodels/models/star_polymer.py

    r6dd90c1 raa2edb2  
    2626 
    2727is the square of the ensemble average radius-of-gyration of an arm. 
    28  
    29 .. figure:: img/star_polymer_1d.jpg 
    30  
    31     1D plot using the default values. 
    3228 
    3329 
  • sasmodels/models/stickyhardsphere.py

    rd529d93 r54954e1  
    5959    q = \sqrt{q_x^2 + q_y^2} 
    6060 
    61 .. figure:: img/stickyhardsphere_1d.jpg 
    62  
    63     1D plot using the default values (in linear scale). 
    6461 
    6562References 
     
    9188    #   [ "name", "units", default, [lower, upper], "type", 
    9289    #     "description" ], 
    93     ["effect_radius", "Ang", 50.0, [0, inf], "volume", 
     90    ["radius_effective", "Ang", 50.0, [0, inf], "volume", 
    9491     "effective radius of hard sphere"], 
    9592    ["volfraction", "", 0.2, [0, 0.74], "", 
     
    116113    eta = volfraction/onemineps/onemineps/onemineps; 
    117114 
    118     sig = 2.0 * effect_radius; 
     115    sig = 2.0 * radius_effective; 
    119116    aa = sig/onemineps; 
    120117    etam1 = 1.0 - eta; 
     
    182179 
    183180oldname = 'StickyHSStructure' 
    184 oldpars = dict() 
    185 demo = dict(effect_radius=200, volfraction=0.2, perturb=0.05, 
    186             stickiness=0.2, effect_radius_pd=0.1, effect_radius_pd_n=40) 
     181oldpars = dict(radius_effective="effect_radius",radius_effective_pd="effect_radius_pd",radius_effective_pd_n="effect_radius_pd_n") 
     182demo = dict(radius_effective=200, volfraction=0.2, perturb=0.05, 
     183            stickiness=0.2, radius_effective_pd=0.1, radius_effective_pd_n=40) 
    187184# 
    188185tests = [ 
    189         [ {'scale': 1.0, 'background' : 0.0, 'effect_radius' : 50.0, 'perturb' : 0.05, 'stickiness' : 0.2, 'volfraction' : 0.1, 
    190            'effect_radius_pd' : 0}, [0.001, 0.003], [1.09718, 1.087830]] 
     186        [ {'scale': 1.0, 'background' : 0.0, 'radius_effective' : 50.0, 'perturb' : 0.05, 'stickiness' : 0.2, 'volfraction' : 0.1, 
     187           'radius_effective_pd' : 0}, [0.001, 0.003], [1.09718, 1.087830]] 
    191188        ] 
    192189 
  • sasmodels/models/surface_fractal.py

    r6dd90c1 raa2edb2  
    4444    details) 
    4545 
    46  
    47 .. figure:: img/surface_fractal_1d.jpg 
    48  
    49     1D plot using the default values. 
    5046 
    5147Reference 
  • sasmodels/models/teubner_strey.py

    r6dd90c1 raa2edb2  
    3535    q = \sqrt{q_x^2 + q_y^2} 
    3636 
    37  
    38 .. figure:: img/teubner_strey_1d.jpg 
    39  
    40     1D plot using the default values (w/200 data point). 
    4137 
    4238References 
  • sasmodels/models/triaxial_ellipsoid.py

    r2f0c07d raa2edb2  
    64641D calculation to the angular average of the output of 2D calculation 
    6565over all possible angles. 
    66 :num:`Figure #triaxial-ellipsoid-comparison` shows the comparison where 
    67 the solid dot refers to averaged 2D while the line represents the 
    68 result of 1D calculation (for 2D averaging, 76, 180, and 76 points 
    69 are taken for the angles of $\theta$, $\phi$, and $\psi$ respectively). 
    7066 
    71 .. _triaxial-ellipsoid-comparison: 
    72  
    73 .. figure:: img/triaxial_ellipsoid_comparison.png 
    74  
    75     Comparison between 1D and averaged 2D. 
    7667 
    7768References 
  • sasmodels/models/two_lorentzian.py

    r168052c raa2edb2  
    2424    q = \sqrt{q_x^2 + q_y^2} 
    2525 
    26  
    27 .. figure:: img/two_lorentzian.jpg 
    28  
    29     1D plot using the default values (w/500 data point). 
    3026 
    3127References 
  • sasmodels/models/two_power_law.py

    r7e1d090 raa2edb2  
    3636    q = \sqrt{q_x^2 + q_y^2} 
    3737 
    38  
    39 .. figure:: img/two_power_law_1d.jpg 
    40  
    41     1D plot using the default values (with 500 data point). 
    4238 
    4339References 
  • sasmodels/models/vesicle.py

    r6dd90c1 raa2edb2  
    5050radius for *S(Q)* when *P(Q)* \* *S(Q)* is applied. 
    5151 
    52 .. figure:: img/vesicle_1d.jpg 
    5352 
    54     1D plot using the default values given in the table (w/200 data point). 
    55     Polydispersity and instrumental resolution normally will smear out most 
    56     of the rapidly oscillating features. 
    57  
    58 REFERENCE 
     53References 
     54---------- 
    5955 
    6056A Guinier and G. Fournet, *Small-Angle Scattering of X-Rays*, John Wiley and 
  • sasmodels/product.py

    rfcd7bbd r3bcd03d  
    1818SCALE=0 
    1919BACKGROUND=1 
    20 EFFECT_RADIUS=2 
     20RADIUS_EFFECTIVE=2 
    2121VOLFRACTION=3 
    2222 
     
    3131    assert s_pars[BACKGROUND].name == 'background' 
    3232    # We require structure factors to start with effect radius and volfraction 
    33     assert s_pars[EFFECT_RADIUS].name == 'effect_radius' 
     33    assert s_pars[RADIUS_EFFECTIVE].name == 'radius_effective' 
    3434    assert s_pars[VOLFRACTION].name == 'volfraction' 
    3535    # Combine the parameter sets.  We are skipping the first three 
Note: See TracChangeset for help on using the changeset viewer.