Ignore:
Timestamp:
Sep 17, 2009 8:21:56 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:
104f3da
Parents:
c5cd3b9
Message:

add check for plugin model

File:
1 edited

Legend:

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

    r7ad6ff5 rbfe4644  
    277277            @param return  
    278278        """ 
    279         detector=None 
    280         source=None 
     279        
    281280        info = None 
    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) 
     282     
    294283        if hasattr(item ,"info"): 
    295284            info= copy.deepcopy(item.info) 
    296285        if hasattr(item,"id"): 
    297286            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          
     287        
     288        data= Data1D(x=item.x, y=item.y,dx=None, dy=None) 
     289        data.copy_from_datainfo(item)  
     290        item.clone_without_data(clone=data)       
     291        data.dy= dy 
    306292        data.name = item.name 
    307         data.detector = detector 
    308         data.source = source 
     293       
    309294        ## allow to highlight data when plotted 
    310295        data.interactive = copy.deepcopy(item.interactive) 
     
    314299        ## to save  data 1D as cansas xml file 
    315300        data.info= info 
    316         ## If the data file does not tell us what the axes are, just assume... 
    317         data.xaxis(copy.deepcopy(item._xaxis),copy.deepcopy(item._xunit)) 
    318         data.yaxis(copy.deepcopy(item._yaxis),copy.deepcopy(item._yunit)) 
    319         ##group_id specify on which panel to plot this data 
    320301        data.group_id = item.group_id 
    321302        return data 
    322  
     303     
    323304    def set_fit_range(self, page, qmin, qmax): 
    324305        """ 
     
    409390         
    410391        smear =self.page_finder[current_pg].get_smearer() 
    411         self.draw_model( model=model, data= data, smearer= smear, 
     392        if model!= None: 
     393            self.draw_model( model=model, data= data, smearer= smear, 
    412394                qmin= qmin, qmax= qmax) 
    413395 
Note: See TracChangeset for help on using the changeset viewer.