Changeset d53bc33 in sasview for park_integration/test


Ignore:
Timestamp:
Aug 6, 2008 12:52:15 PM (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:
a9dec92
Parents:
129284a
Message:

add test fitting data 3 times

Location:
park_integration/test
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • park_integration/test/test_large_model.py

    rcfe97ea rd53bc33  
    1010    """ test fitting """ 
    1111    def testfit_1Data_1Model(self): 
     12        """ test fitting for one data and one model park vs scipy""" 
     13        #load data 
     14        from sans.fit.Loader import Load 
     15        load= Load() 
     16        load.set_filename("cyl_testdata.txt") 
     17        load.set_values() 
     18        data1 = Data1D(x=[], y=[],dx=None, dy=None) 
     19        load.load_data(data1) 
     20        
     21         
     22        #Importing the Fit module 
     23        from sans.fit.Fitting import Fit 
     24        fitter= Fit('scipy') 
     25         
     26        # Receives the type of model for the fitting 
     27        from sans.models.CylinderModel import CylinderModel 
     28        model1  = CylinderModel() 
     29       
     30         
     31        #Do the fit SCIPY 
     32        fitter.set_data(data1,1) 
     33        import math 
     34        pars1={'background':0,'contrast':3*math.pow(10, -6),\ 
     35                'cyl_phi':1,'cyl_theta':1,'length':400,'radius':20,'scale':1} 
     36        fitter.set_model(model1,"M1",1,pars1) 
     37        
     38         
     39        chisqr1, out1, cov1=fitter.fit() 
     40        print "scipy1",chisqr1, out1, cov1 
     41        pars2={'background':1.0,'contrast':400,\ 
     42                'cyl_phi':20,'cyl_theta':0.0,'length':1.0,\ 
     43                'radius':3*math.pow(10, -6),'scale':1.0} 
     44        fitter.set_model(model1,"M1",1,pars2) 
     45        chisqr2, out2, cov2=fitter.fit() 
     46        print "scipy2",chisqr2, out2, cov2 
     47         
     48        pars3={'background':5.85693826,'contrast': 5.86071451,\ 
     49                'cyl_phi':1.04547760*math.pow(10,-5),'cyl_theta':1.0,'length':0.0,\ 
     50                'radius':1.39397013*math.pow(10, 3),'scale':20} 
     51        fitter.set_model(model1,"M1",1,pars3) 
     52        chisqr3, out3, cov3=fitter.fit() 
     53        print "scipy3",chisqr3, out3, cov3 
     54        self.assert_(chisqr1) 
     55         
     56        
     57       
     58    def testfit_11Data_1Model(self): 
    1259        """ test fitting for one data and one model park vs scipy""" 
    1360        #load data 
Note: See TracChangeset for help on using the changeset viewer.