Changeset c202d03 in sasview for sansview/perspectives/fitting


Ignore:
Timestamp:
Sep 17, 2009 11:31:05 AM (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:
904168e1
Parents:
e5664f2
Message:

change copy_data and theory1d type

File:
1 edited

Legend:

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

    rb2f4f83 rc202d03  
    1313import time 
    1414import thread 
    15 from danse.common.plottools.plottables import Theory1D 
     15#from danse.common.plottools.plottables import Theory1D 
    1616from danse.common.plottools.PlotPanel import PlotPanel 
    1717 
    1818from sans.guiframe.dataFitting import Data2D 
    1919from sans.guiframe.dataFitting import Data1D 
     20from sans.guiframe.dataFitting import Theory1D 
    2021from sans.guiframe import dataFitting  
    2122 
     
    277278            @param return  
    278279        """ 
    279         detector=None 
    280         source=None 
    281         info = None 
     280       
    282281        id=None 
    283         dxl=None 
    284         dxw=None 
    285         dx=None 
    286         if hasattr(item, "dxl"): 
    287             dxl = copy.deepcopy(item.dxl) 
    288         if hasattr(item, "dxw"): 
    289             dxw = copy.deepcopy(item.dxw) 
    290         if hasattr(item, "detector"): 
    291             detector = copy.deepcopy(item.detector) 
    292         if hasattr(item, "source"): 
    293             source = copy.deepcopy(item.source) 
    294         if hasattr(item ,"info"): 
    295             info= copy.deepcopy(item.info) 
     282         
    296283        if hasattr(item,"id"): 
    297284            id = copy.deepcopy(item.id) 
    298         if hasattr(item, "dx"): 
    299             dx= item.dx 
    300              
    301          
    302         data= Data1D(x=item.x, y=item.y,dx=dx, dy=dy) 
    303         data.dxl = dxl 
    304         data.dxw = dxw 
    305          
     285        
     286         
     287        data= Data1D(x=item.x, y=item.y,dx=None, dy=None) 
     288        data.copy_from_datainfo(item)  
     289        item.clone_without_data(clone=data)     
     290        data.dy=dy 
    306291        data.name = item.name 
    307         if detector!=None: 
    308             data.detector = detector 
    309         if source!=None: 
    310             data.source = source 
     292        
    311293        ## allow to highlight data when plotted 
    312294        data.interactive = copy.deepcopy(item.interactive) 
    313295        ## when 2 data have the same id override the 1 st plotted 
    314296        data.id = id 
    315         ## info is a reference to output of dataloader that can be used 
    316         ## to save  data 1D as cansas xml file 
    317         data.info= info 
    318         ## If the data file does not tell us what the axes are, just assume... 
    319         data.xaxis(copy.deepcopy(item._xaxis),copy.deepcopy(item._xunit)) 
    320         data.yaxis(copy.deepcopy(item._yaxis),copy.deepcopy(item._yunit)) 
    321297        
    322298        data.group_id = item.group_id 
     
    10991075                new_plot.is_data =False  
    11001076            
    1101             from DataLoader import data_info 
    1102             info= Data1D(x= new_plot.x, y=new_plot.y) 
    1103             info.title= new_plot.name 
    1104             title= my_info.title 
    1105             info.xaxis(new_plot._xaxis,  new_plot._xunit) 
    1106             info.yaxis( new_plot._yaxis, new_plot._yunit) 
    1107             new_plot.info = info 
     1077            
     1078            title= new_plot.name 
     1079            
    11081080            # Pass the reset flag to let the plotting event handler 
    11091081            # know that we are replacing the whole plot 
Note: See TracChangeset for help on using the changeset viewer.