Changeset a1b2471 in sasview for sansmodels/src/sans/models/test/utest_model_sphereexpshell.py
- Timestamp:
- Sep 21, 2010 5:44:24 PM (14 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:
- db08737
- Parents:
- 60c320b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/sans/models/test/utest_model_sphereexpshell.py
re096270 ra1b2471 14 14 from sans.models.SphereExpShellModel import SphereExpShellModel 15 15 from sans.models.CoreMultiShellModel import CoreMultiShellModel 16 from sans.models.VesicleModel import VesicleModel 16 17 17 18 self.model = SphereExpShellModel(n_shells=1) 18 19 self.model2 = SphereExpShellModel(n_shells=1).model 19 20 self.model3 = CoreMultiShellModel(n_shells=1) 21 self.model4 = VesicleModel() 20 22 21 23 def test_compare_Exp0_flat(self): … … 49 51 self.assertAlmostEqual(self.model2.run(0.1),self.model3.run(0.1),10) 50 52 53 def test_compare_Exp0_flat_vesicle(self): 54 """ 55 Check if Exp function with A_shell=0 gives the same value as Flat function of vesicle model when sld_solv=sld_core 56 """ 57 print "\n*****Note: All tests (test_compare_Exp0_flat and test_compare_Expsmall_line) were passes since Sept. 18, 2010..." 58 # Exp: func_shell = 2, Line: func_shell =1 , Flat: func_shell = 0. 59 # A_shell = The coefficient of the exponential function: exp(A_shell*(r-ro)/thick_shell) 60 # exp function by default 61 # exp function crosses over to flat func at A_shell=0 62 self.model.setParam("A_shell1", 0) 63 # set A_shell=1 64 self.model2.setParam("A_shell1", 1) 65 # change the function to flat function 66 self.model2.setParam("func_shell1", 0) 67 68 # model: set param values as same as the model2 69 self.model.setParam("background", 0.0) 70 self.model.setParam("rad_core", 100.0) 71 self.model.setParam("scale", 1.0) 72 self.model.setParam("sld_core", 6.36e-006) 73 self.model.setParam("sld_in_shell1", 5e-007) 74 self.model.setParam("sld_solv", 6.36e-006) 75 self.model.setParam("thick_shell1", 30.0) 76 # model2: set param values as same as the model2 77 self.model2.setParam("background", 0.0) 78 self.model2.setParam("rad_core", 100.0) 79 self.model2.setParam("scale", 1.0) 80 self.model2.setParam("sld_core", 6.36e-006) 81 self.model2.setParam("sld_in_shell1", 5e-007) 82 self.model2.setParam("sld_solv", 6.36e-006) 83 self.model2.setParam("thick_shell1", 30.0) 84 #Compare exp(A=0) to flat (where A_shell is null) function 85 self.assertEqual(self.model.run(0.1),self.model4.run(0.1)) 86 self.assertEqual(self.model2.run(0.1),self.model4.run(0.1)) 87 #self.assertAlmostEqual(self.model2.run(0.1),self.model3.run(0.1),10) 88 51 89 52 90 def test_compare_Expsmall_line(self):
Note: See TracChangeset
for help on using the changeset viewer.