예제 #1
0
    def testMakeKernelEpa(self):
        true_kernel = self.epa['kernel'].ravel()
        true_norm = self.epa['norm'].ravel()[0]
        true_m_idx = self.epa['m_idx'].ravel()[0] - 1

        kernel, norm, m_idx = analysis.make_kernel('EPA', 1, 0.001)

        numpy.testing.assert_array_almost_equal(true_kernel, kernel, decimal = 3
                                                )
        self.assertEqual(true_norm, norm, 3)
        self.assertEqual(true_m_idx, m_idx, 3)
예제 #2
0
    def testMakeKernelExpReversed(self):
        """Same as testExp but with direction = -1
        """
        true_kernel = self.exp_reversed['kernel'].ravel()
        true_norm = self.exp_reversed['norm'].ravel()[0]
        true_m_idx = self.exp_reversed['m_idx'].ravel()[0] - 1

        kernel, norm, m_idx = analysis.make_kernel('EXP', 1, 0.001, direction = -1)

        numpy.testing.assert_array_almost_equal(true_kernel, kernel, decimal = 3
                                                )
        self.assertEqual(true_norm, norm, 3)
        self.assertEqual(true_m_idx, m_idx, 3)