Changeset 51f14603 in sasview for src/sans/models


Ignore:
Timestamp:
Apr 3, 2014 11:37:53 AM (10 years ago)
Author:
Peter Parker
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
2f2d9d0
Parents:
eea3ffa
Message:

Refs #202 - Fix Sphinx build errors (not including park-1.2.1/). Most warnings remain.

Location:
src/sans/models
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • src/sans/models/BaseComponent.py

    r5777106 r51f14603  
    9696        Evaluate a distribution of q-values. 
    9797         
    98         * For 1D, a numpy array is expected as input: 
     98        * For 1D, a numpy array is expected as input: :: 
    9999         
    100100            evalDistribution(q) 
    101101             
     102          where q is a numpy array. 
     103         
     104         
     105        * For 2D, a list of numpy arrays are expected: [qx_prime,qy_prime], 
     106          where 1D arrays, :: 
     107         
     108              qx_prime = [ qx[0], qx[1], qx[2], ....] 
     109 
     110          and :: 
     111 
     112              qy_prime = [ qy[0], qy[1], qy[2], ....]  
     113         
     114        Then get :: 
     115 
     116            q = numpy.sqrt(qx_prime^2+qy_prime^2) 
     117         
     118        that is a qr in 1D array; :: 
     119 
     120            q = [q[0], q[1], q[2], ....]  
     121         
     122        ..note:: 
     123          Due to 2D speed issue, no anisotropic scattering  
     124          is supported for python models, thus C-models should have 
     125          their own evalDistribution methods. 
     126         
     127        The method is then called the following way: :: 
     128         
     129            evalDistribution(q) 
     130 
    102131        where q is a numpy array. 
    103132         
    104          
    105         * For 2D, a list of numpy arrays are expected: [qx_prime,qy_prime], 
    106           where 1D arrays, 
    107          
    108         qx_prime = [ qx[0], qx[1], qx[2], ....] 
    109         and 
    110         qy_prime = [ qy[0], qy[1], qy[2], ....]  
    111          
    112         Then get 
    113         q = numpy.sqrt(qx_prime^2+qy_prime^2) 
    114          
    115         that is a qr in 1D array; 
    116         q = [q[0], q[1], q[2], ....]  
    117          
    118         :Note: Due to 2D speed issue, no anisotropic scattering  
    119             is supported for python models, thus C-models should have 
    120              their own evalDistribution methods. 
    121          
    122         The method is then called the following way: 
    123          
    124         evalDistribution(q) 
    125         where q is a numpy array. 
    126          
    127         :param qdist: ndarray of scalar q-values or list [qx,qy]  
    128                     where qx,qy are 1D ndarrays  
    129          
     133        :param qdist: ndarray of scalar q-values or list [qx,qy] where qx,qy are 1D ndarrays 
    130134        """ 
    131135        if qdist.__class__.__name__ == 'list': 
  • src/sans/models/Constant.py

    r5777106 r51f14603  
    77 
    88class Constant(BaseComponent): 
    9     """ Class that evaluates a constant model.  
    10         List of default parameters: 
    11          value           = 1.0  
     9    """ 
     10    Class that evaluates a constant model.  
     11    List of default parameters: 
     12     
     13    * value           = 1.0  
    1214    """ 
    1315         
  • src/sans/models/PolymerExclVolume.py

    r5777106 r51f14603  
    2525    Refer to that file and the structure it contains 
    2626    for details of the model. 
     27 
    2728    List of default parameters: 
    28          scale           = 0.01  
    29          rg              = 100.0 [A] 
    30          m               = 3.0  
    31          background      = 0.0 [1/cm] 
     29     
     30    * scale           = 0.01  
     31    * rg              = 100.0 [A] 
     32    * m               = 3.0  
     33    * background      = 0.0 [1/cm] 
    3234 
    3335    """ 
  • src/sans/models/PowerLawAbsModel.py

    r5777106 r51f14603  
    11"""  
    2     Provide F(x) = scale* (|x|)^(-m) + bkd 
     2    Provide F(x) = scale* (\|x\|)^(-m) + bkd 
    33    Power law function as a BaseComponent model 
    44""" 
     
    88class PowerLawAbsModel(PowerLawModel): 
    99    """ 
    10         Class that evaluates a absolute Power_Law model. 
    11          
     10    Class that evaluates a absolute Power_Law model. :: 
     11     
    1212        F(x) = scale* (|x|)^(-m) + bkd 
    13          
    14         The model has three parameters:  
    15             m     =  power 
    16             scale  =  scale factor 
    17             bkd    =  incoherent background 
     13     
     14    The model has three parameters: 
     15 
     16    * m     =  power 
     17    * scale  =  scale factor 
     18    * bkd    =  incoherent background 
    1819    """ 
    1920     
  • src/sans/models/TwoPowerLawModel.py

    r5777106 r51f14603  
    1717        =C*pow(qval,-1.0*power2) for q>qc 
    1818    where C=coef_A*pow(qc,-1.0*power1)/pow(qc,-1.0*power2). 
     19     
    1920    List of default parameters: 
    20      coef_A = coefficient 
    21      power1 = (-) Power @ low Q 
    22      power2 = (-) Power @ high Q 
    23      qc = crossover Q-value 
    24      background = incoherent background 
     21     
     22    * coef_A = coefficient 
     23    * power1 = (-) Power @ low Q 
     24    * power2 = (-) Power @ high Q 
     25    * qc = crossover Q-value 
     26    * background = incoherent background 
    2527    """ 
    2628         
  • src/sans/models/c_extension/python_wrapper/WrapperGenerator.py

    r230f479 r51f14603  
    126126        buf = f.read() 
    127127         
    128         self.default_list = "List of default parameters:\n" 
     128        self.default_list = "\n    List of default parameters:\n\n" 
    129129        #lines = string.split(buf,'\n') 
    130130        lines = buf.split('\n') 
     
    293293                    if len(toks2) >= 2: 
    294294                        units = toks2[1] 
    295                     self.default_list += "        %-15s = %s %s\n" % \ 
     295                    self.default_list += "    * %-15s = %s %s\n" % \ 
    296296                        (toks[1], val, units) 
    297297                     
  • src/sans/models/c_extension/python_wrapper/modelTemplate.txt

    r230f479 r51f14603  
    1616Provide functionality for a C extension model 
    1717 
    18 :WARNING: THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 
    19          DO NOT MODIFY THIS FILE, MODIFY 
    20             [INCLUDE_FILE] 
    21          AND RE-RUN THE GENERATOR SCRIPT 
     18.. WARNING:: 
     19 
     20   THIS FILE WAS GENERATED BY WRAPPERGENERATOR.PY 
     21   DO NOT MODIFY THIS FILE, MODIFY 
     22   [INCLUDE_FILE] 
     23   AND RE-RUN THE GENERATOR SCRIPT 
    2224""" 
    2325 
  • src/sans/models/qsmearing.py

    r5777106 r51f14603  
    500500    Make fake data_x points extrapolated outside of the data_x points 
    501501     
    502     : param width: array of std of q resolution 
    503     : param Data1D.x: Data1D.x array 
    504      
    505     : return new_width, data_x_ext: extrapolated width array and x array 
    506      
    507     : assumption1: data_x is ordered from lower q to higher q 
    508     : assumption2: len(data) = len(width) 
    509     : assumption3: the distance between the data points is more compact  
    510             than the size of width  
    511     : Todo1: Make sure that the assumptions are correct for Data1D 
    512     : Todo2: This fixes the edge problem in Qsmearer but still needs to make  
    513             smearer interface  
     502    :param width: array of std of q resolution 
     503    :param Data1D.x: Data1D.x array 
     504     
     505    :return new_width, data_x_ext: extrapolated width array and x array 
     506     
     507    :assumption1: data_x is ordered from lower q to higher q 
     508    :assumption2: len(data) = len(width) 
     509    :assumption3: the distance between the data points is more compact than the size of width  
     510    :Todo1: Make sure that the assumptions are correct for Data1D 
     511    :Todo2: This fixes the edge problem in Qsmearer but still needs to make smearer interface  
    514512    """ 
    515513    # Length of the width 
Note: See TracChangeset for help on using the changeset viewer.