Changeset a34b811 in sasmodels


Ignore:
Timestamp:
Mar 28, 2019 5:02:53 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, ticket-1257-vesicle-product, ticket_1156, ticket_822_more_unit_tests
Children:
db1d9d5
Parents:
e5cb3df
Message:

use radius_effective/radius_effective_mode/radius_effective_modes consistently throughout the code

Files:
73 edited

Legend:

Unmodified
Added
Removed
  • 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

    r0b8a1fc 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_type=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_type=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_type=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_type=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/direct_model.py

    rd8e81f7 ra34b811  
    7171    For solid objects V_shell is equal to V_form and the volume ratio is 1. 
    7272 
    73     Use parameter *effective_radius_type* to select the effective radius THIS MIGHT NEED CHECKING radius_effective_mode or effecive_radius_type??? 
    74     calculation. 
     73    Use parameter *radius_effective_mode* to select the effective radius 
     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)) 
  • 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

    r12f4c19 ra34b811  
    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. 
     
    285285    pglobal double *result,       // nq+1 return values, again with padding 
    286286    const double cutoff,          // cutoff in the dispersity weight product 
    287     int32_t effective_radius_type // which effective radius to compute 
     287    int32_t radius_effective_mode // which effective radius to compute 
    288288    ) 
    289289{ 
     
    703703      weighted_form += weight * form; 
    704704      weighted_shell += weight * shell; 
    705       if (effective_radius_type != 0) { 
    706         weighted_radius += weight * CALL_EFFECTIVE_RADIUS(effective_radius_type, local_values.table); 
     705      if (radius_effective_mode != 0) { 
     706        weighted_radius += weight * CALL_RADIUS_EFFECTIVE(radius_effective_mode, local_values.table); 
    707707      } 
    708708      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/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

    r0507e09 ra34b811  
    4848---------------------------- 
    4949 
    50 * **Author: P Kienzle**  
    51 * **Last Modified by:**  
     50* **Author: P Kienzle** 
     51* **Last Modified by:** 
    5252* **Last Reviewed by:** S King and P Parker **Date:** 2013/09/09 and 2014/01/06 
    5353* **Source added by :** Steve King **Date:** March 25, 2019 
     
    8383    return 1.333333333333333 * pi * radius ** 3 
    8484 
    85 def effective_radius(mode, radius): 
     85def radius_effective(mode, radius): 
    8686    """Calculate R_eff for sphere""" 
    87     return radius 
     87    return radius if mode else 0. 
    8888 
    8989def 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

    r0507e09 ra34b811  
    126126source = ["lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c", "barbell.c"] 
    127127have_Fq = True 
    128 effective_radius_type = [ 
     128radius_effective_modes = [ 
    129129    "equivalent cylinder excluded volume", "equivalent volume sphere", 
    130130    "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

    r0507e09 ra34b811  
    146146source = ["lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c", "capped_cylinder.c"] 
    147147have_Fq = True 
    148 effective_radius_type = [ 
     148radius_effective_modes = [ 
    149149    "equivalent cylinder excluded volume", "equivalent volume sphere", 
    150150    "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

    r0507e09 ra34b811  
    108108source = ["lib/sas_3j1x_x.c", "core_multi_shell.c"] 
    109109have_Fq = True 
    110 effective_radius_type = ["outer radius", "core radius"] 
     110radius_effective_modes = ["outer radius", "core radius"] 
    111111 
    112112def 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

    r0507e09 ra34b811  
    165165          "core_shell_bicelle.c"] 
    166166have_Fq = True 
    167 effective_radius_type = [ 
     167radius_effective_modes = [ 
    168168    "excluded volume", "equivalent volume sphere", "outer rim radius", 
    169169    "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

    r0507e09 ra34b811  
    155155          "core_shell_bicelle_elliptical.c"] 
    156156have_Fq = True 
    157 effective_radius_type = [ 
     157radius_effective_modes = [ 
    158158    "equivalent cylinder excluded volume", "equivalent volume sphere", 
    159159    "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

    r0507e09 ra34b811  
    168168          "core_shell_bicelle_elliptical_belt_rough.c"] 
    169169have_Fq = True 
    170 effective_radius_type = [ 
     170radius_effective_modes = [ 
    171171    "equivalent cylinder excluded volume", "equivalent volume sphere", 
    172172    "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

    r0507e09 ra34b811  
    141141source = ["lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c", "core_shell_cylinder.c"] 
    142142have_Fq = True 
    143 effective_radius_type = [ 
     143radius_effective_modes = [ 
    144144    "excluded volume", "equivalent volume sphere", "outer radius", "half outer length", 
    145145    "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

    r0507e09 ra34b811  
    155155source = ["lib/sas_3j1x_x.c", "lib/gauss76.c", "core_shell_ellipsoid.c"] 
    156156have_Fq = True 
    157 effective_radius_type = [ 
     157radius_effective_modes = [ 
    158158    "average outer curvature", "equivalent volume sphere", 
    159159    "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

    r0507e09 ra34b811  
    236236source = ["lib/gauss76.c", "core_shell_parallelepiped.c"] 
    237237have_Fq = True 
    238 effective_radius_type = [ 
     238radius_effective_modes = [ 
    239239    "equivalent cylinder excluded volume", 
    240240    "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

    r0507e09 ra34b811  
    6060---------------------------- 
    6161 
    62 * **Author:**  
    63 * **Last Modified by:**  
    64 * **Last Reviewed by:**  
     62* **Author:** 
     63* **Last Modified by:** 
     64* **Last Reviewed by:** 
    6565* **Source added by :** Steve King **Date:** March 25, 2019 
    6666""" 
     
    9292source = ["lib/sas_3j1x_x.c", "lib/core_shell.c", "core_shell_sphere.c"] 
    9393have_Fq = True 
    94 effective_radius_type = ["outer radius", "core radius"] 
     94radius_effective_modes = ["outer radius", "core radius"] 
    9595 
    9696demo = 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

    r6652522 ra34b811  
    155155source = ["lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c", "cylinder.c"] 
    156156have_Fq = True 
    157 effective_radius_type = [ 
     157radius_effective_modes = [ 
    158158    "excluded volume", "equivalent volume sphere", "radius", 
    159159    "half length", "half min dimension", "half max dimension", "half diagonal", 
  • 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

    r0507e09 ra34b811  
    167167source = ["lib/sas_3j1x_x.c", "lib/gauss76.c", "ellipsoid.c"] 
    168168have_Fq = True 
    169 effective_radius_type = [ 
     169radius_effective_modes = [ 
    170170    "average curvature", "equivalent volume sphere", "min radius", "max radius", 
    171171    ] 
  • 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

    r0507e09 ra34b811  
    131131source = ["lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c", "elliptical_cylinder.c"] 
    132132have_Fq = True 
    133 effective_radius_type = [ 
     133radius_effective_modes = [ 
    134134    "equivalent cylinder excluded volume", 
    135135    "equivalent volume sphere", "average radius", "min radius", "max radius", 
  • 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

    r0507e09 ra34b811  
    6363---------------------------- 
    6464 
    65 * **Author:**  
    66 * **Last Modified by:**  
    67 * **Last Reviewed by:**  
     65* **Author:** 
     66* **Last Modified by:** 
     67* **Last Reviewed by:** 
    6868* **Source added by :** Steve King **Date:** March 25, 2019 
    6969""" 
     
    9898source = ["lib/sas_3j1x_x.c", "fuzzy_sphere.c"] 
    9999have_Fq = True 
    100 effective_radius_type = ["radius", "radius + fuzziness"] 
     100radius_effective_modes = ["radius", "radius + fuzziness"] 
    101101 
    102102def 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

    r0507e09 ra34b811  
    110110source = ["lib/polevl.c", "lib/sas_J1.c", "lib/gauss76.c", "hollow_cylinder.c"] 
    111111have_Fq = True 
    112 effective_radius_type = [ 
     112radius_effective_modes = [ 
    113113    "excluded volume", "equivalent outer volume sphere", 
    114114    "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

    r0507e09 ra34b811  
    157157source = ["lib/gauss76.c", "hollow_rectangular_prism.c"] 
    158158have_Fq = True 
    159 effective_radius_type = [ 
     159radius_effective_modes = [ 
    160160    "equivalent cylinder excluded volume", "equivalent outer volume sphere", 
    161161    "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

    r0507e09 ra34b811  
    117117source = ["lib/gauss76.c", "hollow_rectangular_prism_thin_walls.c"] 
    118118have_Fq = True 
    119 effective_radius_type = [ 
     119radius_effective_modes = [ 
    120120    "equivalent cylinder excluded volume", "equivalent outer volume sphere", 
    121121    "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

    r0507e09 ra34b811  
    5959---------------------------- 
    6060 
    61 * **Author:**  
    62 * **Last Modified by:**  
    63 * **Last Reviewed by:**  
     61* **Author:** 
     62* **Last Modified by:** 
     63* **Last Reviewed by:** 
    6464* **Source added by :** Steve King **Date:** March 25, 2019""" 
    6565 
     
    8686source = ["mono_gauss_coil.c"] 
    8787have_Fq = False 
    88 effective_radius_type = ["R_g", "2R_g", "3R_g", "sqrt(5/3)*R_g"] 
     88radius_effective_modes = ["R_g", "2R_g", "3R_g", "sqrt(5/3)*R_g"] 
    8989 
    9090 
  • 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

    r0507e09 ra34b811  
    154154source = ["lib/sas_3j1x_x.c", "multilayer_vesicle.c"] 
    155155have_Fq = True 
    156 effective_radius_type = ["outer radius"] 
     156radius_effective_modes = ["outer radius"] 
    157157 
    158158def 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

    r0507e09 ra34b811  
    182182---------------------------- 
    183183 
    184 * **Author:**  
    185 * **Last Modified by:**  
    186 * **Last Reviewed by:**  
     184* **Author:** 
     185* **Last Modified by:** 
     186* **Last Reviewed by:** 
    187187* **Source added by :** Steve King **Date:** March 25, 2019 
    188188""" 
     
    329329single = False 
    330330have_Fq = True 
    331 effective_radius_type = ["outer radius"] 
     331radius_effective_modes = ["outer radius"] 
    332332 
    333333profile_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

    r0507e09 ra34b811  
    240240source = ["lib/gauss76.c", "parallelepiped.c"] 
    241241have_Fq = True 
    242 effective_radius_type = [ 
     242radius_effective_modes = [ 
    243243    "equivalent cylinder excluded volume", "equivalent volume sphere", 
    244244    "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

    r0507e09 ra34b811  
    6565---------------------------- 
    6666 
    67 * **Author:**  
    68 * **Last Modified by:**  
    69 * **Last Reviewed by:**  
     67* **Author:** 
     68* **Last Modified by:** 
     69* **Last Reviewed by:** 
    7070* **Source added by :** Steve King **Date:** March 25, 2019 
    7171""" 
     
    111111source = ["lib/sas_Si.c", "lib/sas_3j1x_x.c", "pearl_necklace.c"] 
    112112single = False  # use double precision unless told otherwise 
    113 effective_radius_type = ["equivalent volume sphere"] 
     113radius_effective_modes = ["equivalent volume sphere"] 
    114114 
    115115def random(): 
  • sasmodels/models/poly_gauss_coil.py

    r0507e09 ra34b811  
    5858---------------------------- 
    5959 
    60 * **Author:**  
    61 * **Last Modified by:**  
    62 * **Last Reviewed by:**  
     60* **Author:** 
     61* **Last Modified by:** 
     62* **Last Reviewed by:** 
    6363* **Source added by :** Steve King **Date:** March 25, 2019 
    6464""" 
  • 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

    r0507e09 ra34b811  
    8585source = ["lib/polevl.c", "lib/sas_J0.c", "lib/sas_J1.c", 
    8686          "lib/sas_JN.c", "lib/gauss76.c", "pringle.c"] 
    87 effective_radius_type = [ 
     87radius_effective_modes = [ 
    8888    "equivalent cylinder excluded volume", 
    8989    "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

    r0507e09 ra34b811  
    161161 
    162162source = ["lib/sas_3j1x_x.c", "raspberry.c"] 
    163 effective_radius_type = ["radius_large", "radius_outer"] 
     163radius_effective_modes = ["radius_large", "radius_outer"] 
    164164 
    165165def 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

    r0507e09 ra34b811  
    110110---------------------------- 
    111111 
    112 * **Author:**  
    113 * **Last Modified by:**  
    114 * **Last Reviewed by:**  
     112* **Author:** 
     113* **Last Modified by:** 
     114* **Last Reviewed by:** 
    115115* **Source added by :** Steve King **Date:** March 25, 2019 
    116116""" 
     
    151151source = ["lib/gauss76.c", "rectangular_prism.c"] 
    152152have_Fq = True 
    153 effective_radius_type = [ 
     153radius_effective_modes = [ 
    154154    "equivalent cylinder excluded volume", "equivalent volume sphere", 
    155155    "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

    r6140894 ra34b811  
    8181source = ["lib/sas_3j1x_x.c", "sphere.c"] 
    8282have_Fq = True 
    83 effective_radius_type = ["radius"] 
     83radius_effective_modes = ["radius"] 
    8484 
    8585def random(): 
     
    9999      0.2, 792.0646662454202, 1166737.0473152, 120.0, 7246723.820358589, 1.0], # the longer list here checks  F1, F2, R_eff, volume, volume_ratio = call_Fq(kernel, pars) 
    100100   #  But note P(Q) = F2/volume 
    101    #  F and F^2 are "unscaled", with for  n <F F*>S(q) or for beta approx I(q) = n [<F F*> + <F><F*> (S(q) - 1)]  
    102    #  for n the number density and <.> the orientation average, and F = integral rho(r) exp(i q . r) dr.   
    103    #  The number density is volume fraction divided by particle volume.   
     101   #  F and F^2 are "unscaled", with for  n <F F*>S(q) or for beta approx I(q) = n [<F F*> + <F><F*> (S(q) - 1)] 
     102   #  for n the number density and <.> the orientation average, and F = integral rho(r) exp(i q . r) dr. 
     103   #  The number density is volume fraction divided by particle volume. 
    104104   #  Effectively, this leaves F = V drho form, where form is the usual 3 j1(qr)/(qr) or whatever depending on the shape. 
    105105   # [{"@S": "hardsphere"}, 
     
    124124     "structure_factor_mode": 1,  # 0 = normal decoupling approximation, 1 = beta(Q) approx 
    125125     "radius_effective_mode": 0   # this used r_eff =0 or default 50? 
    126      }, 0.01, 1324.7375636587356 ],    
     126     }, 0.01, 1324.7375636587356 ], 
    127127    [{"@S": "hardsphere", 
    128128     "radius": 120., "radius_pd": 0.2, "radius_pd_n":45, 
     
    131131     "structure_factor_mode": 1,  # 0 = normal decoupling approximation, 1 = beta(Q) approx 
    132132     "radius_effective_mode": 1   # this used 120 ??? 
    133      }, 0.01, 1579.2858949296565 ]    
     133     }, 0.01, 1579.2858949296565 ] 
    134134] 
    135135# putting None for expected result will pass the test if there are no errors from the routine, but without any check on the value of the result 
  • 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

    r0507e09 ra34b811  
    232232single = False  # TODO: fix low q behaviour 
    233233have_Fq = True 
    234 effective_radius_type = ["outer radius"] 
     234radius_effective_modes = ["outer radius"] 
    235235 
    236236profile_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

    r0507e09 ra34b811  
    164164source = ["lib/sas_3j1x_x.c", "lib/gauss76.c", "triaxial_ellipsoid.c"] 
    165165have_Fq = True 
    166 effective_radius_type = [ 
     166radius_effective_modes = [ 
    167167    "equivalent biaxial ellipsoid average curvature", 
    168168    "equivalent volume sphere", "min radius", "max radius", 
  • 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

    r0507e09 ra34b811  
    107107source = ["lib/sas_3j1x_x.c", "vesicle.c"] 
    108108have_Fq = True 
    109 effective_radius_type = ["outer radius"] 
     109radius_effective_modes = ["outer radius"] 
    110110 
    111111def random(): 
  • sasmodels/product.py

    rd8e81f7 ra34b811  
    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 # NOTE there are radius_effective_mode, effective_radius_type, but only structure_factor_mode 
    3939STRUCTURE_MODE_ID = "structure_factor_mode" 
    4040RADIUS_MODE_ID = "radius_effective_mode" 
     
    4444    # type: (ModelInfo) -> List[Parameter] 
    4545    """ 
    46     Create parameters for structure_factor_type and radius_effective_type. 
     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    ): 
     
    193193            ("beta(Q)", F1**2 / F2), 
    194194            ("S_eff(Q)", 1 + (F1**2 / F2)*(S-1)), 
    195             ("effective_radius", effective_radius), 
     195            ("effective_radius", radius_effective), 
    196196            # ("I(Q)", scale*(F2 + (F1**2)*(S-1)) + bg), 
    197197        )) 
     
    200200            ("P(Q)", scale*F2), 
    201201            ("S(Q)", S), 
    202             ("effective_radius", effective_radius), 
     202            ("effective_radius", radius_effective), 
    203203        )) 
    204204    return parts 
     
    281281        # R_eff type parameter is the second parameter after P and S parameters 
    282282        # 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 
     283        have_radius_type = p_info.radius_effective_modes is not None 
    284284        #print(p_npars,s_npars) 
    285285        radius_type_offset = 2+p_npars+s_npars + (1 if have_beta_mode else 0) 
     
    333333        # Call the form factor kernel to compute <F> and <F^2>. 
    334334        # If the model doesn't support Fq the returned <F> will be None. 
    335         F1, F2, effective_radius, shell_volume, volume_ratio = self.p_kernel.Fq( 
     335        F1, F2, radius_effective, shell_volume, volume_ratio = self.p_kernel.Fq( 
    336336            p_details, p_values, cutoff, magnetic, radius_type) 
    337337 
     
    343343        # implementation details in kernel_iq.c. 
    344344        print("R_eff=%d:%g, volfrac=%g, volume ratio=%g" 
    345               % (radius_type, effective_radius, volfrac, volume_ratio)) 
     345              % (radius_type, radius_effective, volfrac, volume_ratio)) 
    346346        if radius_type > 0: 
    347347            # set the value to the model R_eff and set the weight to 1 
    348             s_values[2] = s_values[2+s_npars+s_offset[0]] = effective_radius 
     348            s_values[2] = s_values[2+s_npars+s_offset[0]] = radius_effective 
    349349            s_values[2+s_npars+s_offset[0]+nweights] = 1.0 
    350350        s_values[3] = s_values[2+s_npars+s_offset[1]] = volfrac*volume_ratio 
     
    372372        # the results directly rather than through a lazy evaluator. 
    373373        self.results = lambda: _intermediates( 
    374             F1, F2, S, combined_scale, effective_radius, beta_mode) 
     374            F1, F2, S, combined_scale, radius_effective, beta_mode) 
    375375 
    376376        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 
Note: See TracChangeset for help on using the changeset viewer.