Changeset 437a9f0 in sasview for Invariant/test
- Timestamp:
- Dec 1, 2009 4:21:19 PM (15 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:
- 7a108dd
- Parents:
- c5607fa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Invariant/test/utest_use_cases.py
ref9ed58 r437a9f0 93 93 # parameters. For instance, you might not want to allow 'high' and 'guinier'. 94 94 # 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') 96 96 97 97 # The version of the call without error … … 108 108 109 109 # Test results 110 self.assertAlmostEquals(qstar, 7.49e-5 ,2)110 self.assertAlmostEquals(qstar, 7.49e-5) 111 111 self.assertAlmostEquals(v, 0.005648401) 112 112 self.assertAlmostEquals(s, 9.42e+2,2) … … 120 120 121 121 # 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) 123 123 124 124 # The version of the call without error … … 146 146 147 147 # 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) 150 150 151 151 # The version of the call without error … … 161 161 162 162 # Test results 163 self.assertAlmostEquals(qstar, 7. 90069e-5,2)163 self.assertAlmostEquals(qstar, 7.88981e-5,2) 164 164 self.assertAlmostEquals(v, 0.005952674) 165 165 self.assertAlmostEquals(s, 9.42e+2,2) … … 213 213 inv = invariant.InvariantCalculator(data=self.data_slit_smear) 214 214 # 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') 216 216 # The version of the call without error 217 217 # At this point, we could still compute Q* without extrapolation by calling … … 237 237 238 238 # 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) 240 240 241 241 # The version of the call without error … … 263 263 264 264 # 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) 267 267 268 268 # The version of the call without error … … 351 351 inv = invariant.InvariantCalculator(data=self.data_q_smear) 352 352 # 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) 354 354 # The version of the call without error 355 355 qstar = inv.get_qstar(extrapolation='high') … … 372 372 inv = invariant.InvariantCalculator(data=self.data_q_smear) 373 373 # 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) 376 376 # The version of the call without error 377 377 # The function parameter defaults to None, then is picked to be 'power_law' for extrapolation='high' … … 384 384 385 385 # Test results 386 self.assertAlmostEquals(qstar, 0.0021 57677)386 self.assertAlmostEquals(qstar, 0.0021621) 387 387 self.assertAlmostEquals(v, 0.202846825) 388 388 self.assertAlmostEquals(s, 9.42e+2,2)
Note: See TracChangeset
for help on using the changeset viewer.