Changeset bad9ae2 in sasview


Ignore:
Timestamp:
Dec 1, 2009 9:21:24 PM (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:
f521f61
Parents:
7a108dd
Message:

working on testing invariant

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Invariant/invariant.py

    r7a108dd rbad9ae2  
    215215            fx= Functor(data , function) 
    216216            y = data.y 
    217             out, cov_x = linalg.lstsq(y,fx) 
     217            slope, constant = linalg.lstsq(y,fx) 
    218218            @param qmin: data first q value to consider during the fit 
    219219            @param qmax: data last q value to consider during the fit 
     
    320320            where n >= len(data.x)-1 
    321321            dxi = 1/2*(xi+1 - xi) + (xi - xi-1) 
    322             dx0 = (x1 - x0)/2 
     322            dx0 = x0 + (x1 - x0)/2 
    323323            dxn = xn - xn-1 
    324324            @param data: the data to use to compute invariant. 
     
    332332            n = len(data.x)- 1 
    333333            #compute the first delta q 
    334             dx0 = (data.x[1] - data.x[0])/2 
     334            dx0 = (data.x[1] + data.x[0])/2 
    335335            #compute the last delta q 
    336336            dxn = data.x[n] - data.x[n-1] 
     
    687687        # Data boundaries for fiiting 
    688688        x_len = len(self._data.x) - 1 
    689         qmin = self._data.x[x_len - (self._high_extrapolation_npts - 1) ] 
     689        qmin = self._data.x[x_len - (self._high_extrapolation_npts - 1)] 
    690690        qmax = self._data.x[x_len] 
    691691         
     
    759759        #check value inside the sqrt function 
    760760        value = 1 - k * self._qstar 
    761         if (1 - k * self._qstar) <= 0: 
     761        if (value) <= 0: 
    762762            raise ValueError, "Cannot compute incertainty on volume" 
    763763        # Compute uncertainty 
Note: See TracChangeset for help on using the changeset viewer.