Changeset df9e0fc in sasview for fittingview/src


Ignore:
Timestamp:
Sep 29, 2011 3:36:29 PM (13 years ago)
Author:
Jae Cho <jhjcho@…>
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:
e9d9081
Parents:
63a2371
Message:

minor chisqr bug fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fittingview/src/sans/perspectives/fitting/fitting.py

    r62258ee rdf9e0fc  
    15421542        instead of calling expansive CalcChisqr in guithread 
    15431543        """ 
    1544         data_copy = deepcopy(data) 
    1545          
     1544        data_copy = deepcopy(data)   
    15461545        # default chisqr 
    15471546        chisqr = None 
    15481547        #to compute chisq make sure data has valid data 
    15491548        # return None if data == None 
    1550         if not check_data_validity(data_copy): 
     1549        if not check_data_validity(data_copy) or data_copy == None: 
    15511550            return chisqr 
    1552          
     1551 
    15531552        # Get data: data I, theory I, and data dI in order 
    15541553        if data_copy.__class__.__name__ == "Data2D": 
     
    15621561            fn = data_copy.data[index]  
    15631562            theory_data = self.page_finder[page_id].get_theory_data(fid=data_copy.id) 
     1563            if theory_data== None: 
     1564                return chisqr 
    15641565            gn = theory_data.data[index] 
    15651566            en = data_copy.err_data[index] 
     
    15791580            fn = data_copy.y[index]  
    15801581            theory_data = self.page_finder[page_id].get_theory_data(fid=data_copy.id) 
     1582            if theory_data== None: 
     1583                return chisqr 
    15811584            gn = theory_data.y 
    15821585            en = dy[index] 
     1586             
    15831587        # residual 
    15841588        res = (fn - gn) / en 
Note: See TracChangeset for help on using the changeset viewer.