Ignore:
Timestamp:
Jul 10, 2016 9:40:42 PM (8 years ago)
Author:
butler
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
Message:

close #590. A lot of problems were caused by LineModel? and LinerFit?
having different equations (ax+b vs a+bx). Further errors in
calculations, particularly of uncertainties were fixed. The fact that
the fits to not account for smearing was verified and a warning added.
Code was also modified to update the qmin and qmax to match changes in
the transformed xmin xmax. Lots of documentation was added and the
fitdialog layout was cleaned up considerably. This is now usable though
the design of the user interface (and the whole design of linear fits)
could use a rethink.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/plottools/LineModel.py

    rd7bb526 rdd5bf63  
    11#!/usr/bin/env python 
    22""" 
    3 Provide Line function (y= A + Bx) 
     3Provide 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  
     5assumed (y= mx+b) or in this nomenclature (y=Ax + B). This lead to some 
     6contortions in the code and worse incorrect calculations until now for at least 
     7some of the functions.  This seemed the easiest to fix particularly since this 
     8function should disappear in a future iteration (see notes in fitDialog) 
     9 
     10                -PDB   July 10, 2016 
    411""" 
    512 
     
    1017    Class that evaluates a linear model. 
    1118 
    12     f(x) = A + Bx 
     19    f(x) = Ax + B 
    1320 
    1421    List of default parameters: 
    15     A = 0.0 
    16     B = 0.0 
     22    A = 1.0 
     23    B = 1.0 
    1724    """ 
    1825 
     
    5360 
    5461        """ 
    55         return  self.params['A'] + (x * self.params['B']) 
     62        return  (self.params['A'] * x) + self.params['B'] 
    5663 
    5764    def run(self, x=0.0): 
    5865        """ 
    5966        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  
    6073 
    6174        :param x: simple value 
     
    7487    def runXY(self, x=0.0): 
    7588        """ 
    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  
    7795 
    7896        :param x: simple value 
Note: See TracChangeset for help on using the changeset viewer.