Changeset dd5bf63 in sasview for src/sas/sasgui/plottools/LineModel.py
- Timestamp:
- Jul 10, 2016 11:40:42 PM (8 years ago)
- 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:
- c23f303, 77d92cd, d398285
- Parents:
- 3409a90
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/plottools/LineModel.py
rd7bb526 rdd5bf63 1 1 #!/usr/bin/env python 2 2 """ 3 Provide Line function (y= A + Bx) 3 Provide Line function (y= Ax + B). Until July 10, 2016 this function provided 4 (y= A + Bx). This however was contrary to all the other code using it which 5 assumed (y= mx+b) or in this nomenclature (y=Ax + B). This lead to some 6 contortions in the code and worse incorrect calculations until now for at least 7 some of the functions. This seemed the easiest to fix particularly since this 8 function should disappear in a future iteration (see notes in fitDialog) 9 10 -PDB July 10, 2016 4 11 """ 5 12 … … 10 17 Class that evaluates a linear model. 11 18 12 f(x) = A + Bx19 f(x) = Ax + B 13 20 14 21 List of default parameters: 15 A = 0.016 B = 0.022 A = 1.0 23 B = 1.0 17 24 """ 18 25 … … 53 60 54 61 """ 55 return self.params['A'] + (x * self.params['B'])62 return (self.params['A'] * x) + self.params['B'] 56 63 57 64 def run(self, x=0.0): 58 65 """ 59 66 Evaluate the model 67 68 :note: This is the function called by fitDialog to calculate the 69 the y(xmin) and y(xmax), but the only difference between this and 70 runXY is when the if statement is true. I however cannot see what that 71 function is for. It needs to be documented here or removed. 72 -PDB 7/10/16 60 73 61 74 :param x: simple value … … 74 87 def runXY(self, x=0.0): 75 88 """ 76 Evaluate the model 89 Evaluate the model. 90 91 :note: This is to be what is called by fitDialog for the actual fit 92 but the only difference between this and run is when the if 93 statement is true. I however cannot see what that function 94 is for. It needs to be documented here or removed. -PDB 7/10/16 77 95 78 96 :param x: simple value
Note: See TracChangeset
for help on using the changeset viewer.