def test_sectorphi_full(self):
     """
         Test sector averaging
     """
     r = SectorPhi(r_min=self.qmin, r_max=3*self.qmin, 
                   phi_min=0, phi_max=math.pi*2.0)
     r.nbins_phi = 20
     o = r(self.data)
     for i in range(7):
         self.assertEqual(o.y[i], 1.0)
 def test_sectorphi_partial(self):
     """
     """
     phi_max = math.pi * 1.5
     r = SectorPhi(r_min=self.qmin, r_max=3*self.qmin, 
                   phi_min=0, phi_max=phi_max)
     self.assertEqual(r.phi_max, phi_max)
     r.nbins_phi = 20
     o = r(self.data)
     self.assertEqual(r.phi_max, phi_max)
     for i in range(17):
         self.assertEqual(o.y[i], 1.0)
Exemple #3
0
 def test_sectorphi_full(self):
     """
         Test sector averaging
     """
     r = SectorPhi(r_min=self.qmin,
                   r_max=3 * self.qmin,
                   phi_min=0,
                   phi_max=math.pi * 2.0)
     r.nbins_phi = 20
     o = r(self.data)
     for i in range(7):
         self.assertEqual(o.y[i], 1.0)
Exemple #4
0
 def test_sectorphi_partial(self):
     """
     """
     phi_max = math.pi * 1.5
     r = SectorPhi(r_min=self.qmin,
                   r_max=3 * self.qmin,
                   phi_min=0,
                   phi_max=phi_max)
     self.assertEqual(r.phi_max, phi_max)
     r.nbins_phi = 20
     o = r(self.data)
     self.assertEqual(r.phi_max, phi_max)
     for i in range(17):
         self.assertEqual(o.y[i], 1.0)
    def test_sectorphi_quarter(self):
        """
            Test sector averaging I(phi)
            The test data was not generated by IGOR.
        """
        from sas.dataloader.manipulations import SectorPhi
        import math
        
        r = SectorPhi(r_min=.005, r_max=.01, phi_min=0, phi_max=math.pi/2.0)
        r.nbins_phi = 20
        o = r(self.data)

        answer = Loader().load('sectorphi_testdata.txt')
        for i in range(len(o.x)):
            self.assertAlmostEqual(o.x[i], answer.x[i], 4)
            self.assertAlmostEqual(o.y[i], answer.y[i], 4)
            self.assertAlmostEqual(o.dy[i], answer.dy[i], 4)
Exemple #6
0
    def test_sectorphi_quarter(self):
        """
            Test sector averaging I(phi)
            The test data was not generated by IGOR.
        """
        from sas.dataloader.manipulations import SectorPhi
        import math

        r = SectorPhi(r_min=.005, r_max=.01, phi_min=0, phi_max=math.pi / 2.0)
        r.nbins_phi = 20
        o = r(self.data)

        answer = Loader().load('sectorphi_testdata.txt')
        for i in range(len(o.x)):
            self.assertAlmostEqual(o.x[i], answer.x[i], 4)
            self.assertAlmostEqual(o.y[i], answer.y[i], 4)
            self.assertAlmostEqual(o.dy[i], answer.dy[i], 4)