Ignore:
Timestamp:
Sep 17, 2009 8:21:56 AM (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:
104f3da
Parents:
c5cd3b9
Message:

add check for plugin model

File:
1 edited

Legend:

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

    raeb3c20 rbfe4644  
    115115        index= (self.qmin <= self.x)& (self.x <= self.qmax) 
    116116        output[index] = self.model.evalDistribution(self.x[index]) 
     117      
     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 
    117130       
    118131        ##smearer the ouput of the plot     
    119132        if self.smearer!=None: 
    120             output = self.smearer(output) #Todo: Why always output[0]=0??? 
    121          
     133            #output= self.smearer(output) 
     134            output = self.smearer(output, _first_bin,_last_bin) #Todo: Why always output[0]=0??? 
     135          
    122136        ######Temp. FIX for Qrange w/ smear. #ToDo: Should not pass all the data to 'run' or 'smear'... 
    123         new_index = (self.qmin > self.x) |(self.x > self.qmax) 
    124         output[new_index] = None 
     137        #new_index = (self.qmin > self.x) |(self.x > self.qmax) 
     138        #output[new_index] = None 
    125139                 
     140        #print "output------",output 
    126141        elapsed = time.time()-self.starttime 
    127142        
Note: See TracChangeset for help on using the changeset viewer.