Changeset a807206 in sasmodels for sasmodels/models/guinier_porod.py


Ignore:
Timestamp:
Sep 30, 2016 10:42:06 PM (8 years ago)
Author:
butler
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
caddb14, 5031ca3
Parents:
2222134
Message:

updating more parameter names addressing #649

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/guinier_porod.py

    r40a87fa ra807206  
    7272description = """\ 
    7373         I(q) = scale/q^s* exp ( - R_g^2 q^2 / (3-s) ) for q<= ql 
    74          = scale/q^m*exp((-ql^2*Rg^2)/(3-s))*ql^(m-s) for q>=ql 
    75                         where ql = sqrt((m-s)(3-s)/2)/Rg. 
     74         = scale/q^porod_exp*exp((-ql^2*Rg^2)/(3-s))*ql^(porod_exp-s) for q>=ql 
     75                        where ql = sqrt((porod_exp-s)(3-s)/2)/Rg. 
    7676                        List of parameters: 
    7777                        scale = Guinier Scale 
    7878                        s = Dimension Variable 
    7979                        Rg = Radius of Gyration [A]  
    80                         m = Porod Exponent 
     80                        porod_exp = Porod Exponent 
    8181                        background  = Background [1/cm]""" 
    8282 
     
    8787parameters = [["rg", "Ang", 60.0, [0, inf], "", "Radius of gyration"], 
    8888              ["s",  "",    1.0,  [0, inf], "", "Dimension variable"], 
    89               ["m",  "",    3.0,  [0, inf], "", "Porod exponent"]] 
     89              ["porod_exp",  "",    3.0,  [0, inf], "", "Porod exponent"]] 
    9090# pylint: enable=bad-whitespace, line-too-long 
    9191 
    9292# pylint: disable=C0103 
    93 def Iq(q, rg, s, m): 
     93def Iq(q, rg, s, porod_exp): 
    9494    """ 
    9595    @param q: Input q-value 
    9696    """ 
    9797    n = 3.0 - s 
    98     ms = 0.5*(m-s) # =(n-3+m)/2 
     98    ms = 0.5*(porod_exp-s) # =(n-3+porod_exp)/2 
    9999 
    100100    # preallocate return value 
     
    109109    with errstate(divide='ignore'): 
    110110        iq[idx] = q[idx]**-s * exp(-(q[idx]*rg)**2/n) 
    111         iq[~idx] = q[~idx]**-m * (exp(-ms) * (n*ms/rg**2)**ms) 
     111        iq[~idx] = q[~idx]**-porod_exp * (exp(-ms) * (n*ms/rg**2)**ms) 
    112112    return iq 
    113113 
    114114Iq.vectorized = True # Iq accepts an array of q values 
    115115 
    116 demo = dict(scale=1.5, background=0.5, rg=60, s=1.0, m=3.0) 
     116demo = dict(scale=1.5, background=0.5, rg=60, s=1.0, porod_exp=3.0) 
    117117 
    118118tests = [[{'scale': 1.5, 'background':0.5}, 0.04, 5.290096890253155]] 
Note: See TracChangeset for help on using the changeset viewer.