Changeset a8088d7 in sasview for sansview


Ignore:
Timestamp:
Apr 16, 2009 2:24:36 PM (15 years ago)
Author:
Gervaise Alina <gervyh@…>
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
Message:

plotting all 1D data as Data1D

Location:
sansview/perspectives/fitting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/fitpage.py

    r3370922 ra8088d7  
    644644        from sans.guiframe.utils import check_value 
    645645        flag = check_value( self.qmin, self.qmax) 
    646         err_image = self.data.err_data 
     646         
     647        err_image = copy.deepcopy(self.data.err_data) 
    647648        if err_image==[] or err_image==None: 
    648649            err_image= numpy.zeros(len(self.data.x_bins),len(self.data.y_bins)) 
    649650                        
    650651        err_image[err_image==0]=1 
     652        
    651653        res=[] 
    652654        if flag== True: 
     
    700702                        dy= numpy.zeros(len(y)) 
    701703                    else: 
    702                         dy= numpy.asarray(self.data.dy) 
     704                        dy= copy.deepcopy(self.data.dy) 
     705                        dy= numpy.asarray(dy) 
    703706                    dy[dy==0]=1 
    704                      
     707                    
    705708                    if self.qmin_x==None and self.qmax_x==None:  
    706709                        fx =numpy.asarray([self.model.run(v) for v in x]) 
     
    723726                    self.tcChi.SetLabel(format_number(math.fabs(sum/ len(res)))) 
    724727            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  
    729731             
    730732     
  • sansview/perspectives/fitting/fitting.py

    r3370922 ra8088d7  
    1 import  re 
     1import  re,copy 
    22import sys, wx, logging 
    33import string, numpy, math 
     
    239239        dxw=None 
    240240        if hasattr(item, "dxl"): 
    241             dxl = item.dxl 
     241            dxl = copy.deepcopy(item.dxl) 
    242242        if hasattr(item, "dxw"): 
    243             dxw = item.dxw 
     243            dxw = copy.deepcopy(item.dxw) 
    244244        if hasattr(item, "detector"): 
    245             detector =item.detector 
     245            detector = copy.deepcopy(item.detector) 
    246246        if hasattr(item, "source"): 
    247             source =item.source 
     247            source = copy.deepcopy(item.source) 
    248248        if hasattr(item ,"info"): 
    249             info= item.info 
     249            info= copy.deepcopy(item.info) 
    250250        if hasattr(item,"id"): 
    251             id = item.id 
     251            id = copy.deepcopy(item.id) 
     252             
    252253        from sans.guiframe import dataFitting  
    253254        if item.__class__.__name__=="Data1D": 
     
    259260        data.source = source 
    260261        ## allow to highlight data when plotted 
    261         data.interactive = item.interactive 
     262        data.interactive = copy.deepcopy(item.interactive) 
    262263        ## when 2 data have the same id override the 1 st plotted 
    263264        data.id = id 
     
    266267        data.info= info 
    267268        ## 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)) 
    270271        ##group_id specify on which panel to plot this data 
    271         data.group_id = item.group_id 
     272        data.group_id = copy.deepcopy(item.group_id) 
    272273        return data 
    273274 
     
    559560        self.panel = event.GetEventObject() 
    560561        for item in self.panel.graph.plottables: 
     562             
    561563            if item.name == self.panel.graph.selected_plottable: 
    562564                ## put the errors values back to the model if the errors were hiden 
     
    567569                        data= self.copy_data(item, dy) 
    568570                    else: 
    569                         data= item 
     571                        data= copy.deepcopy(item) 
    570572                else: 
    571573                    if item.dy==None: 
    572574                        dy= numpy.zeros(len(item.y)) 
    573                         dy[dy==0]=1 
    574575                        data= self.copy_data(item, dy) 
    575576                    else: 
    576                         data= item 
     577                        data= copy.deepcopy(item) 
    577578            else: 
    578                 data= item 
     579                data= copy.deepcopy(item) 
    579580            ## create anew page                    
    580581            if item.name == self.panel.graph.selected_plottable or\ 
     
    962963     
    963964        err_image = numpy.zeros(numpy.shape(image)) 
    964         err_image[err_image==0]= 1 
     965        
    965966        theory= Data2D(image= image , err_image= err_image) 
    966967        theory.name= model.name 
     
    982983            theory.xmin= data.xmin 
    983984            theory.xmax= data.xmax 
    984          
     985        
    985986        ## plot 
    986987        wx.PostEvent(self.parent, NewPlotEvent(plot=theory, 
Note: See TracChangeset for help on using the changeset viewer.