Changeset 841753c in sasmodels for sasmodels/models/power_law.py


Ignore:
Timestamp:
Jan 28, 2016 5:42:34 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
d4666ca
Parents:
69ec80f
Message:

delint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/power_law.py

    reb69cce r841753c  
    1212    I(q) = \text{scale} \cdot q^{-\text{power}} + \text{background} 
    1313 
    14 Note the minus sign in front of the exponent. The exponent *power*  
     14Note the minus sign in front of the exponent. The exponent *power* 
    1515should therefore be entered as a **positive** number for fitting. 
    1616 
    17 Also note that unlike many other models, *scale* in this model  
    18 is NOT explicitly related to a volume fraction. Be careful if  
     17Also note that unlike many other models, *scale* in this model 
     18is NOT explicitly related to a volume fraction. Be careful if 
    1919combining this model with other models. 
    2020 
     
    3131from numpy import inf, sqrt 
    3232 
    33 name =  "power_law" 
     33name = "power_law" 
    3434title = "Simple power law with a flat background" 
    3535 
    36 description = """\ 
    37         Evaluates the function 
    38         I(q) = scale * q^(-power) + background 
    39         NB: enter power as a positive number! 
    40         """ 
     36description = """ 
     37    Evaluates the function 
     38    I(q) = scale * q^(-power) + background 
     39    NB: enter power as a positive number! 
     40    """ 
    4141category = "shape-independent" 
    4242 
     
    4545 
    4646# NB: Scale and Background are implicit parameters on every model 
    47 def Iq(q,power): 
     47def Iq(q, power): 
     48    # pylint: disable=missing-docstring 
    4849    inten = (q**-power) 
    4950    return inten 
     
    5152 
    5253def Iqxy(qx, qy, *args): 
     54    # pylint: disable=missing-docstring 
    5355    return Iq(sqrt(qx ** 2 + qy ** 2), *args) 
    5456Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values 
     
    6466 
    6567tests = [ 
    66         [ {'scale': 1.0, 'power': 4.0, 'background' : 0.0}, [0.0106939, 0.469418], [7.64644e+07, 20.5949]] 
    67         ] 
     68    [{'scale': 1.0, 'power': 4.0, 'background' : 0.0}, 
     69     [0.0106939, 0.469418], [7.64644e+07, 20.5949]], 
     70    ] 
Note: See TracChangeset for help on using the changeset viewer.