Changeset b461b6d7 in sasview for park_integration
- Timestamp:
- Dec 24, 2008 9:43:47 AM (16 years ago)
- 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
- Location:
- park_integration
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
park_integration/AbstractFitEngine.py
r52ac10b rb461b6d7 169 169 class FitData1D(object): 170 170 """ Wrapper class for SANS data """ 171 def __init__(self,sans_data1d ):171 def __init__(self,sans_data1d, smearer=None): 172 172 """ 173 173 Data can be initital with a data (sans plottable) … … 190 190 191 191 """ 192 ## Smearing object 193 try: 194 self.smearer = sans_data1d.smearer 195 except: 196 self.smearer= None 197 192 193 self.smearer = smearer 194 198 195 # Initialize from Data1D object 199 196 self.data=sans_data1d … … 321 318 if self.ymax==None: 322 319 self.ymax= self.data.ymax 323 324 320 for i in range(len(self.y_bins)): 325 321 #if self.y_bins[i]>= self.ymin and self.y_bins[i]<= self.ymax: 326 322 for j in range(len(self.x_bins)): 327 323 #if self.x_bins[j]>= self.xmin and self.x_bins[j]<= self.xmax: 324 328 325 res.append( (self.image[j][i]- fn([self.x_bins[j],self.y_bins[i]]))\ 329 326 /self.err_image[j][i] ) … … 464 461 raise ValueError, "park_integration:missing parameters" 465 462 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): 467 464 """ Receives plottable, creates a list of data to fit,set data 468 465 in a FitArrange object and adds that object in a dictionary … … 474 471 fitdata=FitData2D(data) 475 472 else: 476 fitdata=FitData1D(data )473 fitdata=FitData1D(data, smearer) 477 474 478 475 fitdata.setFitRange(qmin=qmin,qmax=qmax, ymin=ymin,ymax=ymax) -
park_integration/test/test_fit_line.py
r52ac10b rb461b6d7 9 9 import math 10 10 class 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 11 18 """ test fitting """ 12 19 def test1(self):
Note: See TracChangeset
for help on using the changeset viewer.