Changeset 78ecdcc in sasview for sansinvariant/src/sans


Ignore:
Timestamp:
Dec 8, 2011 6:06:33 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:
6574940a
Parents:
26e1001
Message:

this fixed no_weigtht fit problem

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansinvariant/src/sans/invariant/invariant.py

    re0459a0 r78ecdcc  
    300300        # Uncertainty 
    301301        if type(self.data.dy)==numpy.ndarray and \ 
    302             len(self.data.dy)==len(self.data.x): 
     302            len(self.data.dy)==len(self.data.x) and \ 
     303            numpy.all(self.data.dy>0): 
    303304            sigma = self.data.dy 
    304305        else: 
    305306            sigma = numpy.ones(len(self.data.x)) 
    306              
     307 
    307308        # Compute theory data f(x) 
    308309        fx[idx] = self.data.y[idx] 
     
    330331                    numpy.ones(len(linearized_data.x))*b-linearized_data.y 
    331332            residuals = numpy.sum(deltas*deltas/sigma2) 
    332              
     333 
    333334            err = math.fabs(residuals) / numpy.sum(1.0/sigma2) 
    334335            return [a, b], [0, math.sqrt(err)] 
Note: See TracChangeset for help on using the changeset viewer.