Ignore:
Timestamp:
Feb 18, 2015 5:28:13 AM (9 years ago)
Author:
krzywon
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:
ddc192a
Parents:
d838715
Message:

Fixed the failing test associated with data loading and sector averaging
in utest_averaging.py. The ascii data loader throws out values where q=0
but the calculator does not resulting causing the first issue. The 2nd
issue was invalid starting and ending points in the sector calculation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/sasdataloader/test/utest_averaging.py

    r35ec279 ref3445e2  
    105105        r = Ring(r_min=.005, r_max=.01,  
    106106                 center_x=self.data.detector[0].beam_center.x,  
    107                  center_y=self.data.detector[0].beam_center.y) 
    108         r.nbins_phi = 20 
     107                 center_y=self.data.detector[0].beam_center.y, 
     108                 nbins = 20) 
     109        ##r.nbins_phi = 20 
    109110         
    110111        o = r(self.data) 
    111112        answer = Loader().load('ring_testdata.txt') 
    112         for i in range(r.nbins_phi): 
    113             self.assertAlmostEqual(o.x[i], answer.x[i], 4) 
    114             self.assertAlmostEqual(o.y[i], answer.y[i], 4) 
    115             self.assertAlmostEqual(o.dy[i], answer.dy[i], 4) 
     113         
     114        for i in range(r.nbins_phi - 1): 
     115            self.assertAlmostEqual(o.x[i + 1], answer.x[i], 4) 
     116            self.assertAlmostEqual(o.y[i + 1], answer.y[i], 4) 
     117            self.assertAlmostEqual(o.dy[i + 1], answer.dy[i], 4) 
    116118             
    117119    def test_circularavg(self): 
     
    194196        import math 
    195197         
    196         r = SectorPhi(r_min=.005, r_max=.01, phi_min=0, phi_max=math.pi*2.0) 
    197         r.nbins_phi = 20 
     198        r = SectorPhi(r_min=.005, 
     199                      r_max=.01, 
     200                      phi_min=0.15707963, 
     201                      phi_max=math.pi*2.-0.15707963, 
     202                      nbins=19) 
    198203        o = r(self.data) 
    199204 
Note: See TracChangeset for help on using the changeset viewer.