Changeset b461b6d7 in sasview


Ignore:
Timestamp:
Dec 24, 2008 9:43:47 AM (16 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:
8ff3ec1
Parents:
be404bc
Message:

smearing changes

Location:
park_integration
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • park_integration/AbstractFitEngine.py

    r52ac10b rb461b6d7  
    169169class FitData1D(object): 
    170170    """ Wrapper class  for SANS data """ 
    171     def __init__(self,sans_data1d): 
     171    def __init__(self,sans_data1d, smearer=None): 
    172172        """ 
    173173            Data can be initital with a data (sans plottable) 
     
    190190             
    191191        """ 
    192         ## Smearing object 
    193         try: 
    194             self.smearer = sans_data1d.smearer 
    195         except: 
    196             self.smearer= None 
    197  
     192         
     193        self.smearer = smearer 
     194       
    198195        # Initialize from Data1D object 
    199196        self.data=sans_data1d 
     
    321318        if self.ymax==None: 
    322319            self.ymax= self.data.ymax 
    323              
    324320        for i in range(len(self.y_bins)): 
    325321            #if self.y_bins[i]>= self.ymin and self.y_bins[i]<= self.ymax: 
    326322            for j in range(len(self.x_bins)): 
    327323                #if self.x_bins[j]>= self.xmin and self.x_bins[j]<= self.xmax: 
     324                 
    328325                res.append( (self.image[j][i]- fn([self.x_bins[j],self.y_bins[i]]))\ 
    329326                            /self.err_image[j][i] ) 
     
    464461            raise ValueError, "park_integration:missing parameters" 
    465462     
    466     def set_data(self,data,Uid,qmin=None,qmax=None,ymin=None,ymax=None): 
     463    def set_data(self,data,Uid,smearer=None,qmin=None,qmax=None,ymin=None,ymax=None): 
    467464        """ Receives plottable, creates a list of data to fit,set data 
    468465            in a FitArrange object and adds that object in a dictionary  
     
    474471            fitdata=FitData2D(data) 
    475472        else: 
    476             fitdata=FitData1D(data) 
     473            fitdata=FitData1D(data, smearer) 
    477474        
    478475        fitdata.setFitRange(qmin=qmin,qmax=qmax, ymin=ymin,ymax=ymax) 
  • park_integration/test/test_fit_line.py

    r52ac10b rb461b6d7  
    99import math 
    1010class testFitModule(unittest.TestCase): 
     11    def smalltest(self): 
     12         
     13        import numpy 
     14        x=[1,22,3] 
     15        y=[5,6,7,8] 
     16        array= numpy.zeros(len(x), len(y)) 
     17         
    1118    """ test fitting """ 
    1219    def test1(self): 
Note: See TracChangeset for help on using the changeset viewer.