Changeset 437a9f0 in sasview for Invariant/test


Ignore:
Timestamp:
Dec 1, 2009 4:21:19 PM (15 years ago)
Author:
Gervaise Alina <gervyh@…>
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:
7a108dd
Parents:
c5607fa
Message:

testing invariant

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Invariant/test/utest_use_cases.py

    ref9ed58 r437a9f0  
    9393        #    parameters. For instance, you might not want to allow 'high' and 'guinier'. 
    9494        # The power parameter (not shown below) should default to 4. 
    95         inv.set_extrapolation(range='low', npts=20, function='guinier') 
     95        inv.set_extrapolation(range='low', npts=10, function='guinier') 
    9696         
    9797        # The version of the call without error 
     
    108108         
    109109        # Test results 
    110         self.assertAlmostEquals(qstar, 7.49e-5,2) 
     110        self.assertAlmostEquals(qstar, 7.49e-5) 
    111111        self.assertAlmostEquals(v, 0.005648401) 
    112112        self.assertAlmostEquals(s, 9.42e+2,2) 
     
    120120         
    121121        # Set the extrapolation parameters for the high-Q range 
    122         inv.set_extrapolation(range='high', npts=20, function='power_law', power=4) 
     122        inv.set_extrapolation(range='high', npts=10, function='power_law', power=4) 
    123123         
    124124        # The version of the call without error 
     
    146146         
    147147        # Set the extrapolation parameters for the low- and high-Q ranges 
    148         inv.set_extrapolation(range='low', npts=5, function='guinier') 
    149         inv.set_extrapolation(range='high', npts=5, function='power_law', power=4) 
     148        inv.set_extrapolation(range='low', npts=10, function='guinier') 
     149        inv.set_extrapolation(range='high', npts=10, function='power_law', power=4) 
    150150         
    151151        # The version of the call without error 
     
    161161         
    162162        # Test results 
    163         self.assertAlmostEquals(qstar, 7.90069e-5,2) 
     163        self.assertAlmostEquals(qstar, 7.88981e-5,2) 
    164164        self.assertAlmostEquals(v, 0.005952674) 
    165165        self.assertAlmostEquals(s, 9.42e+2,2) 
     
    213213        inv = invariant.InvariantCalculator(data=self.data_slit_smear) 
    214214        # Set the extrapolation parameters for the low-Q range 
    215         inv.set_extrapolation(range='low', npts=20, function='guinier') 
     215        inv.set_extrapolation(range='low', npts=10, function='guinier') 
    216216        # The version of the call without error 
    217217        # At this point, we could still compute Q* without extrapolation by calling 
     
    237237         
    238238        # Set the extrapolation parameters for the high-Q range 
    239         inv.set_extrapolation(range='high', npts=20, function='power_law', power=4) 
     239        inv.set_extrapolation(range='high', npts=10, function='power_law', power=4) 
    240240         
    241241        # The version of the call without error 
     
    263263         
    264264        # Set the extrapolation parameters for the low- and high-Q ranges 
    265         inv.set_extrapolation(range='low', npts=20, function='guinier') 
    266         inv.set_extrapolation(range='high', npts=20, function='power_law', power=4) 
     265        inv.set_extrapolation(range='low', npts=10, function='guinier') 
     266        inv.set_extrapolation(range='high', npts=10, function='power_law', power=4) 
    267267         
    268268        # The version of the call without error 
     
    351351        inv = invariant.InvariantCalculator(data=self.data_q_smear) 
    352352        # Set the extrapolation parameters for the high-Q range 
    353         inv.set_extrapolation(range='high', npts=20, function='power_law', power=4) 
     353        inv.set_extrapolation(range='high', npts=10, function='power_law', power=4) 
    354354        # The version of the call without error 
    355355        qstar = inv.get_qstar(extrapolation='high') 
     
    372372        inv = invariant.InvariantCalculator(data=self.data_q_smear) 
    373373        # Set the extrapolation parameters for the low- and high-Q ranges 
    374         inv.set_extrapolation(range='low', npts=20, function='guinier') 
    375         inv.set_extrapolation(range='high', npts=20, function='power_law', power=4) 
     374        inv.set_extrapolation(range='low', npts=10, function='guinier') 
     375        inv.set_extrapolation(range='high', npts=10, function='power_law', power=4) 
    376376        # The version of the call without error 
    377377        # The function parameter defaults to None, then is picked to be 'power_law' for extrapolation='high' 
     
    384384         
    385385        # Test results 
    386         self.assertAlmostEquals(qstar, 0.002157677) 
     386        self.assertAlmostEquals(qstar, 0.0021621) 
    387387        self.assertAlmostEquals(v, 0.202846825) 
    388388        self.assertAlmostEquals(s, 9.42e+2,2) 
Note: See TracChangeset for help on using the changeset viewer.