Changeset 876192b2 in sasview


Ignore:
Timestamp:
Jul 18, 2011 3:09:02 PM (13 years ago)
Author:
Jae Cho <jhjcho@…>
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:
d9341f2
Parents:
a07161b
Message:

updated utest due to the disp. func. corrections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/sans/models/test/utest_other_dispersity.py

    rca4c150 r876192b2  
    3232        self.model.setParam('scale', 10.0) 
    3333        self.model.set_dispersion('radius', disp) 
    34         self.model.dispersion['radius']['width'] = 5.0 
     34        self.model.dispersion['radius']['width'] = 5.0/20.0 
    3535        self.model.dispersion['radius']['npts'] = 100 
    36         self.model.dispersion['radius']['nsigmas'] = 2.5 
     36        self.model.dispersion['radius']['nsigmas'] = 2.0 
    3737        print "constant",self.model.run(0.001), self.model.dispersion 
    3838        self.assertAlmostEqual(self.model.run(0.001), 1.021051*4527.47250339, 3) 
     
    4343        disp = GaussianDispersion() 
    4444        self.model.set_dispersion('radius', disp) 
    45         self.model.dispersion['radius']['width'] = 5.0 
     45        self.model.dispersion['radius']['width'] = 5.0/20.0 
    4646        self.model.dispersion['radius']['npts'] = 100 
    47         self.model.dispersion['radius']['nsigmas'] = 2.5 
     47        self.model.dispersion['radius']['nsigmas'] = 2.0 
    4848        self.model.setParam('scale', 10.0) 
    4949         
     
    5555        disp = GaussianDispersion() 
    5656        self.model.set_dispersion('radius', disp) 
    57         self.model.dispersion['radius']['width'] = 5.0 
     57        self.model.dispersion['radius']['width'] = 5.0/20.0 
    5858        self.model.dispersion['radius']['npts'] = 100 
    59         self.model.dispersion['radius']['nsigmas'] = 2.5 
     59        self.model.dispersion['radius']['nsigmas'] = 2.0 
    6060        self.model.setParam('scale', 10.0) 
    6161         
     
    6969        disp = SchulzDispersion() 
    7070        self.model.set_dispersion('radius', disp) 
    71         self.model.dispersion['radius']['width'] = 5.0 
     71        self.model.dispersion['radius']['width'] = 5.0/20.0 
    7272        #self.model.dispersion['radius']['width'] = 0.0 
    7373        self.model.dispersion['radius']['npts'] = 100 
    74         self.model.dispersion['radius']['nsigmas'] = 2.5 
    75         #self.model.setParam('scale', 1.0) 
    76         self.model.setParam('scale', 10.0) 
     74        self.model.dispersion['radius']['nsigmas'] = 2.0 
     75        self.model.setParam('scale', 1.0) 
     76        #self.model.setParam('scale', 10.0) 
    7777        print "schulz",self.model.run(0.001), self.model.dispersion 
    78         self.assertAlmostEqual(self.model.run(0.001), 450.355, 3) 
    79         self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 452.299, 3) 
     78        self.assertAlmostEqual(self.model.run(0.001), 542.23568, 3) 
     79        self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 544.54864, 3) 
    8080         
    8181    def test_lognormal_zero(self): 
     
    8383        disp = LogNormalDispersion() 
    8484        self.model.set_dispersion('radius', disp) 
    85         self.model.dispersion['radius']['width'] = 5.0 
     85        self.model.dispersion['radius']['width'] = 5.0/20.0 
    8686        #self.model.dispersion['radius']['width'] = 0.0 
    8787        self.model.dispersion['radius']['npts'] = 100 
    88         self.model.dispersion['radius']['nsigmas'] = 2.5 
    89         #self.model.setParam('scale', 1.0) 
    90         self.model.setParam('scale', 10.0) 
     88        self.model.dispersion['radius']['nsigmas'] = 2.0 
     89        self.model.setParam('scale', 1.0) 
     90        #self.model.setParam('scale', 10.0) 
    9191        print "model dispersion",self.model.dispersion 
    9292        print "lognormal",self.model.run(0.001) 
    93         self.assertAlmostEqual(self.model.run(0.001), 450.355, 3) 
    94         self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 452.299, 3) 
     93        self.assertAlmostEqual(self.model.run(0.001), 450.64237, 3) 
     94        self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 452.58733, 3) 
    9595         
    9696    def test_gaussian_zero(self): 
     
    100100        self.model.dispersion['radius']['width'] = 0.0 
    101101        self.model.dispersion['radius']['npts'] = 100 
    102         self.model.dispersion['radius']['nsigmas'] = 2.5 
     102        self.model.dispersion['radius']['nsigmas'] = 2.0 
    103103        self.model.setParam('scale', 1.0) 
    104104         
Note: See TracChangeset for help on using the changeset viewer.