Changeset d57b06c in sasmodels


Ignore:
Timestamp:
Mar 30, 2019 4:06:15 PM (4 months ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master
Children:
be0942c
Parents:
a42b091 (diff), e15a822 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge remote-tracking branch 'origin/master' into ticket-1263-source-link

Files:
2 added
126 edited
1 moved

Legend:

Unmodified
Added
Removed
  • doc/guide/index.rst

    rda5536f rbc69321  
    1212   pd/polydispersity.rst 
    1313   resolution.rst 
     14   plugin.rst 
     15   fitting_sq.rst 
    1416   magnetism/magnetism.rst 
    1517   orientation/orientation.rst 
    1618   sesans/sans_to_sesans.rst 
    1719   sesans/sesans_fitting.rst 
    18    plugin.rst 
    1920   scripting.rst 
    2021   refs.rst 
  • doc/guide/plugin.rst

    rc94ab04 re15a822  
    303303**Note: The order of the parameters in the definition will be the order of the 
    304304parameters in the user interface and the order of the parameters in Fq(), Iq(), 
    305 Iqac(), Iqabc(), form_volume() and shell_volume(). 
     305Iqac(), Iqabc(), radius_effective(), form_volume() and shell_volume(). 
    306306And** *scale* **and** *background* **parameters are implicit to all models, 
    307307so they do not need to be included in the parameter table.** 
     
    387387can take arbitrary values, even for integer parameters, so your model should 
    388388round the incoming parameter value to the nearest integer inside your model 
    389 you should round to the nearest integer.  In C code, you can do this using:: 
     389you should round to the nearest integer.  In C code, you can do this using: 
     390 
     391.. code-block:: c 
    390392 
    391393    static double 
     
    454456............. 
    455457 
     458.. note:: 
     459 
     460   Pure python models do not yet support direct computation of $<F(Q)^2>$ or 
     461   $<F(Q)>^2$. Neither do they support orientational distributions or magnetism 
     462   (use C models if these are required). 
     463 
    456464For pure python models, define the *Iq* function:: 
    457465 
     
    499507Models should define *form_volume(par1, par2, ...)* where the parameter 
    500508list includes the *volume* parameters in order.  This is used for a weighted 
    501 volume normalization so that scattering is on an absolute scale.  If 
    502 *form_volume* is not defined, then the default *form_volume = 1.0* will be 
    503 used. 
     509volume normalization so that scattering is on an absolute scale.  For 
     510solid shapes, the *I(q)* function should use *form_volume* squared 
     511as its scale factor.  If *form_volume* is not defined, then the default 
     512*form_volume = 1.0* will be used. 
    504513 
    505514Hollow shapes, where the volume fraction of particle corresponds to the 
    506515material in the shell rather than the volume enclosed by the shape, must 
    507516also define a *shell_volume(par1, par2, ...)* function.  The parameters 
    508 are the same as for *form_volume*.  The *I(q)* calculation should use 
    509 *shell_volume* squared as its scale factor for the volume normalization. 
    510 The structure factor calculation needs *form_volume* in order to properly 
    511 scale the volume fraction parameter, so both functions are required for 
    512 hollow shapes. 
    513  
    514 **Note: Pure python models do not yet support direct computation of the** 
    515 **average of $F(q)$ and $F^2(q)$. Neither do they support orientational** 
    516 **distributions or magnetism (use C models if these are required).** 
     517are the same as for *form_volume*.  Here the *I(q)* function should use 
     518*shell_volume* squared instead of *form_volume* squared so that the scale 
     519parameter corresponds to the volume fraction of material in the sample. 
     520The structure factor calculation needs the volume fraction of the filled 
     521shapes for its calculation, so the volume fraction parameter in the model 
     522is automatically scaled by *form_volume/shell_volume* prior to calling the 
     523structure factor. 
    517524 
    518525Embedded C Models 
     
    525532    """ 
    526533 
    527 This expands into the equivalent C code:: 
     534This expands into the equivalent C code: 
     535 
     536.. code-block:: c 
    528537 
    529538    double Iq(double q, double par1, double par2, ...); 
     
    536545includes only the volume parameters. 
    537546 
    538 *form_volume* defines the volume of the shell for hollow shapes. As in 
     547*shell_volume* defines the volume of the shell for hollow shapes. As in 
    539548python models, it includes only the volume parameters. 
    540549 
     
    568577Rather than returning NAN from Iq, you must define the *INVALID(v)*.  The 
    569578*v* parameter lets you access all the parameters in the model using 
    570 *v.par1*, *v.par2*, etc. For example:: 
     579*v.par1*, *v.par2*, etc. For example: 
     580 
     581.. code-block:: c 
    571582 
    572583    #define INVALID(v) (v.bell_radius < v.radius) 
     
    583594 
    584595Instead of defining the *Iq* function, models can define *Fq* as 
    585 something like:: 
     596something like: 
     597 
     598.. code-block:: c 
    586599 
    587600    double Fq(double q, double *F1, double *F2, double par1, double par2, ...); 
     
    615628laboratory frame and beam travelling along $-z$. 
    616629 
    617 The oriented C model (oriented pure Python models are not supported)  
     630The oriented C model (oriented pure Python models are not supported) 
    618631is called using *Iqabc(qa, qb, qc, par1, par2, ...)* where 
    619632*par1*, etc. are the parameters to the model.  If the shape is rotationally 
     
    644657 
    645658Using the $z, w$ values for Gauss-Legendre integration in "lib/gauss76.c", the 
    646 numerical integration is then:: 
     659numerical integration is then: 
     660 
     661.. code-block:: c 
    647662 
    648663    double outer_sum = 0.0; 
     
    9871002  memory, and wrong answers computed. The conclusion from a very long and 
    9881003  strange debugging session was that any arrays that you declare in your 
    989   model should be a multiple of four. For example:: 
     1004  model should be a multiple of four. For example: 
     1005 
     1006  .. code-block:: c 
    9901007 
    9911008      double Iq(q, p1, p2, ...) 
     
    10191036structure factor is the *hardsphere* interaction, which 
    10201037uses the effective radius of the form factor as an input to the structure 
    1021 factor model.  The effective radius is the average radius of the 
    1022 form averaged over all the polydispersity values. 
    1023  
    1024 :: 
    1025  
    1026     def ER(radius, thickness): 
    1027         """Effective radius of a core-shell sphere.""" 
    1028         return radius + thickness 
    1029  
    1030 Now consider the *core_shell_sphere*, which has a simple effective radius 
    1031 equal to the radius of the core plus the thickness of the shell, as 
    1032 shown above. Given polydispersity over *(r1, r2, ..., rm)* in radius and 
    1033 *(t1, t2, ..., tn)* in thickness, *ER* is called with a mesh 
    1034 grid covering all possible combinations of radius and thickness. 
    1035 That is, *radius* is *(r1, r2, ..., rm, r1, r2, ..., rm, ...)* 
    1036 and *thickness* is *(t1, t1, ... t1, t2, t2, ..., t2, ...)*. 
    1037 The *ER* function returns one effective radius for each combination. 
    1038 The effective radius calculator weights each of these according to 
    1039 the polydispersity distributions and calls the structure factor 
    1040 with the average *ER*. 
    1041  
    1042 :: 
    1043  
    1044     def VR(radius, thickness): 
    1045         """Sphere and shell volumes for a core-shell sphere.""" 
    1046         whole = 4.0/3.0 * pi * (radius + thickness)**3 
    1047         core = 4.0/3.0 * pi * radius**3 
    1048         return whole, whole - core 
    1049  
    1050 Core-shell type models have an additional volume ratio which scales 
    1051 the structure factor.  The *VR* function returns the volume of 
    1052 the whole sphere and the volume of the shell. Like *ER*, there is 
    1053 one return value for each point in the mesh grid. 
    1054  
    1055 *NOTE: we may be removing or modifying this feature soon. As of the 
    1056 time of writing, core-shell sphere returns (1., 1.) for VR, giving a volume 
    1057 ratio of 1.0.* 
     1038factor model.  The effective radius is the weighted average over all 
     1039values of the shape in polydisperse systems. 
     1040 
     1041There can be many notions of effective radius, depending on the shape.  For 
     1042a sphere it is clearly just the radius, but for an ellipsoid of revolution 
     1043we provide average curvature, equivalent sphere radius, minimum radius and 
     1044maximum radius.  These options are listed as *radius_effective_modes* in 
     1045the python model defintion, and must be computed by the *radius_effective* 
     1046function which takes the *radius_effective_mode* parameter as an integer, 
     1047along with the various model parameters.  Unlike normal C/Python arrays, 
     1048the first mode is 1, the second is 2, etc.  Mode 0 indicates that the 
     1049effective radius from the shape is to be ignored in favour of the the 
     1050effective radius parameter in the structure factor model. 
     1051 
     1052 
     1053Consider the core-shell sphere, which defines the following effective radius 
     1054modes in the python model:: 
     1055 
     1056    radius_effective_modes = [ 
     1057        "outer radius", 
     1058        "core radius", 
     1059    ] 
     1060 
     1061and the following function in the C-file for the model: 
     1062 
     1063.. code-block:: c 
     1064 
     1065    static double 
     1066    radius_effective(int mode, double radius, double thickness) 
     1067    { 
     1068        switch (mode) { 
     1069            case 0: return radius + thickness; 
     1070            case 1: return radius; 
     1071            default: return 0.; 
     1072        } 
     1073    } 
     1074 
     1075    static double 
     1076    form_volume(double radius, double thickness) 
     1077    { 
     1078        return M_4PI_3 * cube(radius + thickness); 
     1079    } 
     1080 
     1081Given polydispersity over *(r1, r2, ..., rm)* in radius and *(t1, t2, ..., tn)* 
     1082in thickness, *radius_effective* is called over a mesh grid covering all 
     1083possible combinations of radius and thickness, with a single *(ri, tj)* pair 
     1084in each call. The weights each of these results according to the 
     1085polydispersity distributions and calls the structure factor with the average 
     1086effective radius.  Similarly, for *form_volume*. 
     1087 
     1088Hollow models have an additional volume ratio which is needed to scale the 
     1089structure factor.  The structure factor uses the volume fraction of the filled 
     1090particles as part of its density estimate, but the scale factor for the 
     1091scattering intensity (as non-solvent volume fraction / volume) is determined 
     1092by the shell volume only.  Therefore the *shell_volume* function is 
     1093needed to compute the form:shell volume ratio, which then scales the 
     1094*volfraction* parameter prior to calling the structure factor calculator. 
     1095In the case of a hollow sphere, this would be: 
     1096 
     1097.. code-block:: c 
     1098 
     1099    static double 
     1100    shell_volume(double radius, double thickness) 
     1101    { 
     1102        double whole = M_4PI_3 * cube(radius + thickness); 
     1103        double core = M_4PI_3 * cube(radius); 
     1104        return whole - core; 
     1105    } 
     1106 
     1107If *shell_volume* is not present, then *form_volume* and *shell_volume* are 
     1108assumed to be equal, and the shape is considered solid. 
    10581109 
    10591110Unit Tests 
     
    11151166................... 
    11161167 
    1117 **NB: For now, this more detailed testing is only possible if you have a  
     1168**NB: For now, this more detailed testing is only possible if you have a 
    11181169SasView build environment available!** 
    11191170 
     
    12531304| 2016-10-25 Steve King 
    12541305| 2017-05-07 Paul Kienzle - Moved from sasview to sasmodels docs 
     1306| 2019-03-28 Paul Kienzle - Update docs for radius_effective and shell_volume 
  • doc/guide/resolution.rst

    r8d2df05 rdb1d9d5  
    11.. resolution.rst 
    22 
    3 .. This is a port of the original SasView html help file sm_help to ReSTructured  
     3.. This is a port of the original SasView html help file sm_help to ReSTructured 
    44.. text by S King, ISIS, during SasView CodeCamp-III in Feb 2015. 
    55 
     
    1717resolution contribution into a model calculation/simulation (which by definition 
    1818will be exact) to make it more representative of what has been measured 
    19 experimentally - a process called *smearing*. The Sasmodels component of SasView  
     19experimentally - a process called *smearing*. The Sasmodels component of SasView 
    2020does the latter. 
    2121 
     
    3232 
    3333.. note:: 
    34     Problems may be encountered if the data set loaded by SasView is a  
    35     concatenation of SANS data from several detector distances where, of  
    36     course, the worst Q resolution is next to the beam stop at each detector  
    37     distance. (This will also be noticeable in the residuals plot where  
    38     there will be poor overlap). SasView sensibly orders all the input  
    39     data points by increasing Q for nicer-looking plots, however, the dQ  
    40     data can then vary considerably from point to point. If 'Use dQ data'  
    41     smearing is selected then spikes may appear in the model fits, whereas  
     34    Problems may be encountered if the data set loaded by SasView is a 
     35    concatenation of SANS data from several detector distances where, of 
     36    course, the worst Q resolution is next to the beam stop at each detector 
     37    distance. (This will also be noticeable in the residuals plot where 
     38    there will be poor overlap). SasView sensibly orders all the input 
     39    data points by increasing Q for nicer-looking plots, however, the dQ 
     40    data can then vary considerably from point to point. If 'Use dQ data' 
     41    smearing is selected then spikes may appear in the model fits, whereas 
    4242    if 'None' or 'Custom Pinhole Smear' are selected the fits look normal. 
    43      
    44     In such instances, possible solutions are to simply remove the data  
    45     with poor Q resolution from the shorter detector distances, or to fit  
     43 
     44    In such instances, possible solutions are to simply remove the data 
     45    with poor Q resolution from the shorter detector distances, or to fit 
    4646    the data from different detector distances simultaneously. 
    4747 
  • explore/beta/sasfit_compare.py

    r119073a ra34b811  
    408408        #radius_effective=12.59921049894873, 
    409409        ) 
    410     target = sasmodels_theory(q, model, effective_radius_mode=0, structure_factor_mode=1, **pars) 
     410    target = sasmodels_theory(q, model, radius_effective_mode=0, structure_factor_mode=1, **pars) 
    411411    actual = ellipsoid_pe(q, norm='sasview', **pars) 
    412412    title = " ".join(("sasmodels", model, pd_type)) 
  • explore/beta/sasfit_compare_new.py

    rb6422c7 ra34b811  
    360360#polydispersity for hollow_cylinder 
    361361def hollow_cylinder_pe(q,radius=20, thickness=10, length=80, sld=4, sld_solvent=1, volfraction=0.15, 
    362         radius_pd=0.1, thickness_pd=0.2, length_pd=0.05, radius_pd_type="gaussian", length_pd_type="gaussian",  
     362        radius_pd=0.1, thickness_pd=0.2, length_pd=0.05, radius_pd_type="gaussian", length_pd_type="gaussian", 
    363363        thickness_pd_type="gaussian", radius_effective=None, background=0, scale=1, 
    364364                 norm='sasview'): 
     
    595595#       this one is only used locally for "actual" 
    596596        ) 
    597     target = sasmodels_theory(q, model, effective_radius_mode=0, structure_factor_mode=1, **pars) 
     597    target = sasmodels_theory(q, model, radius_effective_mode=0, structure_factor_mode=1, **pars) 
    598598    actual = sphere_r(q, norm='sasview', **pars) 
    599599    title = " ".join(("sasmodels", model, pd_type)) 
     
    612612        background=0, 
    613613        radius_pd=0.01, thickness_pd=0.01, radius_pd_type=pd_type, thickness_pd_type=pd_type, 
    614         radius_effective=30. )  
     614        radius_effective=30. ) 
    615615        # equivalent average sphere radius for local "actual" to match what sasview uses, use None to compute average outer radius here, 
    616616 
    617     target = sasmodels_theory(q, model, effective_radius_mode=0, structure_factor_mode=1, **pars) 
     617    target = sasmodels_theory(q, model, radius_effective_mode=0, structure_factor_mode=1, **pars) 
    618618    actual = vesicle_pe(q, norm='sasview', **pars) 
    619619    title = " ".join(("sasmodels", model, pd_type)) 
     
    633633        background=0, 
    634634        radius_pd=0.1, thickness_pd=0.0, length_pd=0.0, radius_pd_type=pd_type, thickness_pd_type=pd_type, length_pd_type=pd_type, 
    635         radius_effective=40.687)   
     635        radius_effective=40.687) 
    636636        # equivalent average sphere radius for local "actual" to match what sasview uses 
    637     target = sasmodels_theory(q, model, effective_radius_mode=0, structure_factor_mode=1, **pars) 
     637    target = sasmodels_theory(q, model, radius_effective_mode=0, structure_factor_mode=1, **pars) 
    638638    actual = hollow_cylinder_pe(q, norm='sasview', **pars) 
    639639# RKH monodisp was OK,    actual = hollow_cylinder_theta(q,radius=20, thickness=10, length=80, sld=4, sld_solvent=1 ) 
     
    656656# if change radius_effective to some other value, the S(Q) from sasview does not agree 
    657657        ) 
    658     target = sasmodels_theory(q, model, effective_radius_mode=0, structure_factor_mode=1, **pars) 
     658    target = sasmodels_theory(q, model, radius_effective_mode=0, structure_factor_mode=1, **pars) 
    659659    actual = ellipsoid_pe(q, norm='sasview', **pars) 
    660660# RKH test       actual = ellipsoid_theta(q, radius_polar=20, radius_equatorial=400, sld=4, sld_solvent=1, volfraction=0.15, radius_effective=270.) 
  • sasmodels/conversion_table.py

    rfa8e6dc ref476e6  
    854854            "TwoPowerLawModel", 
    855855        ], 
    856         "unified_power_rg": [ 
     856        "unified_power_Rg": [ 
    857857            "UnifiedPowerRg", 
    858858            dict(((field_new+str(index), field_old+str(index)) 
  • sasmodels/convert.py

    rfa8e6dc ref476e6  
    606606            if pars['volfraction_a'] > 0.5: 
    607607                pars['volfraction_a'] = 1.0 - pars['volfraction_a'] 
    608         elif name == 'unified_power_rg': 
     608        elif name == 'unified_power_Rg': 
    609609            pars['level'] = int(pars['level']) 
    610610 
  • sasmodels/core.py

    rb297ba9 r9562dd2  
    376376    # type: () -> None 
    377377    """Check that model load works""" 
     378    from .product import RADIUS_ID, VOLFRAC_ID, STRUCTURE_MODE_ID, RADIUS_MODE_ID 
    378379    #Test the the model produces the parameters that we would expect 
    379380    model = load_model("cylinder@hardsphere*sphere") 
    380381    actual = [p.name for p in model.info.parameters.kernel_parameters] 
    381     target = ("sld sld_solvent radius length theta phi" 
    382               " radius_effective volfraction " 
    383               " structure_factor_mode radius_effective_mode" 
    384               " A_sld A_sld_solvent A_radius").split() 
     382    target = ["sld", "sld_solvent", "radius", "length", "theta", "phi", 
     383              RADIUS_ID, VOLFRAC_ID, STRUCTURE_MODE_ID, RADIUS_MODE_ID, 
     384              "A_sld", "A_sld_solvent", "A_radius"] 
    385385    assert target == actual, "%s != %s"%(target, actual) 
    386386 
  • sasmodels/direct_model.py

    rb297ba9 re220acc  
    5959    """ 
    6060    mesh = get_mesh(calculator.info, pars, dim=calculator.dim, mono=mono) 
    61     #print("pars", list(zip(*mesh))[0]) 
     61    #print("in call_kernel: pars:", list(zip(*mesh))[0]) 
    6262    call_details, values, is_magnetic = make_kernel_args(calculator, mesh) 
    63     #print("values:", values) 
     63    #print("in call_kernel: values:", values) 
    6464    return calculator(call_details, values, cutoff, is_magnetic) 
    6565 
     
    7272 
    7373    Use parameter *radius_effective_mode* to select the effective radius 
    74     calculation. 
     74    calculation to use amongst the *radius_effective_modes* list given in the 
     75    model. 
    7576    """ 
    7677    R_eff_type = int(pars.pop(RADIUS_MODE_ID, 1.0)) 
    7778    mesh = get_mesh(calculator.info, pars, dim=calculator.dim, mono=mono) 
    78     #print("pars", list(zip(*mesh))[0]) 
     79    #print("in call_Fq: pars", list(zip(*mesh))[0]) 
    7980    call_details, values, is_magnetic = make_kernel_args(calculator, mesh) 
    80     #print("values:", values) 
     81    #print("in call_Fq: values:", values) 
    8182    return calculator.Fq(call_details, values, cutoff, is_magnetic, R_eff_type) 
    8283 
     
    118119        active = lambda name: True 
    119120 
    120     #print("pars",[p.id for p in parameters.call_parameters]) 
     121    #print("in get_mesh: pars:",[p.id for p in parameters.call_parameters]) 
    121122    mesh = [_get_par_weights(p, values, active(p.name)) 
    122123            for p in parameters.call_parameters] 
  • sasmodels/generate.py

    rb297ba9 ra34b811  
    2727    which are hollow. 
    2828 
    29     *effective_radius(mode, p1, p2, ...)* returns the effective radius of 
     29    *radius_effective(mode, p1, p2, ...)* returns the effective radius of 
    3030    the form with particular dimensions.  Mode determines the type of 
    3131    effective radius returned, with mode=1 for equivalent volume. 
     
    820820                              for p in partable.kernel_parameters)) 
    821821    # Define the function calls 
    822     call_effective_radius = "#define CALL_EFFECTIVE_RADIUS(_mode, _v) 0.0" 
     822    call_radius_effective = "#define CALL_RADIUS_EFFECTIVE(_mode, _v) 0.0" 
    823823    if partable.form_volume_parameters: 
    824824        refs = _call_pars("_v.", partable.form_volume_parameters) 
     
    833833                "do { _form = _shell = form_volume(%s); } " 
    834834                "while (0)") % (",".join(refs)) 
    835         if model_info.effective_radius_type: 
    836             call_effective_radius = ( 
    837                 "#define CALL_EFFECTIVE_RADIUS(_mode, _v) " 
    838                 "effective_radius(_mode, %s)") % (",".join(refs)) 
     835        if model_info.radius_effective_modes: 
     836            call_radius_effective = ( 
     837                "#define CALL_RADIUS_EFFECTIVE(_mode, _v) " 
     838                "radius_effective(_mode, %s)") % (",".join(refs)) 
    839839    else: 
    840840        # Model doesn't have volume.  We could make the kernel run a little 
     
    845845            "do { _form = _shell = 1.0; } while (0)") 
    846846    source.append(call_volume) 
    847     source.append(call_effective_radius) 
     847    source.append(call_radius_effective) 
    848848    model_refs = _call_pars("_v.", partable.iq_parameters) 
    849849 
  • sasmodels/kernel.py

    rb297ba9 ra34b811  
    7878        """ 
    7979        _, F2, _, shell_volume, _ = self.Fq(call_details, values, cutoff, 
    80                                             magnetic, effective_radius_type=0) 
     80                                            magnetic, radius_effective_mode=0) 
    8181        combined_scale = values[0]/shell_volume 
    8282        background = values[1] 
     
    8585 
    8686    def Fq(self, call_details, values, cutoff, magnetic, 
    87            effective_radius_type=0): 
     87           radius_effective_mode=0): 
    8888        # type: (CallDetails, np.ndarray, np.ndarray, float, bool, int) -> np.ndarray 
    8989        r""" 
     
    143143        volume fraction of the particles.  The model can have several 
    144144        different ways to compute effective radius, with the 
    145         *effective_radius_type* parameter used to select amongst them.  The 
     145        *radius_effective_mode* parameter used to select amongst them.  The 
    146146        volume fraction of particles should be determined from the total 
    147147        volume fraction of the form, not just the shell volume fraction. 
     
    153153        """ 
    154154        self._call_kernel(call_details, values, cutoff, magnetic, 
    155                           effective_radius_type) 
     155                          radius_effective_mode) 
    156156        #print("returned",self.q_input.q, self.result) 
    157157        nout = 2 if self.info.have_Fq and self.dim == '1d' else 1 
     
    165165        form_volume = self.result[nout*self.q_input.nq + 1]/total_weight 
    166166        shell_volume = self.result[nout*self.q_input.nq + 2]/total_weight 
    167         effective_radius = self.result[nout*self.q_input.nq + 3]/total_weight 
     167        radius_effective = self.result[nout*self.q_input.nq + 3]/total_weight 
    168168        if shell_volume == 0.: 
    169169            shell_volume = 1. 
     
    171171              if nout == 2 else None) 
    172172        F2 = self.result[0:nout*self.q_input.nq:nout]/total_weight 
    173         return F1, F2, effective_radius, shell_volume, form_volume/shell_volume 
     173        return F1, F2, radius_effective, shell_volume, form_volume/shell_volume 
    174174 
    175175    def release(self): 
     
    181181 
    182182    def _call_kernel(self, call_details, values, cutoff, magnetic, 
    183                      effective_radius_type): 
     183                     radius_effective_mode): 
    184184        # type: (CallDetails, np.ndarray, np.ndarray, float, bool, int) -> np.ndarray 
    185185        """ 
  • sasmodels/kernel_iq.c

    r8973e0d rde032da  
    2727//      parameters in the parameter table. 
    2828//  CALL_VOLUME(form, shell, table) : assign form and shell values 
    29 //  CALL_EFFECTIVE_RADIUS(type, table) : call the R_eff function 
     29//  CALL_RADIUS_EFFECTIVE(mode, table) : call the R_eff function 
    3030//  CALL_IQ(q, table) : call the Iq function for 1D calcs. 
    3131//  CALL_IQ_A(q, table) : call the Iq function with |q| for 2D data. 
     
    304304    pglobal double *result,       // nq+1 return values, again with padding 
    305305    const double cutoff,          // cutoff in the dispersity weight product 
    306     int32_t effective_radius_type // which effective radius to compute 
     306    int32_t radius_effective_mode // which effective radius to compute 
    307307    ) 
    308308{ 
     
    722722      weighted_form += weight * form; 
    723723      weighted_shell += weight * shell; 
    724       if (effective_radius_type != 0) { 
    725         weighted_radius += weight * CALL_EFFECTIVE_RADIUS(effective_radius_type, local_values.table); 
     724      if (radius_effective_mode != 0) { 
     725        weighted_radius += weight * CALL_RADIUS_EFFECTIVE(radius_effective_mode, local_values.table); 
    726726      } 
    727727      BUILD_ROTATION(); 
  • sasmodels/kernelcl.py

    r069743a ra34b811  
    577577 
    578578    def _call_kernel(self, call_details, values, cutoff, magnetic, 
    579                      effective_radius_type): 
     579                     radius_effective_mode): 
    580580        # type: (CallDetails, np.ndarray, float, bool, int) -> np.ndarray 
    581581        env = environment() 
     
    601601            self._result_b,   # Result storage. 
    602602            self._as_dtype(cutoff),  # Probability cutoff. 
    603             np.uint32(effective_radius_type),  # R_eff mode. 
     603            np.uint32(radius_effective_mode),  # R_eff mode. 
    604604        ] 
    605605 
  • sasmodels/kernelcuda.py

    rb297ba9 ra34b811  
    473473 
    474474    def _call_kernel(self, call_details, values, cutoff, magnetic, 
    475                      effective_radius_type): 
     475                     radius_effective_mode): 
    476476        # type: (CallDetails, np.ndarray, float, bool, int) -> np.ndarray 
    477477 
     
    492492            self._result_b,   # Result storage. 
    493493            self._as_dtype(cutoff),  # Probability cutoff. 
    494             np.uint32(effective_radius_type),  # R_eff mode. 
     494            np.uint32(radius_effective_mode),  # R_eff mode. 
    495495        ] 
    496496        grid = partition(self.q_input.nq) 
  • sasmodels/kerneldll.py

    rb297ba9 ra34b811  
    403403 
    404404    def _call_kernel(self, call_details, values, cutoff, magnetic, 
    405                      effective_radius_type): 
     405                     radius_effective_mode): 
    406406        # type: (CallDetails, np.ndarray, float, bool, int) -> np.ndarray 
    407407 
     
    417417            self.result.ctypes.data,   # Result storage. 
    418418            self._as_dtype(cutoff),  # Probability cutoff. 
    419             effective_radius_type,  # R_eff mode. 
     419            radius_effective_mode,  # R_eff mode. 
    420420        ] 
    421421 
  • sasmodels/kernelpy.py

    rb297ba9 ra34b811  
    172172        volume = model_info.form_volume 
    173173        shell = model_info.shell_volume 
    174         radius = model_info.effective_radius 
     174        radius = model_info.radius_effective 
    175175        self._volume = ((lambda: (shell(*volume_args), volume(*volume_args))) if shell and volume 
    176176                        else (lambda: [volume(*volume_args)]*2) if volume 
     
    180180                        else (lambda mode: 1.0)) 
    181181 
    182     def _call_kernel(self, call_details, values, cutoff, magnetic, effective_radius_type): 
     182    def _call_kernel(self, call_details, values, cutoff, magnetic, radius_effective_mode): 
    183183        # type: (CallDetails, np.ndarray, np.ndarray, float, bool) -> np.ndarray 
    184184        if magnetic: 
     
    186186        #print("Calling python kernel") 
    187187        #call_details.show(values) 
    188         radius = ((lambda: 0.0) if effective_radius_type == 0 
    189                   else (lambda: self._radius(effective_radius_type))) 
     188        radius = ((lambda: 0.0) if radius_effective_mode == 0 
     189                  else (lambda: self._radius(radius_effective_mode))) 
    190190        self.result = _loops( 
    191191            self._parameter_vector, self._form, self._volume, radius, 
  • sasmodels/model_test.py

    rb297ba9 r8795b6f  
    240240                    s_name = pars.pop('@S') 
    241241                    ps_test = [pars] + list(test[1:]) 
     242                    #print("PS TEST PARAMS!!!",ps_test) 
    242243                    # build the P@S model 
    243244                    s_info = load_model_info(s_name) 
     
    246247                                           platform=self.platform) 
    247248                    # run the tests 
     249                    #self.info = ps_model.info 
     250                    #print("SELF.INFO PARAMS!!!",[p.id for p in self.info.parameters.call_parameters]) 
     251                    #print("PS MODEL PARAMETERS:",[p.id for p in ps_model.info.parameters.call_parameters]) 
    248252                    results.append(self.run_one(ps_model, ps_test)) 
    249253 
     
    303307            """Run a single test case.""" 
    304308            user_pars, x, y = test[:3] 
    305             pars = expand_pars(self.info.parameters, user_pars) 
    306             invalid = invalid_pars(self.info.parameters, pars) 
     309            #print("PS MODEL PARAMETERS:",[p.id for p in model.info.parameters.call_parameters]) 
     310            pars = expand_pars(model.info.parameters, user_pars) 
     311            invalid = invalid_pars(model.info.parameters, pars) 
    307312            if invalid: 
    308313                raise ValueError("Unknown parameters in test: " + ", ".join(invalid)) 
     
    328333            else: 
    329334                y1 = y 
    330                 y2 = test[3] if not isinstance(test[3], list) else [test[3]] 
    331                 F1, F2, R_eff, volume, volume_ratio = call_Fq(kernel, pars) 
    332                 if F1 is not None:  # F1 is none for models with Iq instead of Fq 
    333                     self._check_vectors(x, y1, F1, 'F') 
    334                 self._check_vectors(x, y2, F2, 'F^2') 
     335                y2 = test[3] if isinstance(test[3], list) else [test[3]] 
     336                F, Fsq, R_eff, volume, volume_ratio = call_Fq(kernel, pars) 
     337                if F is not None:  # F is none for models with Iq instead of Fq 
     338                    self._check_vectors(x, y1, F, 'F') 
     339                self._check_vectors(x, y2, Fsq, 'F^2') 
    335340                self._check_scalar(test[4], R_eff, 'R_eff') 
    336341                self._check_scalar(test[5], volume, 'volume') 
    337342                self._check_scalar(test[6], volume_ratio, 'form:shell ratio') 
    338                 return F2 
     343                return Fsq 
    339344 
    340345        def _check_scalar(self, target, actual, name): 
    341             if target is None: 
    342                 # smoke test --- make sure it runs and produces a value 
    343                 self.assertTrue(not np.isnan(actual), 
    344                                 'invalid %s: %s' % (name, actual)) 
    345             elif np.isnan(target): 
    346                 # make sure nans match 
    347                 self.assertTrue(np.isnan(actual), 
    348                                 '%s: expected:%s; actual:%s' 
    349                                 % (name, target, actual)) 
    350             else: 
    351                 # is_near does not work for infinite values, so also test 
    352                 # for exact values. 
    353                 self.assertTrue(target == actual or is_near(target, actual, 5), 
    354                                 '%s: expected:%s; actual:%s' 
    355                                 % (name, target, actual)) 
     346            self.assertTrue(is_near(target, actual, 5), 
     347                            '%s: expected:%s; actual:%s' 
     348                            % (name, target, actual)) 
    356349 
    357350        def _check_vectors(self, x, target, actual, name='I'): 
     
    363356                             '%s(...) returned wrong length'%name) 
    364357            for xi, yi, actual_yi in zip(x, target, actual): 
    365                 if yi is None: 
    366                     # smoke test --- make sure it runs and produces a value 
    367                     self.assertTrue(not np.isnan(actual_yi), 
    368                                     'invalid %s(%s): %s' % (name, xi, actual_yi)) 
    369                 elif np.isnan(yi): 
    370                     # make sure nans match 
    371                     self.assertTrue(np.isnan(actual_yi), 
    372                                     '%s(%s): expected:%s; actual:%s' 
    373                                     % (name, xi, yi, actual_yi)) 
    374                 else: 
    375                     # is_near does not work for infinite values, so also test 
    376                     # for exact values. 
    377                     self.assertTrue(yi == actual_yi or is_near(yi, actual_yi, 5), 
    378                                     '%s(%s); expected:%s; actual:%s' 
    379                                     % (name, xi, yi, actual_yi)) 
     358                self.assertTrue(is_near(yi, actual_yi, 5), 
     359                                '%s(%s): expected:%s; actual:%s' 
     360                                % (name, xi, target, actual)) 
    380361 
    381362    return ModelTestCase 
     
    389370    invalid = [] 
    390371    for par in sorted(pars.keys()): 
    391         # special handling of R_eff mode, which is not a usual parameter 
     372        # Ignore the R_eff mode parameter when checking for valid parameters. 
     373        # It is an allowed parameter for a model even though it does not exist 
     374        # in the parameter table.  The call_Fq() function pops it from the 
     375        # parameter list and sends it directly to kernel.Fq(). 
    392376        if par == product.RADIUS_MODE_ID: 
    393377            continue 
     
    405389    """ 
    406390    Returns true if *actual* is within *digits* significant digits of *target*. 
    407     """ 
    408     import math 
    409     shift = 10**math.ceil(math.log10(abs(target))) 
    410     return abs(target-actual)/shift < 1.5*10**-digits 
     391 
     392    *taget* zero and inf should match *actual* zero and inf.  If you want to 
     393    accept eps for zero, choose a value such as 1e-10, which must match up to 
     394    +/- 1e-15 when *digits* is the default value of 5. 
     395 
     396    If *target* is None, then just make sure that *actual* is not NaN. 
     397 
     398    If *target* is NaN, make sure *actual* is NaN. 
     399    """ 
     400    if target is None: 
     401        # target is None => actual cannot be NaN 
     402        return not np.isnan(actual) 
     403    elif target == 0.: 
     404        # target is 0. => actual must be 0. 
     405        # Note: if small values are allowed, then use maybe test zero against eps instead? 
     406        return actual == 0. 
     407    elif np.isfinite(target): 
     408        shift = np.ceil(np.log10(abs(target))) 
     409        return abs(target-actual) < 1.5*10**(shift-digits) 
     410    elif target == actual: 
     411        # target is inf => actual must be inf of same sign 
     412        return True 
     413    else: 
     414        # target is NaN => actual must be NaN 
     415        return np.isnan(target) == np.isnan(actual) 
    411416 
    412417# CRUFT: old interface; should be deprecated and removed 
  • sasmodels/modelinfo.py

    rb297ba9 ra34b811  
    265265    other sld parameters. The volume parameters are used for calls 
    266266    to form_volume within the kernel (required for volume normalization), 
    267     to shell_volume (for hollow shapes), and to effective_radius (for 
     267    to shell_volume (for hollow shapes), and to radius_effective (for 
    268268    structure factor interactions) respectively. 
    269269 
     
    841841    info.structure_factor = getattr(kernel_module, 'structure_factor', False) 
    842842    # TODO: find Fq by inspection 
    843     info.effective_radius_type = getattr(kernel_module, 'effective_radius_type', None) 
     843    info.radius_effective_modes = getattr(kernel_module, 'radius_effective_modes', None) 
    844844    info.have_Fq = getattr(kernel_module, 'have_Fq', False) 
    845845    info.profile_axes = getattr(kernel_module, 'profile_axes', ['x', 'y']) 
     
    848848    info.source = getattr(kernel_module, 'source', []) 
    849849    info.c_code = getattr(kernel_module, 'c_code', None) 
    850     info.effective_radius = getattr(kernel_module, 'effective_radius', None) 
     850    info.radius_effective = getattr(kernel_module, 'radius_effective', None) 
    851851    # TODO: check the structure of the tests 
    852852    info.tests = getattr(kernel_module, 'tests', []) 
     
    961961    #: List of options for computing the effective radius of the shape, 
    962962    #: or None if the model is not usable as a form factor model. 
    963     effective_radius_type = None   # type: List[str] 
     963    radius_effective_modes = None   # type: List[str] 
    964964    #: List of C source files used to define the model.  The source files 
    965965    #: should define the *Iq* function, and possibly *Iqac* or *Iqabc* if the 
     
    989989    #: monodisperse approximation for non-dilute solutions, P@S.  The first 
    990990    #: argument is the integer effective radius mode, with default 0. 
    991     effective_radius = None  # type: Union[None, Callable[[int, np.ndarray], float]] 
     991    radius_effective = None  # type: Union[None, Callable[[int, np.ndarray], float]] 
    992992    #: Returns *I(q, a, b, ...)* for parameters *a*, *b*, etc. defined 
    993993    #: by the parameter table.  *Iq* can be defined as a python function, or 
  • sasmodels/models/_spherepy.py

    rc1e44e5 rd57b06c  
    7676    return 1.333333333333333 * pi * radius ** 3 
    7777 
    78 def effective_radius(mode, radius): 
     78def radius_effective(mode, radius): 
    7979    """Calculate R_eff for sphere""" 
    80     return radius 
     80    return radius if mode else 0. 
    8181 
    8282def Iq(q, sld, sld_solvent, radius): 
  • sasmodels/models/barbell.c

    r99658f6 ra34b811  
    8585 
    8686static double 
    87 effective_radius(int mode, double radius_bell, double radius, double length) 
     87radius_effective(int mode, double radius_bell, double radius, double length) 
    8888{ 
    8989    switch (mode) { 
  • sasmodels/models/barbell.py

    rc1e44e5 rd57b06c  
    118118source = ["lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c", "barbell.c"] 
    119119have_Fq = True 
    120 effective_radius_type = [ 
     120radius_effective_modes = [ 
    121121    "equivalent cylinder excluded volume", "equivalent volume sphere", 
    122122    "radius", "half length", "half total length", 
  • sasmodels/models/capped_cylinder.c

    r99658f6 ra34b811  
    107107 
    108108static double 
    109 effective_radius(int mode, double radius, double radius_cap, double length) 
     109radius_effective(int mode, double radius, double radius_cap, double length) 
    110110{ 
    111111    switch (mode) { 
  • sasmodels/models/capped_cylinder.py

    rc1e44e5 rd57b06c  
    138138source = ["lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c", "capped_cylinder.c"] 
    139139have_Fq = True 
    140 effective_radius_type = [ 
     140radius_effective_modes = [ 
    141141    "equivalent cylinder excluded volume", "equivalent volume sphere", 
    142142    "radius", "half length", "half total length", 
  • sasmodels/models/core_multi_shell.c

    rd42dd4a ra34b811  
    2626 
    2727static double 
    28 effective_radius(int mode, double core_radius, double fp_n, double thickness[]) 
     28radius_effective(int mode, double core_radius, double fp_n, double thickness[]) 
    2929{ 
    3030  switch (mode) { 
  • sasmodels/models/core_multi_shell.py

    rc1e44e5 rd57b06c  
    100100source = ["lib/sas_3j1x_x.c", "core_multi_shell.c"] 
    101101have_Fq = True 
    102 effective_radius_type = ["outer radius", "core radius"] 
     102radius_effective_modes = ["outer radius", "core radius"] 
    103103 
    104104def random(): 
  • sasmodels/models/core_shell_bicelle.c

    r99658f6 ra34b811  
    6060 
    6161static double 
    62 effective_radius(int mode, double radius, double thick_rim, double thick_face, double length) 
     62radius_effective(int mode, double radius, double thick_rim, double thick_face, double length) 
    6363{ 
    6464    switch (mode) { 
  • sasmodels/models/core_shell_bicelle.py

    rc1e44e5 rd57b06c  
    157157          "core_shell_bicelle.c"] 
    158158have_Fq = True 
    159 effective_radius_type = [ 
     159radius_effective_modes = [ 
    160160    "excluded volume", "equivalent volume sphere", "outer rim radius", 
    161161    "half outer thickness", "half diagonal", 
  • sasmodels/models/core_shell_bicelle_elliptical.c

    r99658f6 ra34b811  
    3535 
    3636static double 
    37 effective_radius(int mode, double r_minor, double x_core, double thick_rim, double thick_face, double length) 
     37radius_effective(int mode, double r_minor, double x_core, double thick_rim, double thick_face, double length) 
    3838{ 
    3939    switch (mode) { 
  • sasmodels/models/core_shell_bicelle_elliptical.py

    rc1e44e5 rd57b06c  
    147147          "core_shell_bicelle_elliptical.c"] 
    148148have_Fq = True 
    149 effective_radius_type = [ 
     149radius_effective_modes = [ 
    150150    "equivalent cylinder excluded volume", "equivalent volume sphere", 
    151151    "outer rim average radius", "outer rim min radius", 
  • sasmodels/models/core_shell_bicelle_elliptical_belt_rough.c

    r99658f6 ra34b811  
    3636 
    3737static double 
    38 effective_radius(int mode, double r_minor, double x_core, double thick_rim, double thick_face, double length) 
     38radius_effective(int mode, double r_minor, double x_core, double thick_rim, double thick_face, double length) 
    3939{ 
    4040    switch (mode) { 
  • sasmodels/models/core_shell_bicelle_elliptical_belt_rough.py

    rc1e44e5 rd57b06c  
    160160          "core_shell_bicelle_elliptical_belt_rough.c"] 
    161161have_Fq = True 
    162 effective_radius_type = [ 
     162radius_effective_modes = [ 
    163163    "equivalent cylinder excluded volume", "equivalent volume sphere", 
    164164    "outer rim average radius", "outer rim min radius", 
  • sasmodels/models/core_shell_cylinder.c

    r99658f6 ra34b811  
    3737 
    3838static double 
    39 effective_radius(int mode, double radius, double thickness, double length) 
     39radius_effective(int mode, double radius, double thickness, double length) 
    4040{ 
    4141    switch (mode) { 
  • sasmodels/models/core_shell_cylinder.py

    rc1e44e5 rd57b06c  
    133133source = ["lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c", "core_shell_cylinder.c"] 
    134134have_Fq = True 
    135 effective_radius_type = [ 
     135radius_effective_modes = [ 
    136136    "excluded volume", "equivalent volume sphere", "outer radius", "half outer length", 
    137137    "half min outer dimension", "half max outer dimension", "half outer diagonal", 
  • sasmodels/models/core_shell_ellipsoid.c

    r99658f6 ra34b811  
    6868 
    6969static double 
    70 effective_radius(int mode, double radius_equat_core, double x_core, double thick_shell, double x_polar_shell) 
     70radius_effective(int mode, double radius_equat_core, double x_core, double thick_shell, double x_polar_shell) 
    7171{ 
    7272    const double radius_equat_tot = radius_equat_core + thick_shell; 
  • sasmodels/models/core_shell_ellipsoid.py

    rc1e44e5 rd57b06c  
    4747 
    4848.. In following equation SK changed radius\_equat\_core to R_e 
    49  
    5049.. math:: 
    5150    :nowrap: 
     
    153152source = ["lib/sas_3j1x_x.c", "lib/gauss76.c", "core_shell_ellipsoid.c"] 
    154153have_Fq = True 
    155 effective_radius_type = [ 
     154radius_effective_modes = [ 
    156155    "average outer curvature", "equivalent volume sphere", 
    157156    "min outer radius", "max outer radius", 
  • sasmodels/models/core_shell_parallelepiped.c

    r99658f6 ra34b811  
    7575 
    7676static double 
    77 effective_radius(int mode, double length_a, double length_b, double length_c, 
     77radius_effective(int mode, double length_a, double length_b, double length_c, 
    7878                 double thick_rim_a, double thick_rim_b, double thick_rim_c) 
    7979{ 
  • sasmodels/models/core_shell_parallelepiped.py

    rc1e44e5 rd57b06c  
    228228source = ["lib/gauss76.c", "core_shell_parallelepiped.c"] 
    229229have_Fq = True 
    230 effective_radius_type = [ 
     230radius_effective_modes = [ 
    231231    "equivalent cylinder excluded volume", 
    232232    "equivalent volume sphere", 
  • sasmodels/models/core_shell_sphere.c

    rd42dd4a ra34b811  
    66 
    77static double 
    8 effective_radius(int mode, double radius, double thickness) 
     8radius_effective(int mode, double radius, double thickness) 
    99{ 
    1010    switch (mode) { 
  • sasmodels/models/core_shell_sphere.py

    rc1e44e5 rd57b06c  
    8484source = ["lib/sas_3j1x_x.c", "lib/core_shell.c", "core_shell_sphere.c"] 
    8585have_Fq = True 
    86 effective_radius_type = ["outer radius", "core radius"] 
     86radius_effective_modes = ["outer radius", "core radius"] 
    8787 
    8888demo = dict(scale=1, background=0, radius=60, thickness=10, 
  • sasmodels/models/cylinder.c

    r99658f6 ra34b811  
    3232 
    3333static double 
    34 effective_radius(int mode, double radius, double length) 
     34radius_effective(int mode, double radius, double length) 
    3535{ 
    3636    switch (mode) { 
  • sasmodels/models/cylinder.py

    rc1e44e5 rd57b06c  
    147147source = ["lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c", "cylinder.c"] 
    148148have_Fq = True 
    149 effective_radius_type = [ 
     149radius_effective_modes = [ 
    150150    "excluded volume", "equivalent volume sphere", "radius", 
    151151    "half length", "half min dimension", "half max dimension", "half diagonal", 
     
    176176            phi_pd=10, phi_pd_n=5) 
    177177 
    178 # pylint: disable=bad-whitespace, line-too-long 
     178# Test 1-D and 2-D models 
    179179qx, qy = 0.2 * np.cos(2.5), 0.2 * np.sin(2.5) 
    180 # After redefinition of angles, find new tests values.  Was 10 10 in old coords 
     180theta, phi = 80.1534480601659, 10.1510817110481  # (10, 10) in sasview 3.x 
    181181tests = [ 
    182182    [{}, 0.2, 0.042761386790780453], 
    183183    [{}, [0.2], [0.042761386790780453]], 
    184     #  new coords 
    185     [{'theta':80.1534480601659, 'phi':10.1510817110481}, (qx, qy), 0.03514647218513852], 
    186     [{'theta':80.1534480601659, 'phi':10.1510817110481}, [(qx, qy)], [0.03514647218513852]], 
    187     # old coords 
    188     #[{'theta':10.0, 'phi':10.0}, (qx, qy), 0.03514647218513852], 
    189     #[{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.03514647218513852]], 
     184    [{'theta': theta, 'phi': phi}, (qx, qy), 0.03514647218513852], 
     185    [{'theta': theta, 'phi': phi}, [(qx, qy)], [0.03514647218513852]], 
    190186] 
    191 del qx, qy  # not necessary to delete, but cleaner 
    192  
    193 # Default radius and length 
    194 def calc_volume(radius, length): 
    195     """Return form volume for cylinder.""" 
    196     return pi*radius**2*length 
    197 def calc_r_effs(radius, length): 
    198     """Return effective radii for modes 0-7 of cylinder.""" 
    199     return [ 
     187del qx, qy, theta, phi  # not necessary to delete, but cleaner 
     188 
     189def _extend_with_reff_tests(radius, length): 
     190    """Test R_eff and form volume calculations""" 
     191    # V and Vr are the same for each R_eff mode 
     192    V = pi*radius**2*length  # shell volume = form volume for solid objects 
     193    Vr = 1.0  # form:shell volume ratio 
     194    # Use test value for I(0.2) from above to check Fsq value.  Need to 
     195    # remove scale and background before testing. 
     196    q = 0.2 
     197    scale, background = V, 0.001 
     198    Fsq = (0.042761386790780453 - background)*scale 
     199    F = None  # Need target value for <F> 
     200    # Various values for R_eff, depending on mode 
     201    r_effs = [ 
    200202        0., 
    201203        0.5*(0.75*radius*(2.0*radius*length 
     
    208210        np.sqrt(4*radius**2 + length**2)/2., 
    209211    ] 
    210 r_effs = calc_r_effs(parameters[2][2], parameters[3][2]) 
    211 cyl_vol = calc_volume(parameters[2][2], parameters[3][2]) 
    212 tests.extend([ 
    213     ({'radius_effective_mode': 0}, 0.1, None, None, r_effs[0], cyl_vol, 1.0), 
    214     ({'radius_effective_mode': 1}, 0.1, None, None, r_effs[1], None, None), 
    215     ({'radius_effective_mode': 2}, 0.1, None, None, r_effs[2], None, None), 
    216     ({'radius_effective_mode': 3}, 0.1, None, None, r_effs[3], None, None), 
    217     ({'radius_effective_mode': 4}, 0.1, None, None, r_effs[4], None, None), 
    218     ({'radius_effective_mode': 5}, 0.1, None, None, r_effs[5], None, None), 
    219     ({'radius_effective_mode': 6}, 0.1, None, None, r_effs[6], None, None), 
    220     ({'radius_effective_mode': 7}, 0.1, None, None, r_effs[7], None, None), 
    221 ]) 
    222 del r_effs, cyl_vol 
    223 # pylint: enable=bad-whitespace, line-too-long 
     212    tests.extend([ 
     213        ({'radius_effective_mode': 0}, q, F, Fsq, r_effs[0], V, Vr), 
     214        ({'radius_effective_mode': 1}, q, F, Fsq, r_effs[1], V, Vr), 
     215        ({'radius_effective_mode': 2}, q, F, Fsq, r_effs[2], V, Vr), 
     216        ({'radius_effective_mode': 3}, q, F, Fsq, r_effs[3], V, Vr), 
     217        ({'radius_effective_mode': 4}, q, F, Fsq, r_effs[4], V, Vr), 
     218        ({'radius_effective_mode': 5}, q, F, Fsq, r_effs[5], V, Vr), 
     219        ({'radius_effective_mode': 6}, q, F, Fsq, r_effs[6], V, Vr), 
     220        ({'radius_effective_mode': 7}, q, F, Fsq, r_effs[7], V, Vr), 
     221    ]) 
     222 
     223# Test Reff and volume with default model parameters 
     224_extend_with_reff_tests(parameters[2][2], parameters[3][2]) 
     225del _extend_with_reff_tests 
    224226 
    225227# ADDED by:  RKH  ON: 18Mar2016 renamed sld's etc 
  • sasmodels/models/ellipsoid.c

    r99658f6 ra34b811  
    3232 
    3333static double 
    34 effective_radius(int mode, double radius_polar, double radius_equatorial) 
     34radius_effective(int mode, double radius_polar, double radius_equatorial) 
    3535{ 
    3636    switch (mode) { 
  • sasmodels/models/ellipsoid.py

    rc1e44e5 rd57b06c  
    159159source = ["lib/sas_3j1x_x.c", "lib/gauss76.c", "ellipsoid.c"] 
    160160have_Fq = True 
    161 effective_radius_type = [ 
     161radius_effective_modes = [ 
    162162    "average curvature", "equivalent volume sphere", "min radius", "max radius", 
    163163    ] 
  • sasmodels/models/elliptical_cylinder.c

    r99658f6 ra34b811  
    4141 
    4242static double 
    43 effective_radius(int mode, double radius_minor, double r_ratio, double length) 
     43radius_effective(int mode, double radius_minor, double r_ratio, double length) 
    4444{ 
    4545    switch (mode) { 
  • sasmodels/models/elliptical_cylinder.py

    rc1e44e5 rd57b06c  
    123123source = ["lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c", "elliptical_cylinder.c"] 
    124124have_Fq = True 
    125 effective_radius_type = [ 
     125radius_effective_modes = [ 
    126126    "equivalent cylinder excluded volume", 
    127127    "equivalent volume sphere", "average radius", "min radius", "max radius", 
  • sasmodels/models/flexible_cylinder.py

    rc1e44e5 rd57b06c  
    4141    pseudocontinuous limit. 
    4242    See equations (13,26-27) in the original reference for the details. 
     43 
     44.. note:: 
     45 
     46    There are several typos in the original reference that have been corrected 
     47    by WRC [2]. Details of the corrections are in the reference below. Most notably 
     48 
     49    - Equation (13): the term $(1 - w(QR))$ should swap position with $w(QR)$ 
     50 
     51    - Equations (23) and (24) are incorrect; WRC has entered these into 
     52      Mathematica and solved analytically. The results were then converted to 
     53      code. 
     54 
     55    - Equation (27) should be $q0 = max(a3/(Rg^2)^{1/2},3)$ instead of 
     56      $max(a3*b(Rg^2)^{1/2},3)$ 
     57 
     58    - The scattering function is negative for a range of parameter values and 
     59      q-values that are experimentally accessible. A correction function has been 
     60      added to give the proper behavior. 
     61 
     62 
     63**This is a model with complex behaviour depending on the ratio of** $L/b$ **and the 
     64reader is strongly encouraged to read reference [1] before use.** 
    4365 
    4466.. note:: 
  • sasmodels/models/fuzzy_sphere.c

    rd42dd4a ra34b811  
    55 
    66static double 
    7 effective_radius(int mode, double radius, double fuzziness) 
     7radius_effective(int mode, double radius, double fuzziness) 
    88{ 
    99    switch (mode) { 
  • sasmodels/models/fuzzy_sphere.py

    rc1e44e5 rd57b06c  
    9090source = ["lib/sas_3j1x_x.c", "fuzzy_sphere.c"] 
    9191have_Fq = True 
    92 effective_radius_type = ["radius", "radius + fuzziness"] 
     92radius_effective_modes = ["radius", "radius + fuzziness"] 
    9393 
    9494def random(): 
  • sasmodels/models/hollow_cylinder.c

    r99658f6 ra34b811  
    3434 
    3535static double 
    36 effective_radius(int mode, double radius, double thickness, double length) 
     36radius_effective(int mode, double radius, double thickness, double length) 
    3737{ 
    3838    switch (mode) { 
  • sasmodels/models/hollow_cylinder.py

    rc1e44e5 rd57b06c  
    102102source = ["lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c", "hollow_cylinder.c"] 
    103103have_Fq = True 
    104 effective_radius_type = [ 
     104radius_effective_modes = [ 
    105105    "excluded volume", "equivalent outer volume sphere", 
    106106    "outer radius", "half length", 
  • sasmodels/models/hollow_rectangular_prism.c

    r99658f6 ra34b811  
    3030 
    3131static double 
    32 effective_radius(int mode, double length_a, double b2a_ratio, double c2a_ratio, double thickness) 
     32radius_effective(int mode, double length_a, double b2a_ratio, double c2a_ratio, double thickness) 
    3333// NOTE length_a is external dimension! 
    3434{ 
  • sasmodels/models/hollow_rectangular_prism.py

    rc1e44e5 rd57b06c  
    149149source = ["lib/gauss76.c", "hollow_rectangular_prism.c"] 
    150150have_Fq = True 
    151 effective_radius_type = [ 
     151radius_effective_modes = [ 
    152152    "equivalent cylinder excluded volume", "equivalent outer volume sphere", 
    153153    "half length_a", "half length_b", "half length_c", 
  • sasmodels/models/hollow_rectangular_prism_thin_walls.c

    r99658f6 ra34b811  
    2626 
    2727static double 
    28 effective_radius(int mode, double length_a, double b2a_ratio, double c2a_ratio) 
     28radius_effective(int mode, double length_a, double b2a_ratio, double c2a_ratio) 
    2929{ 
    3030    switch (mode) { 
  • sasmodels/models/hollow_rectangular_prism_thin_walls.py

    rc1e44e5 rd57b06c  
    109109source = ["lib/gauss76.c", "hollow_rectangular_prism_thin_walls.c"] 
    110110have_Fq = True 
    111 effective_radius_type = [ 
     111radius_effective_modes = [ 
    112112    "equivalent cylinder excluded volume", "equivalent outer volume sphere", 
    113113    "half length_a", "half length_b", "half length_c", 
  • sasmodels/models/mono_gauss_coil.c

    r153f8f6 ra34b811  
    66 
    77static double 
    8 effective_radius(int mode, double rg) 
     8radius_effective(int mode, double rg) 
    99{ 
    1010    switch (mode) { 
  • sasmodels/models/mono_gauss_coil.py

    rc1e44e5 rd57b06c  
    7979source = ["mono_gauss_coil.c"] 
    8080have_Fq = False 
    81 effective_radius_type = ["R_g", "2R_g", "3R_g", "sqrt(5/3)*R_g"] 
     81radius_effective_modes = ["R_g", "2R_g", "3R_g", "sqrt(5/3)*R_g"] 
    8282 
    8383 
  • sasmodels/models/multilayer_vesicle.c

    ree60aa7 ra34b811  
    4848 
    4949static double 
    50 effective_radius(int mode, double radius, double thick_shell, double thick_solvent, double fp_n_shells) 
     50radius_effective(int mode, double radius, double thick_shell, double thick_solvent, double fp_n_shells) 
    5151{ 
    5252    // case 1: outer radius 
  • sasmodels/models/multilayer_vesicle.py

    rc1e44e5 rd57b06c  
    146146source = ["lib/sas_3j1x_x.c", "multilayer_vesicle.c"] 
    147147have_Fq = True 
    148 effective_radius_type = ["outer radius"] 
     148radius_effective_modes = ["outer radius"] 
    149149 
    150150def random(): 
  • sasmodels/models/onion.c

    ree60aa7 ra34b811  
    4747 
    4848static double 
    49 effective_radius(int mode, double radius_core, double n_shells, double thickness[]) 
     49radius_effective(int mode, double radius_core, double n_shells, double thickness[]) 
    5050{ 
    5151  // case 1: outer radius 
  • sasmodels/models/onion.py

    rc1e44e5 rd57b06c  
    339339single = False 
    340340have_Fq = True 
    341 effective_radius_type = ["outer radius"] 
     341radius_effective_modes = ["outer radius"] 
    342342 
    343343profile_axes = ['Radius (A)', 'SLD (1e-6/A^2)'] 
  • sasmodels/models/parallelepiped.c

    r99658f6 ra34b811  
    3737 
    3838static double 
    39 effective_radius(int mode, double length_a, double length_b, double length_c) 
     39radius_effective(int mode, double length_a, double length_b, double length_c) 
    4040{ 
    4141    switch (mode) { 
  • sasmodels/models/parallelepiped.py

    rc1e44e5 rd57b06c  
    232232source = ["lib/gauss76.c", "parallelepiped.c"] 
    233233have_Fq = True 
    234 effective_radius_type = [ 
     234radius_effective_modes = [ 
    235235    "equivalent cylinder excluded volume", "equivalent volume sphere", 
    236236    "half length_a", "half length_b", "half length_c", 
  • sasmodels/models/pearl_necklace.c

    r9b5fd42 ra34b811  
    8686 
    8787static double 
    88 effective_radius(int mode, double radius, double edge_sep, double thick_string, double fp_num_pearls) 
     88radius_effective(int mode, double radius, double edge_sep, double thick_string, double fp_num_pearls) 
    8989{ 
    9090    switch (mode) { 
  • sasmodels/models/pearl_necklace.py

    rc1e44e5 rd57b06c  
    103103source = ["lib/sas_Si.c", "lib/sas_3j1x_x.c", "pearl_necklace.c"] 
    104104single = False  # use double precision unless told otherwise 
    105 effective_radius_type = ["equivalent volume sphere"] 
     105radius_effective_modes = ["equivalent volume sphere"] 
    106106 
    107107def random(): 
  • sasmodels/models/pringle.c

    r99658f6 ra34b811  
    111111 
    112112static double 
    113 effective_radius(int mode, double radius, double thickness, double alpha, double beta) 
     113radius_effective(int mode, double radius, double thickness, double alpha, double beta) 
    114114{ 
    115115    switch (mode) { 
  • sasmodels/models/pringle.py

    rc1e44e5 rd57b06c  
    7777source = ["lib/polevl.c", "lib/sas_J0.c", "lib/sas_J1.c", 
    7878          "lib/sas_JN.c", "lib/gauss76.c", "pringle.c"] 
    79 effective_radius_type = [ 
     79radius_effective_modes = [ 
    8080    "equivalent cylinder excluded volume", 
    8181    "equivalent volume sphere", 
  • sasmodels/models/raspberry.c

    rd42dd4a ra34b811  
    1515 
    1616static double 
    17 effective_radius(int mode, double radius_lg, double radius_sm, double penetration) 
     17radius_effective(int mode, double radius_lg, double radius_sm, double penetration) 
    1818{ 
    1919    switch (mode) { 
  • sasmodels/models/raspberry.py

    rc1e44e5 rd57b06c  
    153153 
    154154source = ["lib/sas_3j1x_x.c", "raspberry.c"] 
    155 effective_radius_type = ["radius_large", "radius_outer"] 
     155radius_effective_modes = ["radius_large", "radius_outer"] 
    156156 
    157157def random(): 
  • sasmodels/models/rectangular_prism.c

    r99658f6 ra34b811  
    1414 
    1515static double 
    16 effective_radius(int mode, double length_a, double b2a_ratio, double c2a_ratio) 
     16radius_effective(int mode, double length_a, double b2a_ratio, double c2a_ratio) 
    1717{ 
    1818    switch (mode) { 
  • sasmodels/models/rectangular_prism.py

    rc1e44e5 rd57b06c  
    143143source = ["lib/gauss76.c", "rectangular_prism.c"] 
    144144have_Fq = True 
    145 effective_radius_type = [ 
     145radius_effective_modes = [ 
    146146    "equivalent cylinder excluded volume", "equivalent volume sphere", 
    147147    "half length_a", "half length_b", "half length_c", 
  • sasmodels/models/sphere.c

    ree60aa7 ra34b811  
    55 
    66static double 
    7 effective_radius(int mode, double radius) 
     7radius_effective(int mode, double radius) 
    88{ 
    99    // case 1: radius 
  • sasmodels/models/sphere.py

    rc1e44e5 rd57b06c  
    3737---------- 
    3838 
    39 .. [#] A Guinier and G. Fournet, *Small-Angle Scattering of X-Rays*, John Wiley and Sons, New York, (1955) 
     39.. [#] A Guinier and G. Fournet, *Small-Angle Scattering of X-Rays*, 
     40   John Wiley and Sons, New York, (1955) 
    4041 
    4142Authorship and Verification 
     
    7374source = ["lib/sas_3j1x_x.c", "sphere.c"] 
    7475have_Fq = True 
    75 effective_radius_type = ["radius"] 
     76radius_effective_modes = ["radius"] 
    7677 
    7778def random(): 
     
    8283    ) 
    8384    return pars 
    84  
     85#2345678901234567890123456789012345678901234567890123456789012345678901234567890 
    8586tests = [ 
    86     [{}, 0.2, 0.726362], 
     87     [{}, 0.2, 0.726362], # each test starts with default parameter values 
     88     #            inside { }, unless modified. Then Q and expected value of I(Q) 
     89     # putting None for an expected result will pass the test if there are no 
     90     # errors from the routine, but without any check on the value of the result 
    8791    [{"scale": 1., "background": 0., "sld": 6., "sld_solvent": 1., 
    88       "radius": 120., "radius_pd": 0.2, "radius_pd_n":45}, 
    89      0.2, 0.228843], 
     92       "radius": 120.}, [0.01,0.1,0.2], 
     93     [1.34836265e+04, 6.20114062e+00, 1.04733914e-01]], 
     94     [{"scale": 1., "background": 0., "sld": 6., "sld_solvent": 1., 
     95     #  careful tests here R=120 Pd=.2, then with S(Q) at default Reff=50 
     96     #  (but this gets changed to 120) phi=0,2 
     97       "radius": 120., "radius_pd": 0.2, "radius_pd_n":45}, 
     98      [0.01,0.1,0.2], [1.74395295e+04, 3.68016987e+00, 2.28843099e-01]], 
     99     # a list of Q values and list of expected results is also possible 
     100    [{"scale": 1., "background": 0., "sld": 6., "sld_solvent": 1., 
     101     "radius": 120., "radius_pd": 0.2, "radius_pd_n":45}, 
     102      0.01, 335839.88055473, 1.41045057e+11, 120.0, 8087664.122641933, 1.0], 
     103     # the longer list here checks  F1, F2, R_eff, volume, volume_ratio 
    90104    [{"radius": 120., "radius_pd": 0.2, "radius_pd_n":45}, 
    91      0.1, None, None, 120., None, 1.0], 
    92     [{"@S": "hardsphere"}, 0.1, None], 
     105      0.1, 482.93824329, 29763977.79867414, 120.0, 8087664.122641933, 1.0], 
     106    [{"radius": 120., "radius_pd": 0.2, "radius_pd_n":45}, 
     107      0.2, 1.23330406, 1850806.1197361, 120.0, 8087664.122641933, 1.0], 
     108   #  But note P(Q) = F2/volume 
     109   #  F and F^2 are "unscaled", with for  n <F F*>S(q) or for beta approx 
     110   #          I(q) = n [<F F*> + <F><F*> (S(q) - 1)] 
     111   #  for n the number density and <.> the orientation average, and 
     112   #  F = integral rho(r) exp(i q . r) dr. 
     113   #  The number density is volume fraction divided by particle volume. 
     114   #  Effectively, this leaves F = V drho form, where form is the usual 
     115   #  3 j1(qr)/(qr) or whatever depending on the shape. 
     116   # @S RESULTS using F1 and F2 from the longer test strng above: 
     117   # 
     118   # I(Q) = (F2 + F1^2*(S(Q) -1))*volfraction*scale/Volume  + background 
     119   # 
     120   # with by default scale=1.0, background=0.001 
     121   # NOTE currently S(Q) volfraction is also included in scaling 
     122   #  structure_factor_mode 0 = normal decoupling approx, 
     123   #                        1 = beta(Q) approx 
     124   # radius_effective_mode  0 is for free choice, 
     125   #                        1 is use radius from F2(Q) 
     126   #    (sphere only has two choices, other models may have more) 
     127    [{"@S": "hardsphere", 
     128     "radius": 120., "radius_pd": 0.2, "radius_pd_n":45,"volfraction":0.2, 
     129     #"radius_effective":50.0,    # hard sphere structure factor 
     130     "structure_factor_mode": 1,  # mode 0 = normal decoupling approx, 
     131     #                                   1 = beta(Q) approx 
     132     "radius_effective_mode": 0   # this used default hardsphere Reff=50 
     133     }, [0.01,0.1,0.2], [1.32473756e+03, 7.36633631e-01, 4.67686201e-02]  ], 
     134    [{"@S": "hardsphere", 
     135     "radius": 120., "radius_pd": 0.2, "radius_pd_n":45, 
     136     "volfraction":0.2, 
     137     "radius_effective":45.0,     # explicit Reff over rides either 50 or 120 
     138     "structure_factor_mode": 1,  # beta approx 
     139     "radius_effective_mode": 0   # 
     140     }, 0.01, 1316.2990966463444 ], 
     141    [{"@S": "hardsphere", 
     142     "radius": 120., "radius_pd": 0.2, "radius_pd_n":45, 
     143     "volfraction":0.2, 
     144     "radius_effective":120.0,    # over ride Reff 
     145     "structure_factor_mode": 1,  # beta approx 
     146     "radius_effective_mode": 0   # (mode=1 here also uses 120) 
     147     }, [0.01,0.1,0.2], [1.57928589e+03, 7.37067923e-01, 4.67686197e-02  ]], 
     148    [{"@S": "hardsphere", 
     149     "radius": 120., "radius_pd": 0.2, "radius_pd_n":45, 
     150     "volfraction":0.2, 
     151     #"radius_effective":120.0,   # hard sphere structure factor 
     152     "structure_factor_mode": 0,  # normal decoupling approximation 
     153     "radius_effective_mode": 1   # this uses 120 from the form factor 
     154     }, [0.01,0.1,0.2], [1.10112335e+03, 7.41366536e-01, 4.66630207e-02]], 
     155    [{"@S": "hardsphere", 
     156     "radius": 120., "radius_pd": 0.2, "radius_pd_n":45, 
     157     "volfraction":0.2, 
     158     #"radius_effective":50.0,    # hard sphere structure factor 
     159     "structure_factor_mode": 0,  # normal decoupling approximation 
     160     "radius_effective_mode": 0   # this used 50 the default for hardsphere 
     161     }, [0.01,0.1,0.2], [7.82803598e+02, 6.85943611e-01, 4.71586457e-02 ]] 
    93162] 
     163# 
  • sasmodels/models/spherical_sld.c

    ree60aa7 ra34b811  
    1919 
    2020static double 
    21 effective_radius(int mode, double fp_n_shells, double thickness[], double interface[]) 
     21radius_effective(int mode, double fp_n_shells, double thickness[], double interface[]) 
    2222{ 
    2323    // case 1: outer radius 
  • sasmodels/models/spherical_sld.py

    rc1e44e5 rd57b06c  
    1818sub-shell is described by a line function, with *n_steps* sub-shells per 
    1919interface. The form factor is normalized by the total volume of the sphere. 
     20 
     21.. note:: 
     22 
     23   *n_shells* must be an integer. *n_steps* must be an ODD integer. 
    2024 
    2125Interface shapes are as follows: 
     
    7377    3 \rho_\text{solvent} V(r_N) 
    7478    \Big[ \frac{\sin(qr_N) - qr_N \cos(qr_N)} {qr_N^3} \Big] 
    75  
    7679 
    7780Here we assumed that the SLDs of the core and solvent are constant in $r$. 
     
    156159    \end{align*} 
    157160 
    158  
    159161We assume $\rho_{\text{inter}_j} (r)$ is approximately linear 
    160162within the sub-shell $j$. 
     
    179181    when $P(Q) * S(Q)$ is applied. 
    180182 
    181  
    182183References 
    183184---------- 
     
    187188 
    188189Authorship and Verification 
    189 ---------------------------- 
     190--------------------------- 
    190191 
    191192* **Author:** Jae-Hie Cho **Date:** Nov 1, 2010 
    192193* **Last Modified by:** Paul Kienzle **Date:** Dec 20, 2016 
    193 * **Last Reviewed by:** Paul Butler **Date:** September 8, 2018 
     194* **Last Reviewed by:** Steve King **Date:** March 29, 2019 
    194195""" 
    195196 
     
    199200 
    200201name = "spherical_sld" 
    201 title = "Sperical SLD intensity calculation" 
     202title = "Spherical SLD intensity calculation" 
    202203description = """ 
    203204            I(q) = 
     
    211212# pylint: disable=bad-whitespace, line-too-long 
    212213#            ["name", "units", default, [lower, upper], "type", "description"], 
    213 parameters = [["n_shells",             "",           1,      [1, 10],        "volume", "number of shells"], 
     214parameters = [["n_shells",             "",           1,      [1, 10],        "volume", "number of shells (must be integer)"], 
    214215              ["sld_solvent",          "1e-6/Ang^2", 1.0,    [-inf, inf],    "sld", "solvent sld"], 
    215216              ["sld[n_shells]",        "1e-6/Ang^2", 4.06,   [-inf, inf],    "sld", "sld of the shell"], 
     
    224225single = False  # TODO: fix low q behaviour 
    225226have_Fq = True 
    226 effective_radius_type = ["outer radius"] 
     227radius_effective_modes = ["outer radius"] 
    227228 
    228229profile_axes = ['Radius (A)', 'SLD (1e-6/A^2)'] 
  • sasmodels/models/triaxial_ellipsoid.c

    r99658f6 ra34b811  
    7676 
    7777static double 
    78 effective_radius(int mode, double radius_equat_minor, double radius_equat_major, double radius_polar) 
     78radius_effective(int mode, double radius_equat_minor, double radius_equat_major, double radius_polar) 
    7979{ 
    8080    switch (mode) { 
  • sasmodels/models/triaxial_ellipsoid.py

    rc1e44e5 rd57b06c  
    156156source = ["lib/sas_3j1x_x.c", "lib/gauss76.c", "triaxial_ellipsoid.c"] 
    157157have_Fq = True 
    158 effective_radius_type = [ 
     158radius_effective_modes = [ 
    159159    "equivalent biaxial ellipsoid average curvature", 
    160160    "equivalent volume sphere", "min radius", "max radius", 
  • sasmodels/models/unified_power_Rg.py

    rc1e44e5 rd57b06c  
    8282 
    8383category = "shape-independent" 
    84 name = "unified_power_rg" 
     84name = "unified_power_Rg" 
    8585title = "Unified Power Rg" 
    8686description = """ 
  • sasmodels/models/vesicle.c

    r12f4c19 ra34b811  
    1313 
    1414static double 
    15 effective_radius(int mode, double radius, double thickness) 
     15radius_effective(int mode, double radius, double thickness) 
    1616{ 
    1717    // case 1: outer radius 
  • sasmodels/models/vesicle.py

    rc1e44e5 rd57b06c  
    9999source = ["lib/sas_3j1x_x.c", "vesicle.c"] 
    100100have_Fq = True 
    101 effective_radius_type = ["outer radius"] 
     101radius_effective_modes = ["outer radius"] 
    102102 
    103103def random(): 
  • sasmodels/product.py

    rb297ba9 r065d77d  
    3131# pylint: enable=unused-import 
    3232 
    33 # TODO: make estimates available to constraints 
     33# TODO: make shape averages available to constraints 
    3434#ESTIMATED_PARAMETERS = [ 
    35 #    ["est_radius_effective", "A", 0.0, [0, np.inf], "", "Estimated effective radius"], 
    36 #    ["est_volume_ratio", "", 1.0, [0, np.inf], "", "Estimated volume ratio"], 
     35#    ["mean_radius_effective", "A", 0.0, [0, np.inf], "", "mean effective radius"], 
     36#    ["mean_volume", "A", 0.0, [0, np.inf], "", "mean volume"], 
     37#    ["mean_volume_ratio", "", 1.0, [0, np.inf], "", "mean form: mean shell volume ratio"], 
    3738#] 
    38  
    3939STRUCTURE_MODE_ID = "structure_factor_mode" 
    4040RADIUS_MODE_ID = "radius_effective_mode" 
     
    4444    # type: (ModelInfo) -> List[Parameter] 
    4545    """ 
    46     Create parameters for structure_factor_mode and radius_effective_mode. 
     46    Create parameters for structure factor and effective radius modes. 
    4747    """ 
    4848    pars = [] 
     
    5656            "Structure factor calculation") 
    5757        pars.append(par) 
    58     if p_info.effective_radius_type is not None: 
     58    if p_info.radius_effective_modes is not None: 
    5959        par = parse_parameter( 
    6060            RADIUS_MODE_ID, 
    6161            "", 
    6262            1, 
    63             [["unconstrained"] + p_info.effective_radius_type], 
     63            [["unconstrained"] + p_info.radius_effective_modes], 
    6464            "", 
    6565            "Effective radius calculation") 
     
    177177        S,                # type: np.ndarray 
    178178        scale,            # type: float 
    179         effective_radius, # type: float 
     179        radius_effective, # type: float 
    180180        beta_mode,        # type: bool 
    181181    ): 
     
    185185    The result may be an array or a float. 
    186186    """ 
     187    # CRUFT: remove effective_radius once SasView 5.0 is released. 
    187188    if beta_mode: 
    188189        # TODO: 1. include calculated Q vector 
     
    193194            ("beta(Q)", F1**2 / F2), 
    194195            ("S_eff(Q)", 1 + (F1**2 / F2)*(S-1)), 
    195             ("effective_radius", effective_radius), 
     196            ("effective_radius", radius_effective), 
     197            ("radius_effective", radius_effective), 
    196198            # ("I(Q)", scale*(F2 + (F1**2)*(S-1)) + bg), 
    197199        )) 
     
    200202            ("P(Q)", scale*F2), 
    201203            ("S(Q)", S), 
    202             ("effective_radius", effective_radius), 
     204            ("effective_radius", radius_effective), 
     205            ("radius_effective", radius_effective), 
    203206        )) 
    204207    return parts 
     
    281284        # R_eff type parameter is the second parameter after P and S parameters 
    282285        # unless the model doesn't support beta mode, in which case it is first 
    283         have_radius_type = p_info.effective_radius_type is not None 
     286        have_radius_type = p_info.radius_effective_modes is not None 
     287        #print(p_npars,s_npars) 
    284288        radius_type_offset = 2+p_npars+s_npars + (1 if have_beta_mode else 0) 
     289        #print(values[radius_type_offset]) 
    285290        radius_type = int(values[radius_type_offset]) if have_radius_type else 0 
    286291 
     
    331336        # Call the form factor kernel to compute <F> and <F^2>. 
    332337        # If the model doesn't support Fq the returned <F> will be None. 
    333         F1, F2, effective_radius, shell_volume, volume_ratio = self.p_kernel.Fq( 
     338        F1, F2, radius_effective, shell_volume, volume_ratio = self.p_kernel.Fq( 
    334339            p_details, p_values, cutoff, magnetic, radius_type) 
    335340 
     
    341346        # implementation details in kernel_iq.c. 
    342347        #print("R_eff=%d:%g, volfrac=%g, volume ratio=%g" 
    343         #      % (radius_type, effective_radius, volfrac, volume_ratio)) 
     348        #      % (radius_type, radius_effective, volfrac, volume_ratio)) 
    344349        if radius_type > 0: 
    345350            # set the value to the model R_eff and set the weight to 1 
    346             s_values[2] = s_values[2+s_npars+s_offset[0]] = effective_radius 
     351            s_values[2] = s_values[2+s_npars+s_offset[0]] = radius_effective 
    347352            s_values[2+s_npars+s_offset[0]+nweights] = 1.0 
    348353        s_values[3] = s_values[2+s_npars+s_offset[1]] = volfrac*volume_ratio 
     
    370375        # the results directly rather than through a lazy evaluator. 
    371376        self.results = lambda: _intermediates( 
    372             F1, F2, S, combined_scale, effective_radius, beta_mode) 
     377            F1, F2, S, combined_scale, radius_effective, beta_mode) 
    373378 
    374379        return final_result 
  • sasmodels/sasview_model.py

    rb297ba9 ra34b811  
    299299    attrs['category'] = model_info.category 
    300300    attrs['is_structure_factor'] = model_info.structure_factor 
    301     attrs['is_form_factor'] = model_info.effective_radius_type is not None 
     301    attrs['is_form_factor'] = model_info.radius_effective_modes is not None 
    302302    attrs['is_multiplicity_model'] = variants[0] > 1 
    303303    attrs['multiplicity_info'] = variants 
     
    763763        #    if er_mode > 0: 
    764764        #        res = calculator.Fq(call_details, values, cutoff=self.cutoff, 
    765         #                            magnetic=False, effective_radius_type=mode) 
     765        #                            magnetic=False, radius_effective_mode=mode) 
    766766        #        R_eff, form_shell_ratio = res[2], res[4] 
    767767        #        return R_eff, form_shell_ratio 
  • doc/conf.py

    r30b60d2 rc1e44e5  
    3636              #'only_directives', 
    3737              #'matplotlib.sphinxext.mathmpl', 
    38               'matplotlib.sphinxext.only_directives', 
     38              #'matplotlib.sphinxext.only_directives', 
    3939              'matplotlib.sphinxext.plot_directive', 
    4040              'dollarmath', 
  • doc/genmodel.py

    rb866abf ra42b091  
    77import matplotlib.pyplot as plt 
    88sys.path.insert(0, os.path.abspath('..')) 
     9import sasmodels 
    910from sasmodels import generate, core 
    1011from sasmodels.direct_model import DirectModel, call_profile 
     
    127128    #print("figure saved in",path) 
    128129 
     130def copy_if_newer(src, dst): 
     131    from os.path import dirname, exists, getmtime 
     132    import shutil 
     133    if not exists(dst): 
     134        path = dirname(dst) 
     135        if not exists(path): 
     136            os.makedirs(path) 
     137        shutil.copy2(src, dst) 
     138    elif getmtime(src) > getmtime(dst): 
     139        shutil.copy2(src, dst) 
     140 
     141def link_sources(model_info): 
     142    from os.path import basename, dirname, realpath, join as joinpath 
     143 
     144    # List source files in reverse order of dependency. 
     145    model_file = basename(model_info.filename) 
     146    sources = list(reversed(model_info.source + [model_file])) 
     147 
     148    # Copy files to src dir under models directory.  Need to do this 
     149    # because sphinx can't link to an absolute path. 
     150    root = dirname(dirname(realpath(__file__))) 
     151    src = joinpath(root, "sasmodels", "models") 
     152    dst = joinpath(root, "doc", "model", "src") 
     153    for path in sources: 
     154        copy_if_newer(joinpath(src, path), joinpath(dst, path)) 
     155 
     156    # Link to local copy of the files 
     157    downloads = [":download:`%s <src/%s>`"%(path, path) for path in sources] 
     158 
     159    # Could do syntax highlighting on the model files by creating a rst file 
     160    # beside each source file named containing source file with 
     161    # 
     162    #    src/path.rst: 
     163    # 
     164    #    .. {{ path.replace('/','_') }}: 
     165    # 
     166    #    .. literalinclude:: {{ src/path }} 
     167    #        :language: {{ "python" if path.endswith('.py') else "c" }} 
     168    #        :linenos: 
     169    # 
     170    # and link to it using 
     171    # 
     172    #     colors = [":ref:`%s`"%(path.replace('/','_')) for path in sources] 
     173    # 
     174    # Probably need to dump all the rst files into an index.rst to build them. 
     175 
     176    # Link to github repo (either the tagged sasmodels version or master) 
     177    url = "https://github.com/SasView/sasmodels/blob/v%s"%sasmodels.__version__ 
     178    #url = "https://github.com/SasView/sasmodels/blob/master"%sasmodels.__version__ 
     179    links = ["`%s <%s/sasmodels/models/%s>`_"%(path, url, path) for path in sources] 
     180 
     181    sep = u"\n\\ \u25E6 \\ "  # bullet 
     182    body = "\n**Source**\n" 
     183    #body += "\n\\ " + sep.join(links) + "\n\n" 
     184    body += "\n\\ " + sep.join(downloads) + "\n\n" 
     185    return body 
     186 
    129187def gen_docs(model_info): 
    130188    # type: (ModelInfo) -> None 
     
    150208    match = re.search(pattern, docstr.upper()) 
    151209 
     210    sources = link_sources(model_info) 
     211 
     212    insertion = captionstr + sources 
     213 
    152214    if match: 
    153215        docstr1 = docstr[:match.start()] 
    154216        docstr2 = docstr[match.start():] 
    155         docstr = docstr1 + captionstr + docstr2 
     217        docstr = docstr1 + insertion + docstr2 
    156218    else: 
    157219        print('------------------------------------------------------------------') 
    158220        print('References NOT FOUND for model: ', model_info.id) 
    159221        print('------------------------------------------------------------------') 
    160         docstr += captionstr 
     222        docstr += insertion 
    161223 
    162224    open(sys.argv[2],'w').write(docstr) 
  • sasmodels/models/adsorbed_layer.py

    r0507e09 rc1e44e5  
    4949   Layers*, *Macromol. Symp.*, 190 (2002) 33-42. 
    5050 
    51 Source 
    52 ------ 
    53  
    54 `adsorbed_layer.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/adsorbed_layer.py>`_ 
    55  
    5651Authorship and Verification 
    5752---------------------------- 
     
    6055* **Last Modified by:** Paul Kienzle **Date:** April 14, 2016 
    6156* **Last Reviewed by:** Steve King **Date:** March 18, 2016 
    62 * **Source added by :** Steve King **Date:** March 25, 2019 
    6357""" 
    6458 
  • sasmodels/models/bcc_paracrystal.py

    r0507e09 rc1e44e5  
    100100   (Corrections to FCC and BCC lattice structure calculation) 
    101101 
    102 Source 
    103 ------ 
    104  
    105 `bcc_paracrystal.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/bcc_paracrystal.py>`_ 
    106  
    107 `bcc_paracrystal.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/bcc_paracrystal.c>`_ 
    108  
    109102Authorship and Verification 
    110103--------------------------- 
     
    113106* **Last Modified by:** Paul Butler **Date:** September 29, 2016 
    114107* **Last Reviewed by:** Richard Heenan **Date:** March 21, 2016 
    115 * **Source added by :** Steve King **Date:** March 25, 2019 
    116108""" 
    117109 
  • sasmodels/models/be_polyelectrolyte.py

    r0507e09 rc1e44e5  
    9191.. [#] E Raphael, J F Joanny, *Europhysics Letters*, 11 (1990) 179 
    9292 
    93 Source 
    94 ------ 
    95  
    96 `be_polyelectrolyte.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/be_polyelectrolyte.py>`_ 
    97  
    9893Authorship and Verification 
    9994---------------------------- 
     
    10297* **Last Modified by:** Paul Butler **Date:** September 25, 2018 
    10398* **Last Reviewed by:** Paul Butler **Date:** September 25, 2018 
    104 * **Source added by :** Steve King **Date:** March 25, 2019 
    10599""" 
    106100 
  • sasmodels/models/binary_hard_sphere.py

    r0507e09 rc1e44e5  
    6565.. [#] S R Kline, *J Appl. Cryst.*, 39 (2006) 895 
    6666 
    67 Source 
    68 ------ 
    69  
    70 `binary_hard_sphere.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/binary_hard_sphere.py>`_ 
    71  
    72 `binary_hard_sphere.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/binary_hard_sphere.c>`_ 
    73  
    7467Authorship and Verification 
    7568---------------------------- 
     
    7871* **Last Modified by:** Paul Butler **Date:** March 20, 2016 
    7972* **Last Reviewed by:** Paul Butler **Date:** March 20, 2016 
    80 * **Source added by :** Steve King **Date:** March 25, 2019 
    8173""" 
    8274 
  • sasmodels/models/broad_peak.py

    r0507e09 rc1e44e5  
    3333None. 
    3434 
    35 Source 
    36 ------ 
    37  
    38 `broad_peak.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/broad_peak.py>`_ 
    39  
    4035Authorship and Verification 
    4136---------------------------- 
     
    4439* **Last Modified by:** Paul kienle **Date:** July 24, 2016 
    4540* **Last Reviewed by:** Richard Heenan **Date:** March 21, 2016 
    46 * **Source added by :** Steve King **Date:** March 25, 2019 
    4741""" 
    4842 
  • sasmodels/models/correlation_length.py

    r0507e09 rc1e44e5  
    3232.. [#] B Hammouda, D L Ho and S R Kline, Insight into Clustering in Poly(ethylene oxide) Solutions, Macromolecules, 37 (2004) 6932-6937 
    3333 
    34 Source 
    35 ------ 
    36  
    37 `correlation_length.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/correlation_length.py>`_ 
    38  
    3934Authorship and Verification 
    4035---------------------------- 
    4136 
    42 * **Author:**  
    43 * **Last Modified by:**  
    44 * **Last Reviewed by:**  
    45 * **Source added by :** Steve King **Date:** March 25, 2019 
     37* **Author:** 
     38* **Last Modified by:** 
     39* **Last Reviewed by:** 
    4640""" 
    4741 
  • sasmodels/models/fcc_paracrystal.py

    r0507e09 rc1e44e5  
    9999   (Corrections to FCC and BCC lattice structure calculation) 
    100100 
    101 Source 
    102 ------ 
    103  
    104 `fcc_paracrystal.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/fcc_paracrystal.py>`_ 
    105  
    106 `fcc_paracrystal.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/fcc_paracrystal.c>`_ 
    107  
    108101Authorship and Verification 
    109102--------------------------- 
     
    112105* **Last Modified by:** Paul Butler **Date:** September 29, 2016 
    113106* **Last Reviewed by:** Richard Heenan **Date:** March 21, 2016 
    114 * **Source added by :** Steve King **Date:** March 25, 2019 
    115107""" 
    116108 
  • sasmodels/models/flexible_cylinder_elliptical.py

    rdb1d9d5 rc1e44e5  
    8383.. [#] W R Chen, P D Butler and L J Magid, *Incorporating Intermicellar Interactions in the Fitting of SANS Data from Cationic Wormlike Micelles.* Langmuir, 22(15) 2006 6539-6548 
    8484 
    85 Source 
    86 ------ 
    87  
    88 `flexible_cylinder_elliptical.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/flexible_cylinder_elliptical.py>`_ 
    89  
    90 `flexible_cylinder_elliptical.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/flexible_cylinder_elliptical.c>`_ 
    91  
    92 `wrc_cyl.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/lib/wrc_cyl.c>`_ 
    93  
    9485Authorship and Verification 
    9586---------------------------- 
     
    9889* **Last Modified by:** Richard Heenan **Date:** December, 2016 
    9990* **Last Reviewed by:** Steve King **Date:** March 26, 2019 
    100 * **Source added by :** Steve King **Date:** March 25, 2019 
    10191""" 
    10292 
  • sasmodels/models/fractal.py

    r0507e09 rc1e44e5  
    4646.. [#] J Teixeira, *J. Appl. Cryst.*, 21 (1988) 781-785 
    4747 
    48 Source 
    49 ------ 
    50  
    51 `fractal.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/fractal.py>`_ 
    52  
    53 `fractal.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/fractal.c>`_ 
    54  
    5548Authorship and Verification 
    5649---------------------------- 
     
    6053* **Last Modified by:** Paul Butler **Date:** March 12, 2017 
    6154* **Last Reviewed by:** Paul Butler **Date:** March 12, 2017 
    62 * **Source added by :** Steve King **Date:** March 25, 2019 
    6355""" 
    6456from __future__ import division 
  • sasmodels/models/fractal_core_shell.py

    r0507e09 rc1e44e5  
    5151.. [#Kline]  S R Kline, *J Appl. Cryst.*, 39 (2006) 895 
    5252 
    53 Source 
    54 ------ 
    55  
    56 `fractal_core_shell.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/fractal_core_shell.py>`_ 
    57  
    58 `fractal_core_shell.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/fractal_core_shell.c>`_ 
    59  
    6053Authorship and Verification 
    6154---------------------------- 
     
    6457* **Last Modified by:** Paul Butler and Paul Kienzle **Date:** November 27, 2016 
    6558* **Last Reviewed by:** Paul Butler and Paul Kienzle **Date:** November 27, 2016 
    66 * **Source added by :** Steve King **Date:** March 25, 2019 
    6759""" 
    6860 
  • sasmodels/models/gauss_lorentz_gel.py

    r0507e09 rc1e44e5  
    3434.. [#] G Evmenenko, E Theunissen, K Mortensen, H Reynaers, *Polymer*, 42 (2001) 2907-2913 
    3535 
    36 Source 
    37 ------ 
    38  
    39 `gauss_lorentz_gel.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/gauss_lorentz_gel.py>`_ 
    40  
    4136Authorship and Verification 
    4237---------------------------- 
    4338 
    44 * **Author:**  
    45 * **Last Modified by:**  
    46 * **Last Reviewed by:**  
    47 * **Source added by :** Steve King **Date:** March 25, 2019 
     39* **Author:** 
     40* **Last Modified by:** 
     41* **Last Reviewed by:** 
    4842""" 
    4943 
  • sasmodels/models/gaussian_peak.py

    r0507e09 rc1e44e5  
    2727None. 
    2828 
    29 Source 
    30 ------ 
    31  
    32 `gaussian_peak.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/gaussian_peak.py>`_ 
    33  
    3429Authorship and Verification 
    3530---------------------------- 
    3631 
    37 * **Author:**  
    38 * **Last Modified by:**  
    39 * **Last Reviewed by:**  
    40 * **Source added by :** Steve King **Date:** March 25, 2019 
     32* **Author:** 
     33* **Last Modified by:** 
     34* **Last Reviewed by:** 
    4135""" 
    4236 
  • sasmodels/models/gel_fit.py

    r0507e09 rc1e44e5  
    4141.. [#] Simon Mallam, Ferenc Horkay, Anne-Marie Hecht, Adrian R Rennie, Erik Geissler, *Macromolecules* 1991, 24, 543-548 
    4242 
    43 Source 
    44 ------ 
    45  
    46 `gel_fit.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/gel_fit.py>`_ 
    47  
    48 `gel_fit.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/gel_fit.c>`_ 
    49  
    5043Authorship and Verification 
    5144---------------------------- 
    5245 
    53 * **Author:**  
    54 * **Last Modified by:**  
    55 * **Last Reviewed by:**  
    56 * **Source added by :** Steve King **Date:** March 25, 2019 
     46* **Author:** 
     47* **Last Modified by:** 
     48* **Last Reviewed by:** 
    5749""" 
    5850 
  • sasmodels/models/guinier.py

    r0507e09 rc1e44e5  
    4848.. [#] A Guinier and G Fournet, *Small-Angle Scattering of X-Rays*, John Wiley & Sons, New York (1955) 
    4949 
    50 Source 
    51 ------ 
    52  
    53 `guinier.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/guinier.py>`_ 
    54  
    5550Authorship and Verification 
    5651---------------------------- 
    5752 
    58 * **Author:**  
    59 * **Last Modified by:**  
    60 * **Last Reviewed by:**  
    61 * **Source added by :** Steve King **Date:** March 25, 2019 
     53* **Author:** 
     54* **Last Modified by:** 
     55* **Last Reviewed by:** 
    6256""" 
    6357 
  • sasmodels/models/guinier_porod.py

    r7a5f8af rc1e44e5  
    6363.. [#] B Hammouda, *Analysis of the Beaucage model, J. Appl. Cryst.*, (2010), 43, 1474-1478 
    6464 
    65 Source 
    66 ------ 
    67  
    68 `guinier_porod.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/guinier_porod.py>`_ 
    69  
    7065Authorship and Verification 
    7166---------------------------- 
    7267 
    73 * **Author:**  
    74 * **Last Modified by:**  
    75 * **Last Reviewed by:**  
    76 * **Source added by :** Steve King **Date:** March 25, 2019 
     68* **Author:** 
     69* **Last Modified by:** 
     70* **Last Reviewed by:** 
    7771""" 
    7872 
  • sasmodels/models/hardsphere.py

    rdb1d9d5 rc1e44e5  
    5454.. [#] J K Percus, J Yevick, *J. Phys. Rev.*, 110, (1958) 1 
    5555 
    56 Source 
    57 ------ 
    58  
    59 `hardsphere.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/hardsphere.py>`_ 
    60  
    6156Authorship and Verification 
    6257---------------------------- 
     
    6560* **Last Modified by:** 
    6661* **Last Reviewed by:** 
    67 * **Source added by :** Steve King **Date:** March 25, 2019 
    6862""" 
    6963 
  • sasmodels/models/hayter_msa.py

    rdb1d9d5 rc1e44e5  
    6363.. [#] C G Malmberg and A A Maryott, *J. Res. Nat. Bureau Standards*, 56 (1956) 2641 
    6464 
    65 Source 
    66 ------ 
    67  
    68 `hayter_msa.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/hayter_msa.py>`_ 
    69  
    70 `hayter_msa.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/hayter_msa.c>`_ 
    71  
    7265Authorship and Verification 
    7366---------------------------- 
     
    7669* **Last Modified by:** 
    7770* **Last Reviewed by:** Steve King **Date:** March 28, 2019 
    78 * **Source added by :** Steve King **Date:** March 25, 2019 
    7971""" 
    8072 
  • sasmodels/models/lamellar.py

    r0507e09 rc1e44e5  
    4343.. [#] J Berghausen, J Zipfel, P Lindner, W Richtering, *J. Phys. Chem. B*, 105, (2001) 11081-11088 
    4444 
    45 Source 
    46 ------ 
    47  
    48 `lamellar.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/lamellar.py>`_ 
    49  
    5045Authorship and Verification 
    5146---------------------------- 
    5247 
    53 * **Author:**  
    54 * **Last Modified by:**  
    55 * **Last Reviewed by:**  
    56 * **Source added by :** Steve King **Date:** March 25, 2019 
     48* **Author:** 
     49* **Last Modified by:** 
     50* **Last Reviewed by:** 
    5751""" 
    5852 
  • sasmodels/models/lamellar_hg.py

    r0507e09 rc1e44e5  
    4545.. [#] J Berghausen, J Zipfel, P Lindner, W Richtering, *J. Phys. Chem. B*, 105, (2001) 11081-11088 
    4646 
    47 Source 
    48 ------ 
    49  
    50 `lamellar_hg.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/lamellar_hg.py>`_ 
    51  
    5247Authorship and Verification 
    5348---------------------------- 
    5449 
    55 * **Author:**  
    56 * **Last Modified by:**  
     50* **Author:** 
     51* **Last Modified by:** 
    5752* **Last Reviewed by:** S King and P Butler **Date** April 17, 2014 
    58 * **Source added by :** Steve King **Date:** March 25, 2019 
    5953""" 
    6054 
  • sasmodels/models/lamellar_hg_stack_caille.py

    r0507e09 rc1e44e5  
    7272.. [#] J Berghausen, J Zipfel, P Lindner, W Richtering, *J. Phys. Chem. B*, 105, (2001) 11081-11088 
    7373 
    74 Source 
    75 ------ 
    76  
    77 `lamellar_hg_stack_caille.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/lamellar_hg_stack_caille.py>`_ 
    78  
    79 `lamellar_hg_stack_caille.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/lamellar_hg_stack_caille.c>`_ 
    80  
    8174Authorship and Verification 
    8275---------------------------- 
    8376 
    84 * **Author:**  
    85 * **Last Modified by:**  
    86 * **Last Reviewed by:**  
    87 * **Source added by :** Steve King **Date:** March 25, 2019 
     77* **Author:** 
     78* **Last Modified by:** 
     79* **Last Reviewed by:** 
    8880""" 
    8981 
  • sasmodels/models/lamellar_stack_caille.py

    r0507e09 rc1e44e5  
    6868.. [#] J Berghausen, J Zipfel, P Lindner, W Richtering, *J. Phys. Chem. B*, 105, (2001) 11081-11088 
    6969 
    70 Source 
    71 ------ 
    72  
    73 `lamellar_stack_caille.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/lamellar_stack_caille.py>`_ 
    74  
    75 `lamellar_stack_caille.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/lamellar_stack_caille.c>`_ 
    76  
    7770Authorship and Verification 
    7871---------------------------- 
    7972 
    80 * **Author:**  
    81 * **Last Modified by:**  
    82 * **Last Reviewed by:**  
    83 * **Source added by :** Steve King **Date:** March 25, 2019 
     73* **Author:** 
     74* **Last Modified by:** 
     75* **Last Reviewed by:** 
    8476""" 
    8577 
  • sasmodels/models/lamellar_stack_paracrystal.py

    r0507e09 rc1e44e5  
    9090.. [#] M Bergstrom, J S Pedersen, P Schurtenberger, S U Egelhaaf, *J. Phys. Chem. B*, 103 (1999) 9888-9897 
    9191 
    92 Source 
    93 ------ 
    94  
    95 `lamellar_stack_paracrystal.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/lamellar_stack_paracrystal.py>`_ 
    96  
    97 `lamellar_stack_paracrystal.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/lamellar_stack_paracrystal.c>`_ 
    98  
    9992Authorship and Verification 
    10093---------------------------- 
    10194 
    102 * **Author:**  
    103 * **Last Modified by:**  
    104 * **Last Reviewed by:**  
    105 * **Source added by :** Steve King **Date:** March 25, 2019 
     95* **Author:** 
     96* **Last Modified by:** 
     97* **Last Reviewed by:** 
    10698""" 
    10799import numpy as np 
  • sasmodels/models/line.py

    r0507e09 rc1e44e5  
    2323None. 
    2424 
    25 Source 
    26 ------ 
    27  
    28 `line.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/line.py>`_ 
    29  
    3025Authorship and Verification 
    3126---------------------------- 
    3227 
    33 * **Author:**  
    34 * **Last Modified by:**  
    35 * **Last Reviewed by:**  
    36 * **Source added by :** Steve King **Date:** March 25, 2019""" 
     28* **Author:** 
     29* **Last Modified by:** 
     30* **Last Reviewed by:** 
     31""" 
    3732 
    3833import numpy as np 
  • sasmodels/models/linear_pearls.py

    r0507e09 rc1e44e5  
    3131.. [#] A V Dobrynin, M Rubinstein and S P Obukhov, *Macromol.*, 29 (1996) 2974-2979 
    3232 
    33 Source 
    34 ------ 
    35  
    36 `linear_pearls.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/linear_pearls.py>`_ 
    37  
    38 `linear_pearls.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/linear_pearls.c>`_ 
    39  
    4033Authorship and Verification 
    4134---------------------------- 
    4235 
    43 * **Author:**  
    44 * **Last Modified by:**  
    45 * **Last Reviewed by:**  
    46 * **Source added by :** Steve King **Date:** March 25, 2019""" 
     36* **Author:** 
     37* **Last Modified by:** 
     38* **Last Reviewed by:** 
     39""" 
    4740 
    4841import numpy as np 
  • sasmodels/models/lorentz.py

    r0507e09 rc1e44e5  
    2222.. [#] L.S. Qrnstein and F. Zernike, *Proc. Acad. Sci. Amsterdam* 17, 793 (1914), and *Z. Phys.* 19, 134 (1918), and 27, 761 {1926); referred to as QZ. 
    2323 
    24 Source 
    25 ------ 
    26  
    27 `lorentz.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/lorentz.py>`_ 
    28  
    2924Authorship and Verification 
    3025---------------------------- 
    3126 
    32 * **Author:**  
    33 * **Last Modified by:**  
    34 * **Last Reviewed by:**  
    35 * **Source added by :** Steve King **Date:** March 25, 2019""" 
     27* **Author:** 
     28* **Last Modified by:** 
     29* **Last Reviewed by:** 
     30""" 
    3631 
    3732import numpy as np 
  • sasmodels/models/mass_fractal.py

    r0507e09 rc1e44e5  
    5151.. [#] D Mildner and P Hall, *J. Phys. D: Appl. Phys.*, 19 (1986) 1535-1545 Equation(9) 
    5252 
    53 Source 
    54 ------ 
    55  
    56 `mass_fractal.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/mass_fractal.py>`_ 
    57  
    58 `mass_fractal.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/mass_fractal.c>`_ 
    59  
    6053Authorship and Verification 
    6154---------------------------- 
    6255 
    63 * **Author:**  
    64 * **Last Modified by:**  
    65 * **Last Reviewed by:**  
    66 * **Source added by :** Steve King **Date:** March 25, 2019""" 
     56* **Author:** 
     57* **Last Modified by:** 
     58* **Last Reviewed by:** 
     59""" 
    6760 
    6861import numpy as np 
  • sasmodels/models/mass_surface_fractal.py

    r0507e09 rc1e44e5  
    5555   35 (1987) 2361-2364 Equation(2) 
    5656 
    57 Source 
    58 ------ 
    59  
    60 `mass_surface_fractal.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/mass_surface_fractal.py>`_ 
    61  
    62 `mass_surface_fractal.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/mass_surface_fractal.c>`_ 
    63  
    6457Authorship and Verification 
    6558---------------------------- 
    6659 
    6760* **Author:** Piotr Rozyczko **Date:** Jan 20, 2016 
    68 * **Last Modified by:**  
     61* **Last Modified by:** 
    6962* **Last Reviewed by:** Richard Heenan **Date:** May 30, 2018 
    70 * **Source added by :** Steve King **Date:** March 25, 2019 
    7163""" 
    7264 
  • sasmodels/models/peak_lorentz.py

    r0507e09 rc1e44e5  
    2727None. 
    2828 
    29 Source 
    30 ------ 
    31  
    32 `peak_lorentz.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/peak_lorentz.py>`_ 
    33  
    34 `peak_lorentz.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/peak_lorentz.c>`_ 
    35  
    3629Authorship and Verification 
    3730---------------------------- 
    3831 
    39 * **Author:**  
    40 * **Last Modified by:**  
    41 * **Last Reviewed by:**  
    42 * **Source added by :** Steve King **Date:** March 25, 2019 
     32* **Author:** 
     33* **Last Modified by:** 
     34* **Last Reviewed by:** 
    4335""" 
    4436 
  • sasmodels/models/poly_gauss_coil.py

    ra34b811 rc1e44e5  
    4848.. [#] http://www.ncnr.nist.gov/staff/hammouda/distance_learning/chapter_28.pdf 
    4949 
    50 Source 
    51 ------ 
    52  
    53 `poly_gauss_coil.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/poly_gauss_coil.py>`_ 
    54  
    55 `poly_gauss_coil.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/poly_gauss_coil.c>`_ 
    56  
    5750Authorship and Verification 
    5851---------------------------- 
     
    6154* **Last Modified by:** 
    6255* **Last Reviewed by:** 
    63 * **Source added by :** Steve King **Date:** March 25, 2019 
    6456""" 
    6557 
  • sasmodels/models/polymer_excl_volume.py

    r0507e09 rc1e44e5  
    113113.. [#] B Hammouda & M-H Kim, *The empirical core-chain model* 247 (2017) 434-440 
    114114 
    115 Source 
    116 ------ 
    117  
    118 `polymer_excl_volume.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/polymer_excl_volume.py>`_ 
    119  
    120 `polymer_excl_volume.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/polymer_excl_volume.c>`_ 
    121  
    122115Authorship and Verification 
    123116---------------------------- 
    124117 
    125 * **Author:**  
    126 * **Last Modified by:**  
    127 * **Last Reviewed by:**  
    128 * **Source added by :** Steve King **Date:** March 25, 2019 
     118* **Author:** 
     119* **Last Modified by:** 
     120* **Last Reviewed by:** 
    129121""" 
    130122 
  • sasmodels/models/polymer_micelle.py

    r0507e09 rc1e44e5  
    7070.. [#] J Pedersen, *J. Appl. Cryst.*, 33 (2000) 637-640 
    7171 
    72 Source 
    73 ------ 
    74  
    75 `polymer_micelle.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/polymer_micelle.py>`_ 
    76  
    77 `polymer_micelle.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/polymer_micelle.c>`_ 
    78  
    7972Authorship and Verification 
    8073---------------------------- 
     
    8376* **Last modified by:** Paul Kienzle **Date:** November 29, 2017 
    8477* **Last reviewed by:** Steve King **Date:** November 30, 2017 
    85 * **Source added by :** Steve King **Date:** March 25, 2019 
    8678""" 
    8779 
  • sasmodels/models/porod.py

    r0507e09 rc1e44e5  
    2121.. [#] L A Feigin, D I Svergun, G W Taylor. *Structure Analysis by Small-Angle X-ray and Neutron Scattering*. Springer. (1987) 
    2222 
    23 Source 
    24 ------ 
    25  
    26 `porod.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/porod.py>`_ 
    27  
    2823Authorship and Verification 
    2924---------------------------- 
    3025 
    31 * **Author:**  
    32 * **Last Modified by:**  
    33 * **Last Reviewed by:**  
    34 * **Source added by :** Steve King **Date:** March 25, 2019 
     26* **Author:** 
     27* **Last Modified by:** 
     28* **Last Reviewed by:** 
    3529""" 
    3630 
  • sasmodels/models/power_law.py

    r0507e09 rc1e44e5  
    2626None. 
    2727 
    28 Source 
    29 ------ 
    30  
    31 `power_law.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/power_law.py>`_ 
    32  
    3328Authorship and Verification 
    3429---------------------------- 
    3530 
    36 * **Author:**  
    37 * **Last Modified by:**  
    38 * **Last Reviewed by:**  
    39 * **Source added by :** Steve King **Date:** March 25, 2019 
     31* **Author:** 
     32* **Last Modified by:** 
     33* **Last Reviewed by:** 
    4034""" 
    4135 
  • sasmodels/models/rpa.py

    rdb1d9d5 rc1e44e5  
    6767.. [#] B. Hammouda, *SANS Toolbox* https://www.ncnr.nist.gov/staff/hammouda/the_sans_toolbox.pdf. 
    6868 
    69 Source 
    70 ------ 
    71  
    72 `rpa.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/rpa.py>`_ 
    73  
    74 `rpa.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/rpa.c>`_ 
    75  
    7669Authorship and Verification 
    7770---------------------------- 
     
    8174* **Last Modified by:** Paul Butler **Date:** March 12, 2017 
    8275* **Last Reviewed by:** Steve King **Date:** March 27, 2019 
    83 * **Source added by :** Steve King **Date:** March 25, 2019 
    8476""" 
    8577 
  • sasmodels/models/sc_paracrystal.py

    r0507e09 rc1e44e5  
    101101.. [#CIT1990] Hideki Matsuoka et. al. *Physical Review B*, 41 (1990) 3854 -3856 (Corrections to FCC and BCC lattice structure calculation) 
    102102 
    103 Source 
    104 ------ 
    105  
    106 `sc_paracrystal.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/sc_paracrystal.py>`_ 
    107  
    108 `sc_paracrystal.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/sc_paracrystal.c>`_ 
    109  
    110103Authorship and Verification 
    111104--------------------------- 
     
    114107* **Last Modified by:** Steve King **Date:** March 25, 2019 
    115108* **Last Reviewed by:** Richard Heenan **Date:** March 21, 2016 
    116 * **Source added by :** Steve King **Date:** March 25, 2019 
    117109""" 
    118110 
  • sasmodels/models/spinodal.py

    r0507e09 rc1e44e5  
    4444.. [#] T. Hashimoto, M. Takenaka & H. Jinnai. Scattering Studies of Self-Assembling Processes of Polymer Blends in Spinodal Decomposition. J. Appl. Cryst. 24, 457-466 (1991). 
    4545 
    46 Source 
    47 ------ 
    48  
    49 `spinodal.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/spinodal.py>`_ 
    50  
    5146Authorship and Verification 
    5247---------------------------- 
     
    5550* **Last Modified by:** Steve King **Date:** Oct 25, 2018 
    5651* **Last Reviewed by:** Steve King **Date:** Oct 25, 2018 
    57 * **Source added by :** Steve King **Date:** March 25, 2019 
    5852""" 
    5953 
  • sasmodels/models/squarewell.py

    rdb1d9d5 rc1e44e5  
    5454.. [#] M Kotlarchyk and S-H Chen, *J. Chem. Phys.*, 79 (1983) 2461-2469 
    5555 
    56 Source 
    57 ------ 
    58  
    59 `squarewell.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/squarewell.py>`_ 
    60  
    6156Authorship and Verification 
    6257---------------------------- 
     
    6560* **Last Modified by:** 
    6661* **Last Reviewed by:** Steve King **Date:** March 27, 2019 
    67 * **Source added by :** Steve King **Date:** March 25, 2019 
    6862""" 
    6963 
  • sasmodels/models/stacked_disks.py

    r0507e09 rc1e44e5  
    102102   John Wiley and Sons, New York, 1955 
    103103 
    104 Source 
    105 ------ 
    106  
    107 `stacked_disks.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/stacked_disks.py>`_ 
    108  
    109 `stacked_disks.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/stacked_disks.c>`_ 
    110  
    111104Authorship and Verification 
    112105---------------------------- 
     
    115108* **Last Modified by:** Paul Butler and Paul Kienzle **Date:** November 26, 2016 
    116109* **Last Reviewed by:** Paul Butler and Paul Kienzle **Date:** November 26, 2016 
    117 * **Source added by :** Steve King **Date:** March 25, 2019 
    118110""" 
    119111 
  • sasmodels/models/star_polymer.py

    r0507e09 rc1e44e5  
    5050   B Ewen *Macromolecules*, 22, 468-472 (1989) 
    5151 
    52 Source 
    53 ------ 
    54  
    55 `star_polymer.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/star_polymer.py>`_ 
    56  
    57 `star_polymer.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/star_polymer.c>`_ 
    58  
    5952Authorship and Verification 
    6053---------------------------- 
     
    6356* **Last Modified by:** Paul Butler **Date:** Auguts 26, 2017 
    6457* **Last Reviewed by:** Ziang Li and Richard Heenan **Date:** May 17, 2017 
    65 * **Source added by :** Steve King **Date:** March 25, 2019 
    6658""" 
    6759 
  • sasmodels/models/stickyhardsphere.py

    rdb1d9d5 rc1e44e5  
    7878.. [#] M Kotlarchyk and S-H Chen, *J. Chem. Phys.*, 79 (1983) 2461-2469 
    7979 
    80 Source 
    81 ------ 
    82  
    83 `stickyhardsphere.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/stickyhardsphere.py>`_ 
    84  
    8580Authorship and Verification 
    8681---------------------------- 
     
    8984* **Last Modified by:** 
    9085* **Last Reviewed by:** Steve King **Date:** March 27, 2019 
    91 * **Source added by :** Steve King **Date:** March 25, 2019 
    9286""" 
    9387 
  • sasmodels/models/surface_fractal.py

    r0507e09 rc1e44e5  
    3838.. [#] D Mildner and P Hall, *J. Phys. D: Appl. Phys.*, 19 (1986) 1535-1545 
    3939 
    40 Source 
    41 ------ 
    42  
    43 `surface_fractal.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/surface_fractal.py>`_ 
    44  
    45 `surface_fractal.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/surface_fractal.c>`_ 
    46  
    4740Authorship and Verification 
    4841---------------------------- 
    4942 
    50 * **Author:**  
    51 * **Last Modified by:**  
    52 * **Last Reviewed by:**  
    53 * **Source added by :** Steve King **Date:** March 25, 2019 
     43* **Author:** 
     44* **Last Modified by:** 
     45* **Last Reviewed by:** 
    5446""" 
    5547 
  • sasmodels/models/teubner_strey.py

    r0507e09 rc1e44e5  
    6565.. [#] H Endo, M Mihailescu, M. Monkenbusch, J Allgaier, G Gompper, D Richter, B Jakobs, T Sottmann, R Strey, and I Grillo, *J. Chem. Phys.*, 115 (2001), 580 
    6666 
    67 Source 
    68 ------ 
    69  
    70 `teubner_strey.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/teubner_strey.py>`_ 
    71  
    72 `teubner_strey.c <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/teubner_strey.c>`_ 
    73  
    7467Authorship and Verification 
    7568---------------------------- 
    7669 
    77 * **Author:**  
    78 * **Last Modified by:**  
    79 * **Last Reviewed by:**  
    80 * **Source added by :** Steve King **Date:** March 25, 2019 
     70* **Author:** 
     71* **Last Modified by:** 
     72* **Last Reviewed by:** 
    8173""" 
    8274from __future__ import division 
  • sasmodels/models/two_lorentzian.py

    r0507e09 rc1e44e5  
    2727None. 
    2828 
    29 Source 
    30 ------ 
    31  
    32 `two_lorentzian.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/two_lorentzian.py>`_ 
    33  
    3429Authorship and Verification 
    3530---------------------------- 
     
    3833* **Last Modified by:** Piotr rozyczko **Date:** January 29, 2016 
    3934* **Last Reviewed by:** Paul Butler **Date:** March 21, 2016 
    40 * **Source added by :** Steve King **Date:** March 25, 2019 
    4135""" 
    4236 
  • sasmodels/models/two_power_law.py

    r0507e09 rc1e44e5  
    3737None. 
    3838 
    39 Source 
    40 ------ 
    41  
    42 `two_power_law.py <https://github.com/SasView/sasmodels/blob/master/sasmodels/models/two_power_law.py>`_ 
    43  
    4439Authorship and Verification 
    4540---------------------------- 
     
    4843* **Last Modified by:** Wojciech Wpotrzebowski **Date:** February 18, 2016 
    4944* **Last Reviewed by:** Paul Butler **Date:** March 21, 2016 
    50 * **Source added by :** Steve King **Date:** March 25, 2019 
    5145""" 
    5246 
Note: See TracChangeset for help on using the changeset viewer.