source: sasview/src/sas/models/PowerLawAbsModel.py @ c9c718a

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalccostrafo411magnetic_scattrelease-4.1.1release-4.1.2release-4.2.2release_4.0.1ticket-1009ticket-1094-headlessticket-1242-2d-resolutionticket-1243ticket-1249ticket885unittest-saveload
Last change on this file since c9c718a was 79492222, checked in by krzywon, 10 years ago

Changed the file and folder names to remove all SANS references.

  • Property mode set to 100644
File size: 1007 bytes
Line 
1"""
2    Provide F(x) = scale* (\|x\|)^(-m) + bkd
3    Power law function as a BaseComponent model
4"""
5from sas.models.PowerLawModel import PowerLawModel
6import math
7
8class PowerLawAbsModel(PowerLawModel):
9    """
10    Class that evaluates a absolute Power_Law model. ::
11   
12        F(x) = scale* (|x|)^(-m) + bkd
13   
14    The model has three parameters:
15
16    * m     =  power
17    * scale  =  scale factor
18    * bkd    =  incoherent background
19    """
20   
21    def __init__(self):
22        """ Initialization """
23        # Initialize PowerLawAbsModel
24        PowerLawModel.__init__(self)
25        ## Name of the model
26        self.name = "Absolute Power_Law"
27        self.description = """ The Power_Law model.
28        F(x) = scale* (|x|)^(-m) + bkd
29       
30        The model has three parameters:
31        m     =  power
32        scale  =  scale factor
33        bkd    =  incoherent background"""
34       
35       
36    def _PowerLaw(self, x):
37        return PowerLawModel._PowerLaw(self, math.fabs(x))
38       
Note: See TracBrowser for help on using the repository browser.