Changeset a0bc608 in sasview


Ignore:
Timestamp:
Sep 21, 2009 8:34:24 PM (15 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:
51b638f
Parents:
65883cf
Message:

sansview: fixed plotting for smeared data with restricted range.

File:
1 edited

Legend:

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

    rbfe4644 ra0bc608  
    116116        output[index] = self.model.evalDistribution(self.x[index]) 
    117117      
    118         _first_bin = None 
    119         _last_bin  = None 
    120         
    121         for i_x in xrange(len(self.x)): 
    122             if index[i_x]: 
    123                 # Identify first and last bin 
    124                 #TODO: refactor this to pass q-values to the smearer 
    125                 # and let it figure out which bin range to use 
    126                 if _first_bin is None: 
    127                     _first_bin = i_x 
    128                 else: 
    129                     _last_bin  = i_x 
    130        
    131118        ##smearer the ouput of the plot     
    132119        if self.smearer!=None: 
    133             #output= self.smearer(output) 
    134             output = self.smearer(output, _first_bin,_last_bin) #Todo: Why always output[0]=0??? 
     120            first_bin, last_bin = self.smearer.get_bin_range(self.qmin, self.qmax) 
     121            output = self.smearer(output, first_bin, last_bin)  
    135122          
    136         ######Temp. FIX for Qrange w/ smear. #ToDo: Should not pass all the data to 'run' or 'smear'... 
    137         #new_index = (self.qmin > self.x) |(self.x > self.qmax) 
    138         #output[new_index] = None 
    139                  
    140         #print "output------",output 
    141123        elapsed = time.time()-self.starttime 
    142124        
    143         self.complete(x= self.x, y= output,  
     125        self.complete(x= self.x[index], y= output[index],  
    144126                      elapsed=elapsed, model= self.model, data=self.data) 
    145127         
Note: See TracChangeset for help on using the changeset viewer.