Changeset 876192b2 in sasview for sansmodels
- Timestamp:
- Jul 18, 2011 5:09:02 PM (13 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:
- d9341f2
- Parents:
- a07161b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/test/utest_other_dispersity.py
rca4c150 r876192b2 32 32 self.model.setParam('scale', 10.0) 33 33 self.model.set_dispersion('radius', disp) 34 self.model.dispersion['radius']['width'] = 5.0 34 self.model.dispersion['radius']['width'] = 5.0/20.0 35 35 self.model.dispersion['radius']['npts'] = 100 36 self.model.dispersion['radius']['nsigmas'] = 2. 536 self.model.dispersion['radius']['nsigmas'] = 2.0 37 37 print "constant",self.model.run(0.001), self.model.dispersion 38 38 self.assertAlmostEqual(self.model.run(0.001), 1.021051*4527.47250339, 3) … … 43 43 disp = GaussianDispersion() 44 44 self.model.set_dispersion('radius', disp) 45 self.model.dispersion['radius']['width'] = 5.0 45 self.model.dispersion['radius']['width'] = 5.0/20.0 46 46 self.model.dispersion['radius']['npts'] = 100 47 self.model.dispersion['radius']['nsigmas'] = 2. 547 self.model.dispersion['radius']['nsigmas'] = 2.0 48 48 self.model.setParam('scale', 10.0) 49 49 … … 55 55 disp = GaussianDispersion() 56 56 self.model.set_dispersion('radius', disp) 57 self.model.dispersion['radius']['width'] = 5.0 57 self.model.dispersion['radius']['width'] = 5.0/20.0 58 58 self.model.dispersion['radius']['npts'] = 100 59 self.model.dispersion['radius']['nsigmas'] = 2. 559 self.model.dispersion['radius']['nsigmas'] = 2.0 60 60 self.model.setParam('scale', 10.0) 61 61 … … 69 69 disp = SchulzDispersion() 70 70 self.model.set_dispersion('radius', disp) 71 self.model.dispersion['radius']['width'] = 5.0 71 self.model.dispersion['radius']['width'] = 5.0/20.0 72 72 #self.model.dispersion['radius']['width'] = 0.0 73 73 self.model.dispersion['radius']['npts'] = 100 74 self.model.dispersion['radius']['nsigmas'] = 2. 575 #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) 77 77 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) 80 80 81 81 def test_lognormal_zero(self): … … 83 83 disp = LogNormalDispersion() 84 84 self.model.set_dispersion('radius', disp) 85 self.model.dispersion['radius']['width'] = 5.0 85 self.model.dispersion['radius']['width'] = 5.0/20.0 86 86 #self.model.dispersion['radius']['width'] = 0.0 87 87 self.model.dispersion['radius']['npts'] = 100 88 self.model.dispersion['radius']['nsigmas'] = 2. 589 #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) 91 91 print "model dispersion",self.model.dispersion 92 92 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) 95 95 96 96 def test_gaussian_zero(self): … … 100 100 self.model.dispersion['radius']['width'] = 0.0 101 101 self.model.dispersion['radius']['npts'] = 100 102 self.model.dispersion['radius']['nsigmas'] = 2. 5102 self.model.dispersion['radius']['nsigmas'] = 2.0 103 103 self.model.setParam('scale', 1.0) 104 104
Note: See TracChangeset
for help on using the changeset viewer.