Changeset dc5ef15 in sasview for src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
- Timestamp:
- May 18, 2017 5:36:57 AM (8 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/FittingUtilities.py
r1bc27f1 rdc5ef15 6 6 import numpy 7 7 8 from sas. sasgui.guiframe.dataFittingimport Data1D9 from sas. sasgui.guiframe.dataFittingimport Data2D8 from sas.qtgui.Plotting.PlotterData import Data1D 9 from sas.qtgui.Plotting.PlotterData import Data2D 10 10 11 11 def replaceShellName(param_name, value): … … 363 363 return [i >> d & 1 for d in xrange(digits)] 364 364 365 def 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.