Changeset 8d27cac in sasview


Ignore:
Timestamp:
Jan 3, 2012 10:15:48 AM (12 years ago)
Author:
Jae Cho <jhjcho@…>
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:
e38e335
Parents:
c668b1b
Message:

added more scales related to y*x4

Location:
plottools/src/danse/common/plottools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • plottools/src/danse/common/plottools/PlotPanel.py

    r2365c0b r8d27cac  
    16111611                _xscale = 'log' 
    16121612                self.graph._xaxis_transformed("%s" % xname, "%s" % xunits) 
     1613            if(self.xLabel == "log10(x^(4))"): 
     1614                item.transformX(transform.toX4, transform.errToX4) 
     1615                xunits = convertUnit(4,xunits)  
     1616                self.graph._xaxis_transformed("%s^{4}" % xname, "%s" % xunits) 
     1617                _xscale = 'log' 
    16131618            if(self.yLabel == "ln(y)"): 
    16141619                item.transformY(transform.toLogX, transform.errToLogX) 
     
    16291634                yunits = convertUnit(-1, yunits) 
    16301635                self.graph._yaxis_transformed("1/%s" % yname, "%s" % yunits) 
     1636            if(self.yLabel == "y*x^(4)"): 
     1637                item.transformY(transform.toYX4, transform.errToYX4) 
     1638                xunits = convertUnit(4, xunits)  
     1639                self.graph._yaxis_transformed("%s \ \ %s^{4}" % (yname,xname),  
     1640                                               "%s%s" % (yunits,xunits)) 
    16311641            if(self.yLabel == "1/sqrt(y)"): 
    16321642                item.transformY(transform.toOneOverSqrtX, 
     
    16471657                xunits = convertUnit(4, xunits)  
    16481658                self.graph._yaxis_transformed("\ln (%s \ \ %s^{4})" % (yname,xname),  
     1659                                               "%s%s" % (yunits,xunits)) 
     1660            if(self.yLabel == "log10(y*x^(4))"): 
     1661                item.transformY(transform.toYX4, transform.errToYX4) 
     1662                xunits = convertUnit(4, xunits)  
     1663                _yscale = 'log'  
     1664                self.graph._yaxis_transformed("%s \ \ %s^{4}" % (yname,xname),  
    16491665                                               "%s%s" % (yunits,xunits)) 
    16501666            if(self.viewModel == "Guinier lny vs x^(2)"): 
  • plottools/src/danse/common/plottools/PropertyDialog.py

    r2365c0b r8d27cac  
    6262        self.xvalue.Insert("ln(x)", 3) 
    6363        self.xvalue.Insert("log10(x)", 4) 
     64        self.xvalue.Insert("log10(x^(4))", 5) 
    6465         
    6566        # scale value for y 
     
    6970        self.yvalue.Insert("ln(y)", 2) 
    7071        self.yvalue.Insert("y^(2)", 3) 
    71         self.yvalue.Insert("1/sqrt(y)", 4) 
    72         self.yvalue.Insert("log10(y)", 5) 
    73         self.yvalue.Insert("ln(y*x)", 6) 
    74         self.yvalue.Insert("ln(y*x^(2))", 7) 
    75         self.yvalue.Insert("ln(y*x^(4))", 8) 
     72        self.yvalue.Insert("y*x^(4)", 4) 
     73        self.yvalue.Insert("1/sqrt(y)", 5) 
     74        self.yvalue.Insert("log10(y)", 6) 
     75        self.yvalue.Insert("ln(y*x)", 7) 
     76        self.yvalue.Insert("ln(y*x^(2))", 8) 
     77        self.yvalue.Insert("ln(y*x^(4))", 9) 
     78        self.yvalue.Insert("log10(y*x^(4))", 10) 
    7679        # type of view or model used  
    7780        self.view.SetValue("--") 
  • plottools/src/danse/common/plottools/transform.py

    r2365c0b r8d27cac  
    118118    else: 
    119119         raise ValueError,"transform.toLogYX4: input error" 
     120      
     121def toYX4(y, x): 
     122    """ 
     123    """ 
     124    return math.pow(x, 4) * y 
    120125 
    121126def toLogXY(y, x): 
     
    360365    return err  
    361366 
     367def errToYX4(x, y=None, dx=None, dy=None): 
     368    """ 
     369    error for (y*x^(4)) 
     370     
     371    :param x: float value 
     372     
     373    """ 
     374    # Check that the point on the graph is positive 
     375    # within errors 
     376 
     377    if dx == None: 
     378        dx = 0 
     379    if dy == None: 
     380        dy = 0 
     381    err = math.sqrt((dy * pow(x, 4))**2  + (4 * y * dx * math.pow(x, 3))**2) 
     382    return err  
    362383            
Note: See TracChangeset for help on using the changeset viewer.