Changeset a8088d7 in sasview for sansview/perspectives/fitting
- Timestamp:
- Apr 16, 2009 2:24:36 PM (16 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:
- 7c427a6
- Parents:
- 54c21f50
- Location:
- sansview/perspectives/fitting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sansview/perspectives/fitting/fitpage.py
r3370922 ra8088d7 644 644 from sans.guiframe.utils import check_value 645 645 flag = check_value( self.qmin, self.qmax) 646 err_image = self.data.err_data 646 647 err_image = copy.deepcopy(self.data.err_data) 647 648 if err_image==[] or err_image==None: 648 649 err_image= numpy.zeros(len(self.data.x_bins),len(self.data.y_bins)) 649 650 650 651 err_image[err_image==0]=1 652 651 653 res=[] 652 654 if flag== True: … … 700 702 dy= numpy.zeros(len(y)) 701 703 else: 702 dy= numpy.asarray(self.data.dy) 704 dy= copy.deepcopy(self.data.dy) 705 dy= numpy.asarray(dy) 703 706 dy[dy==0]=1 704 707 705 708 if self.qmin_x==None and self.qmax_x==None: 706 709 fx =numpy.asarray([self.model.run(v) for v in x]) … … 723 726 self.tcChi.SetLabel(format_number(math.fabs(sum/ len(res)))) 724 727 except: 725 raise 726 #wx.PostEvent(self.parent.GrandParent, StatusEvent(status=\ 727 # "Chisqr cannot be compute: %s"% sys.exc_value)) 728 #return 728 wx.PostEvent(self.parent.GrandParent, StatusEvent(status=\ 729 "Chisqr cannot be compute: %s"% sys.exc_value)) 730 return 729 731 730 732 -
sansview/perspectives/fitting/fitting.py
r3370922 ra8088d7 1 import re 1 import re,copy 2 2 import sys, wx, logging 3 3 import string, numpy, math … … 239 239 dxw=None 240 240 if hasattr(item, "dxl"): 241 dxl = item.dxl241 dxl = copy.deepcopy(item.dxl) 242 242 if hasattr(item, "dxw"): 243 dxw = item.dxw243 dxw = copy.deepcopy(item.dxw) 244 244 if hasattr(item, "detector"): 245 detector = item.detector245 detector = copy.deepcopy(item.detector) 246 246 if hasattr(item, "source"): 247 source = item.source247 source = copy.deepcopy(item.source) 248 248 if hasattr(item ,"info"): 249 info= item.info249 info= copy.deepcopy(item.info) 250 250 if hasattr(item,"id"): 251 id = item.id 251 id = copy.deepcopy(item.id) 252 252 253 from sans.guiframe import dataFitting 253 254 if item.__class__.__name__=="Data1D": … … 259 260 data.source = source 260 261 ## allow to highlight data when plotted 261 data.interactive = item.interactive262 data.interactive = copy.deepcopy(item.interactive) 262 263 ## when 2 data have the same id override the 1 st plotted 263 264 data.id = id … … 266 267 data.info= info 267 268 ## If the data file does not tell us what the axes are, just assume... 268 data.xaxis( item._xaxis,item._xunit)269 data.yaxis( item._yaxis,item._yunit)269 data.xaxis(copy.deepcopy(item._xaxis),copy.deepcopy(item._xunit)) 270 data.yaxis(copy.deepcopy(item._yaxis),copy.deepcopy(item._yunit)) 270 271 ##group_id specify on which panel to plot this data 271 data.group_id = item.group_id272 data.group_id = copy.deepcopy(item.group_id) 272 273 return data 273 274 … … 559 560 self.panel = event.GetEventObject() 560 561 for item in self.panel.graph.plottables: 562 561 563 if item.name == self.panel.graph.selected_plottable: 562 564 ## put the errors values back to the model if the errors were hiden … … 567 569 data= self.copy_data(item, dy) 568 570 else: 569 data= item571 data= copy.deepcopy(item) 570 572 else: 571 573 if item.dy==None: 572 574 dy= numpy.zeros(len(item.y)) 573 dy[dy==0]=1574 575 data= self.copy_data(item, dy) 575 576 else: 576 data= item577 data= copy.deepcopy(item) 577 578 else: 578 data= item579 data= copy.deepcopy(item) 579 580 ## create anew page 580 581 if item.name == self.panel.graph.selected_plottable or\ … … 962 963 963 964 err_image = numpy.zeros(numpy.shape(image)) 964 err_image[err_image==0]= 1965 965 966 theory= Data2D(image= image , err_image= err_image) 966 967 theory.name= model.name … … 982 983 theory.xmin= data.xmin 983 984 theory.xmax= data.xmax 984 985 985 986 ## plot 986 987 wx.PostEvent(self.parent, NewPlotEvent(plot=theory,
Note: See TracChangeset
for help on using the changeset viewer.