Changeset 425e49ca in sasview for park_integration/src/sans/fit


Ignore:
Timestamp:
Oct 5, 2011 7:10:39 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:
a3c8e8f
Parents:
dcc93e4
Message:

fixing batch plot problems

Location:
park_integration/src/sans/fit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • park_integration/src/sans/fit/AbstractFitEngine.py

    r634ca14 r425e49ca  
    283283            msg += "%d <> %d" % (numpy.shape(self.dy), numpy.size(fx))                                                       
    284284            raise RuntimeError, msg   
    285         return (self.y[self.idx] - fx[self.idx]) / self.dy[self.idx] 
     285        return (self.y[self.idx] - fx[self.idx]) / self.dy[self.idx], fx[self.idx] 
    286286      
    287287    def residuals_deriv(self, model, pars=[]): 
     
    431431        self.true_res = [] 
    432432        self.func_name = "Functor" 
     433        self.theory = None 
    433434         
    434435    #def chisq(self, params): 
     
    458459        #import thread 
    459460        self.model.set_params(self.paramlist, params) 
    460         self.true_res = self.data.residuals(self.model.eval) 
     461         
     462        self.true_res, self.theory = self.data.residuals(self.model.eval) 
    461463        # check parameters range 
    462464        if self.check_param_range(): 
  • park_integration/src/sans/fit/ParkFitting.py

    r634ca14 r425e49ca  
    2727    def __init__(self, *args, **kwrds): 
    2828        fitresult.FitResult.__init__(self, *args, **kwrds) 
     29        self.theory = None 
    2930        self.inputs = [] 
    3031         
     
    4344    #xtol = 1e-4 
    4445    """Stop when simplex vertices are within xtol of each other""" 
    45     ftol = 1e-4 
     46    ftol = 5e-5 
    4647    """Stop when vertex values are within ftol of each other""" 
    4748    maxiter = None 
     
    6667        # Compute the parameter uncertainties from the jacobian 
    6768        res.calc_cov(fitness) 
     69        res.theory = result.fx 
    6870        return res 
    6971       
     
    272274            if self._cancel: return numpy.inf 
    273275            if m.isfitted and m.weight != 0: 
    274                 m.residuals = m.fitness.residuals() 
     276                m.residuals, _ = m.fitness.residuals() 
    275277                N = len(m.residuals) 
    276278                m.degrees_of_freedom = N-k if N>k else 1 
  • park_integration/src/sans/fit/ScipyFitting.py

    rd91d2c9 r425e49ca  
    3939        self.model = model 
    4040        self.data = data 
     41        self.theory = None 
    4142        self.param_list = param_list 
    4243        self.iterations = 0 
     
    160161                                                    full_output=1, 
    161162                                                    warning=True) 
     163 
    162164        except KeyboardInterrupt: 
    163165            msg = "Fitting: Terminated!!!" 
     
    188190            result.pvec = out 
    189191            result.success = success 
     192            result.theory = functor.theory 
    190193            #print "scipy", result.inputs 
    191194            if q is not None: 
Note: See TracChangeset for help on using the changeset viewer.