Changeset 43e685d in sasview for sansview


Ignore:
Timestamp:
Mar 17, 2010 3:26:55 PM (15 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:
90e5ca1
Parents:
c6f95bb
Message:

Made sure that if I ==None the I point is not taken account into the calculation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansview/perspectives/fitting/model_thread.py

    re575db9 r43e685d  
    4848         
    4949        if self.data != None: 
     50            self.I_data = self.data.data 
    5051            self.qx_data = self.data.qx_data 
    5152            self.qy_data = self.data.qy_data 
     
    6869            self.qy_data = new_ybin 
    6970            self.qx_data = new_xbin 
     71            # fake data 
     72            self.I_data = numpy.ones(len(self.qx_data)) 
    7073            
    7174            self.mask = numpy.ones(len(self.qx_data),dtype=bool) 
     
    7477        radius= numpy.sqrt( self.qx_data*self.qx_data + self.qy_data*self.qy_data ) 
    7578        index_data= (self.qmin<= radius)&(self.mask) 
    76          
     79 
    7780        # For theory, qmax is based on 1d qmax  
    7881        # so that must be mulitified by sqrt(2) to get actual max for 2d 
    7982        index_model = ((self.qmin <= radius)&(radius<= self.qmax)) 
    8083        self.mask = (index_model)&(self.mask) 
    81          
     84        self.mask = (self.mask)&(numpy.isfinite(self.I_data)) 
    8285        if self.data ==None: 
    8386            # Only qmin value will be consider for the detector 
     
    8790 
    8891        output = numpy.zeros(len(self.mask)) 
     92         
     93        # output default is None 
     94        # This method is to distinguish between masked point and data point = 0. 
     95        output = output/output 
     96        # set value for self.mask==True, else still None to Plottools 
    8997        output[self.mask] = value  
    9098 
Note: See TracChangeset for help on using the changeset viewer.