Ignore:
Timestamp:
May 18, 2017 5:36:57 AM (8 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
Branches:
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
Children:
6066a3f
Parents:
2a432e7
Message:

Removed qtgui dependency on sasgui and wx SASVIEW-590

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py

    r1bc27f1 rdc5ef15  
    66import numpy 
    77 
    8 from sas.sasgui.guiframe.dataFitting import Data1D 
    9 from sas.sasgui.guiframe.dataFitting import Data2D 
     8from sas.qtgui.Plotting.PlotterData import Data1D 
     9from sas.qtgui.Plotting.PlotterData import Data2D 
    1010 
    1111def replaceShellName(param_name, value): 
     
    363363    return [i >> d & 1 for d in xrange(digits)] 
    364364 
     365def getWeight(data, is2d, flag=None): 
     366    """ 
     367    Received flag and compute error on data. 
     368    :param flag: flag to transform error of data. 
     369    """ 
     370    weight = None 
     371    if is2d: 
     372        dy_data = data.err_data 
     373        data = data.data 
     374    else: 
     375        dy_data = data.dy 
     376        data = data.y 
     377 
     378    if flag == 0: 
     379        weight = numpy.ones_like(data) 
     380    elif flag == 1: 
     381        weight = dy_data 
     382    elif flag == 2: 
     383        weight = numpy.sqrt(numpy.abs(data)) 
     384    elif flag == 3: 
     385        weight = numpy.abs(data) 
     386    return weight 
Note: See TracChangeset for help on using the changeset viewer.