Changeset 18b89c4 in sasview for sansmodels/src/sans/models


Ignore:
Timestamp:
Jan 18, 2011 4:26:29 PM (14 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:
f1abc57
Parents:
18695bf
Message:

updated some param values because of the changes of libigor (contrast not used no longer)

File:
1 edited

Legend:

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

    rdfa8832 r18b89c4  
    1717        self.model.setParam('radius', 20.0) 
    1818        self.model.setParam('length', 400.0) 
    19         self.model.setParam('contrast', 3.e-6) 
     19        self.model.setParam('sldCyl', 4.e-6) 
     20        self.model.setParam('sldSolv', 1.e-6) 
    2021        self.model.setParam('background', 0.0) 
    2122        self.model.setParam('cyl_theta', 0.0) 
     
    3334        self.model.dispersion['radius']['width'] = 5.0 
    3435        self.model.dispersion['radius']['npts'] = 100 
     36        self.model.dispersion['radius']['nsigmas'] = 2.5 
    3537         
    3638        self.assertAlmostEqual(self.model.run(0.001), 1.021051*4527.47250339, 3) 
     
    4345        self.model.dispersion['radius']['width'] = 5.0 
    4446        self.model.dispersion['radius']['npts'] = 100 
     47        self.model.dispersion['radius']['nsigmas'] = 2.5 
    4548        self.model.setParam('scale', 10.0) 
    4649         
     
    5457        self.model.dispersion['radius']['width'] = 5.0 
    5558        self.model.dispersion['radius']['npts'] = 100 
     59        self.model.dispersion['radius']['nsigmas'] = 2.5 
    5660        self.model.setParam('scale', 10.0) 
    5761         
     
    6670        self.model.dispersion['radius']['width'] = 0.0 
    6771        self.model.dispersion['radius']['npts'] = 100 
     72        self.model.dispersion['radius']['nsigmas'] = 2.5 
    6873        self.model.setParam('scale', 1.0) 
    6974         
     
    8489        weights   = numpy.zeros(100) 
    8590        for i in range(100): 
    86             values_ph[i]=(2.0*math.pi/99.0*i) 
    87             values_th[i]=(math.pi/99.0*i) 
     91            values_ph[i]=(360/99.0*i) 
     92            values_th[i]=(180/99.0*i) 
    8893            weights[i]=(1.0) 
    8994         
     
    143148        self.model.dispersion['radius']['width'] = 5.0 
    144149        self.model.dispersion['radius']['npts'] = 10 
     150        self.model.dispersion['radius']['nsigmas'] = 2.5 
    145151 
    146152        disp_rr = GaussianDispersion() 
     
    148154        self.model.dispersion['thickness']['width'] = 2. 
    149155        self.model.dispersion['thickness']['npts'] = 10 
     156        self.model.dispersion['thickness']['nsigmas'] = 2.5 
    150157 
    151158        disp_len = GaussianDispersion() 
     
    153160        self.model.dispersion['length']['width'] = 50.0 
    154161        self.model.dispersion['length']['npts'] = 10 
     162        self.model.dispersion['length']['nsigmas'] = 2.5 
    155163 
    156164        self.assertAlmostEqual(self.model.run(0.001), 1.07832610*358.44062724936009, 3) 
     
    171179        weights   = numpy.zeros(100) 
    172180        for i in range(100): 
    173             values_ph[i]=(2.0*math.pi/99.0*i) 
    174             values_th[i]=(math.pi/99.0*i) 
     181            values_ph[i]=(360/99.0*i) 
     182            values_th[i]=(180/99.0*i) 
    175183            weights[i]=(1.0) 
    176184         
     
    228236        self.model.dispersion['radius']['width'] = 10. 
    229237        self.model.dispersion['radius']['npts'] = 10 
     238        self.model.dispersion['radius']['nsigmas'] = 2.5 
    230239 
    231240        disp_rr = GaussianDispersion() 
     
    233242        self.model.dispersion['thickness']['width'] = 2. 
    234243        self.model.dispersion['thickness']['npts'] = 10 
    235  
     244        self.model.dispersion['thickness']['nsigmas'] = 2.5 
    236245 
    237246        self.assertAlmostEqual(self.model.run(0.001), 1.16747510*407.344127907553, 3) 
     
    249258        self.model.setParam('radius_a', 20.0) 
    250259        self.model.setParam('radius_b', 400.0) 
    251         self.model.setParam('contrast', 3.e-6) 
    252         self.model.setParam('background', 0.0) 
    253         self.model.setParam('axis_theta', 1.57) 
     260        self.model.setParam('sldEll', 4.e-6) 
     261        self.model.setParam('sldSolv', 1.e-6) 
     262        self.model.setParam('background', 0.0) 
     263        self.model.setParam('axis_theta', 89.95445) 
    254264        self.model.setParam('axis_phi', 0.0) 
    255265         
     
    270280        disp = DisperseModel(self.model, ['radius_a', 'radius_b'], [5, 50]) 
    271281        disp.setParam('n_pts', 10) 
     282 
    272283        self.assertAlmostEqual(disp.run(0.001), 11948.72581312305, 3) 
    273284        self.assertAlmostEqual(disp.runXY([0.001,0.001]), 11811.972359807551, 3) 
     
    279290        self.model.dispersion['radius_a']['width'] = 5.0 
    280291        self.model.dispersion['radius_a']['npts'] = 10 
     292        self.model.dispersion['radius_a']['nsigmas'] = 2.5 
    281293 
    282294        disp_rr = GaussianDispersion() 
     
    284296        self.model.dispersion['radius_b']['width'] = 50. 
    285297        self.model.dispersion['radius_b']['npts'] = 10 
    286  
     298        self.model.dispersion['radius_b']['nsigmas'] = 2.5 
    287299 
    288300        self.assertAlmostEqual(self.model.run(0.001), 1.10650710*11948.72581312305, 3) 
     
    302314        weights   = numpy.zeros(100) 
    303315        for i in range(100): 
    304             values_ph[i]=(2.0*math.pi/99.0*i) 
    305             values_th[i]=(math.pi/99.0*i) 
     316            values_ph[i]=(360/99.0*i) 
     317            values_th[i]=(180/99.0*i) 
    306318            weights[i]=(1.0) 
    307319         
     
    329341        self.model.setParam('scale', 1.0) 
    330342        self.model.setParam('radius', 60.0) 
    331         self.model.setParam('contrast', 1) 
     343        self.model.setParam('sldSph', 2.0e-06) 
     344        self.model.setParam('sldSolv', 1.0e-6) 
    332345        self.model.setParam('background', 0.0) 
    333346         
     
    356369        self.model.dispersion['radius']['width'] = 10.0 
    357370        self.model.dispersion['radius']['npts'] = 10 
     371        self.model.dispersion['radius']['nsigmas'] = 2.5 
    358372 
    359373        self.assertAlmostEqual(self.model.run(0.001), 1.19864810*96795008379475.25,3) 
     
    373387        self.model.setParam('r_ratio', 1.5) 
    374388        self.model.setParam('length', 400.0) 
    375         self.model.setParam('contrast', 3.e-6) 
    376         self.model.setParam('background', 0.0) 
    377         self.model.setParam('cyl_theta', 1.57) 
     389        self.model.setParam('sldCyl', 4.0e-6) 
     390        self.model.setParam('sldSolv', 1.0e-6) 
     391        self.model.setParam('background', 0.0) 
     392        self.model.setParam('cyl_theta', 90) 
    378393        self.model.setParam('cyl_phi', 0.0) 
    379394        self.model.setParam('cyl_psi', 0.0) 
     
    386401        """ 
    387402        self.assertAlmostEqual(self.model.run(0.001), 675.50440232504991, 3) 
    388         self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 669.5173937622792, 3) 
     403        self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 669.5173937622792, 0) 
    389404         
    390405    def test_dispersion(self): 
     
    396411        disp.setParam('n_pts', 10) 
    397412        self.assertAlmostEqual(disp.run(0.001), 711.18048194151925, 3) 
    398         self.assertAlmostEqual(disp.runXY([0.001,0.001]), 704.63525988095705, 3) 
     413        self.assertAlmostEqual(disp.runXY([0.001,0.001]), 704.63525988095705, 0) 
    399414 
    400415    def test_new_disp(self): 
     
    404419        self.model.dispersion['r_minor']['width'] = 5.0 
    405420        self.model.dispersion['r_minor']['npts'] = 10 
     421        self.model.dispersion['r_minor']['nsigmas'] = 2.5 
    406422 
    407423        disp_rr = GaussianDispersion() 
     
    409425        self.model.dispersion['r_ratio']['width'] = 0.25 
    410426        self.model.dispersion['r_ratio']['npts'] = 10 
     427        self.model.dispersion['r_ratio']['nsigmas'] = 2.5 
    411428 
    412429        disp_len = GaussianDispersion() 
     
    414431        self.model.dispersion['length']['width'] = 50.0 
    415432        self.model.dispersion['length']['npts'] = 10 
     433        self.model.dispersion['length']['nsigmas'] = 2.5 
    416434 
    417435        self.assertAlmostEqual(self.model.run(0.001), 1.23925910*711.18048194151925, 3) 
    418         self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 1.238955*704.63525988095705, 3) 
     436        self.assertAlmostEqual(self.model.runXY([0.001,0.001]), 1.238955*704.63525988095705, 0) 
    419437         
    420438 
     
    434452        weights   = numpy.zeros(100) 
    435453        for i in range(100): 
    436             values_ps[i]=(2.0*math.pi/99.0*i) 
    437             values_ph[i]=(2.0*math.pi/99.0*i) 
    438             values_th[i]=(math.pi/99.0*i) 
     454            values_ps[i]=(360/99.0*i) 
     455            values_ph[i]=(360/99.0*i) 
     456            values_th[i]=(180/99.0*i) 
    439457            weights[i]=(1.0) 
    440458         
Note: See TracChangeset for help on using the changeset viewer.