Changeset 43c0a8e in sasview for pr_inversion/invertor.py


Ignore:
Timestamp:
May 23, 2008 10:55:39 AM (16 years ago)
Author:
Mathieu Doucet <doucetm@…>
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:
dfb58f8
Parents:
eb06cbe
Message:

Add a couple of figures of merit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pr_inversion/invertor.py

    r9a11937 r43c0a8e  
    66    """ 
    77        Provide general online help text 
     8        Future work: extend this function to allow topic selection 
    89    """ 
    910    info_txt  = "The inversion approach is based on Moore, J. Appl. Cryst. (1980) 13, 168-175.\n\n" 
     
    3132         
    3233        TODO: explain the maths 
     34         
     35         
     36        Methods inherited from Cinvertor: 
     37        - get_peaks: returns the number of P(r) peaks 
    3338    """ 
    3439    ## Chisqr of the last computation 
     
    189194     
    190195    def pr_err(self, c, c_cov, r): 
    191         import math 
    192         c_err = numpy.zeros(len(c)) 
    193         for i in range(len(c)): 
    194             try: 
    195                 c_err[i] = math.sqrt(math.fabs(c_cov[i][i])) 
    196             except: 
    197                 import sys 
    198                 print sys.exc_value 
    199                 print "oups", c_cov[i][i] 
    200                 c_err[i] = c[i] 
     196        #import math 
     197        #c_err = numpy.zeros(len(c)) 
     198        #for i in range(len(c)): 
     199        #    try: 
     200        #        c_err[i] = math.sqrt(math.fabs(c_cov[i][i])) 
     201        #    except: 
     202        #        import sys 
     203        #        print sys.exc_value 
     204        #        print "oups", c_cov[i][i] 
     205        #        c_err[i] = c[i] 
    201206 
    202         return self.get_pr_err(c, c_err, r) 
     207        return self.get_pr_err(c, c_cov, r) 
    203208        
    204209    def _accept_q(self, q): 
Note: See TracChangeset for help on using the changeset viewer.