Changeset 883a2ef in sasview for sansrealspace/src/realspace/test
- Timestamp:
- Nov 28, 2007 10:25:16 AM (17 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:
- aa61e49
- Parents:
- f980d4a
- Location:
- sansrealspace/src/realspace/test
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sansrealspace/src/realspace/test/cylinder_d=0.5_Iq2D.txt
rf980d4a r883a2ef 1 1 PARS: {'scale': 1.0, 'length': 100, 'radius': 20, 'background': 0.0, 'cyl_theta': 1.5707963267948966, 'contrast': 1.0, 'cyl_phi': 1.5707963267948966} 2 2 <q> <ana> <sim> <err> 3 0.001 1.25586e+013 1.25584e+013 5.2 5262e+0084 0.00929167 1.1909e+013 1.19 058e+013 1.05064e+0105 0.0175833 1.0341e+013 1.03 345e+013 3.12179e+0106 0.025875 8.16205e+012 8.1 4926e+012 5.17962e+0107 0.0341667 5.77306e+012 5. 81045e+012 6.21145e+0108 0.0424583 3.56425e+012 3.5 5223e+012 5.90114e+0109 0.05075 1.82415e+012 1.8 0424e+012 4.48859e+01010 0.0590417 6.86403e+011 6.9 3632e+011 2.71769e+01011 0.0673333 1.26379e+011 1.2 136e+011 1.06077e+01012 0.075625 1.69416e+009 1. 50569e+009 1.08773e+00913 0.0839167 1.17674e+011 1.2 4732e+011 9.32509e+00914 0.0922083 2.93262e+011 2. 7841e+011 1.38067e+01015 0.1005 4.06932e+011 4. 09882e+011 1.72092e+01016 0.108792 4.1248e+011 4. 37694e+011 1.84369e+01017 0.117083 3.26735e+011 3. 07555e+011 1.59575e+01018 0.125375 2.00372e+011 1.9 8719e+011 1.30112e+01019 0.133667 8.63351e+010 8. 31996e+010 8.33716e+00920 0.141958 1.76833e+010 1. 4757e+010 3.47028e+00921 0.15025 2.29778e+008 5.88028e+008 6.83052e+00822 0.158542 1.83678e+010 1.6151e+010 3.56511e+00923 0.166833 4.78555e+010 5.04122e+010 6.33775e+00924 0.175125 6.83196e+010 7.36705e+010 7.69267e+00925 0.183417 7.03999e+010 7. 70008e+010 7.86228e+00926 0.191708 5.61199e+010 5. 68128e+010 6.74312e+00927 0.2 3.43293e+010 3. 12432e+010 4.97778e+0093 0.001 1.25586e+013 1.25584e+013 5.24372e+008 4 0.00929167 1.1909e+013 1.19119e+013 1.04128e+010 5 0.0175833 1.0341e+013 1.03444e+013 3.11005e+010 6 0.025875 8.16205e+012 8.19485e+012 5.13766e+010 7 0.0341667 5.77306e+012 5.76297e+012 6.22366e+010 8 0.0424583 3.56425e+012 3.54391e+012 5.90911e+010 9 0.05075 1.82415e+012 1.8406e+012 4.53958e+010 10 0.0590417 6.86403e+011 6.94445e+011 2.73011e+010 11 0.0673333 1.26379e+011 1.26541e+011 1.08456e+010 12 0.075625 1.69416e+009 1.95158e+009 1.23535e+009 13 0.0839167 1.17674e+011 1.26397e+011 9.39118e+009 14 0.0922083 2.93262e+011 2.85994e+011 1.40496e+010 15 0.1005 4.06932e+011 4.13645e+011 1.72159e+010 16 0.108792 4.1248e+011 4.28788e+011 1.82404e+010 17 0.117083 3.26735e+011 3.25064e+011 1.63836e+010 18 0.125375 2.00372e+011 1.90569e+011 1.27255e+010 19 0.133667 8.63351e+010 8.94079e+010 8.63641e+009 20 0.141958 1.76833e+010 1.23431e+010 3.16684e+009 21 0.15025 2.29778e+008 1.37597e+008 3.31662e+008 22 0.158542 1.83678e+010 2.03592e+010 4.03062e+009 23 0.166833 4.78555e+010 4.76265e+010 6.15775e+009 24 0.175125 6.83196e+010 6.19958e+010 7.01335e+009 25 0.183417 7.03999e+010 7.12558e+010 7.51039e+009 26 0.191708 5.61199e+010 5.79624e+010 6.79382e+009 27 0.2 3.43293e+010 3.93938e+010 5.56512e+009 -
sansrealspace/src/realspace/test/simulation_stimuli.py
r8c050c1 r883a2ef 46 46 def setup(self): 47 47 """Setup the canvas for stimuli application""" 48 return VolumeCanvas.VolumeCanvas() 48 volume = VolumeCanvas.VolumeCanvas() 49 volume.params['lores_density'] = 0.05 50 return volume 49 51 50 52 def getRandomStimulus(self): -
sansrealspace/src/realspace/test/utest_oriented.py
rf980d4a r883a2ef 434 434 raise sys.exc_type, sys.exc_value 435 435 436 436 class TestParamChange(unittest.TestCase): 437 """ Tests for oriented (2D) systems """ 438 439 def setUp(self): 440 """ Set up cylinder model """ 441 from sans.models.CylinderModel import CylinderModel 442 radius = 5 443 length = 40 444 density = 20 445 446 # Analytical model 447 self.ana = CylinderModel() 448 self.ana.setParam('scale', 1.0) 449 self.ana.setParam('contrast', 1.0) 450 self.ana.setParam('background', 0.0) 451 self.ana.setParam('radius', radius) 452 self.ana.setParam('length', length) 453 self.ana.setParam('cyl_theta', math.pi/2.0) 454 self.ana.setParam('cyl_phi', math.pi/2.0) 455 456 # Simulation model 457 self.model = VolumeCanvas.VolumeCanvas() 458 self.handle = self.model.add('cylinder') 459 self.model.setParam('lores_density', density) 460 self.model.setParam('%s.radius' % self.handle, radius) 461 self.model.setParam('%s.length' % self.handle, length) 462 self.model.setParam('scale' , 1.0) 463 self.model.setParam('%s.contrast' % self.handle, 1.0) 464 self.model.setParam('background' , 0.0) 465 self.model.setParam('%s.orientation' % self.handle, [0,0,0]) 466 467 def testalongY(self): 468 """ Test that a parameter change forces the generation 469 of new space points 470 """ 471 ana_val = self.ana.runXY([0.1, 0.2]) 472 sim_val = self.model.getIq2D(0.1, 0.2) 473 474 self.assert_( math.fabs(sim_val/ana_val-1.0)<0.05 ) 475 476 # Change the radius a re-evaluate 477 self.ana.setParam('radius', 10) 478 self.model.setParam('%s.radius' % self.handle, 10) 479 480 ana_val = self.ana.runXY([0.1, 0.2]) 481 sim_val = self.model.getIq2D(0.1, 0.2) 482 self.assert_( math.fabs(sim_val/ana_val-1.0)<0.05 ) 437 483 438 484
Note: See TracChangeset
for help on using the changeset viewer.