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 98b12205 was
499fe7a,
checked in by Mathieu Doucet <doucetm@…>, 13 years ago
|
Fixing code style problems
|
-
Property mode set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | """ |
---|
2 | Provide F(x) = scale* (|x|)^(-m) + bkd |
---|
3 | Power law function as a BaseComponent model |
---|
4 | """ |
---|
5 | from sans.models.PowerLawModel import PowerLawModel |
---|
6 | import math |
---|
7 | |
---|
8 | class 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 | m = power |
---|
16 | scale = scale factor |
---|
17 | bkd = incoherent background |
---|
18 | """ |
---|
19 | |
---|
20 | def __init__(self): |
---|
21 | """ Initialization """ |
---|
22 | # Initialize PowerLawAbsModel |
---|
23 | PowerLawModel.__init__(self) |
---|
24 | ## Name of the model |
---|
25 | self.name = "Absolute Power_Law" |
---|
26 | self.description = """ The Power_Law model. |
---|
27 | F(x) = scale* (|x|)^(-m) + bkd |
---|
28 | |
---|
29 | The model has three parameters: |
---|
30 | m = power |
---|
31 | scale = scale factor |
---|
32 | bkd = incoherent background""" |
---|
33 | |
---|
34 | |
---|
35 | def _PowerLaw(self, x): |
---|
36 | return PowerLawModel._PowerLaw(self, math.fabs(x)) |
---|
37 | |
---|
Note: See
TracBrowser
for help on using the repository browser.