Beispiel #1
0
 def test_to_map(self):
     alm = a.Alm(1, 1)
     alm[0, 0] = 1
     d = alm.to_map(32, 'RING')
     np.testing.assert_almost_equal(
         d,
         np.ones(12 * 32**2, dtype=np.float) * 0.2820948)
Beispiel #2
0
 def test_from_map(self):
     alm = a.Alm(1,1)
     d = np.ones(12*32**2, dtype=np.float32)
     alm.from_map(d, 3)
     self.assertAlmostEqual(alm[0,0], 3.5449077018110313)
     self.assertAlmostEqual(alm[1,0], 0)
     self.assertAlmostEqual(alm[1,1], 0)
Beispiel #3
0
 def test_get_set(self):
     alm = a.Alm(1,1)
     data = np.array([1+1j, 2+2j, 3+3j], dtype=np.complex128)
     alm.set_data(data)
     self.assertEqual(alm[0,0], data[0])
     self.assertEqual(alm[1,0], data[1])
     self.assertEqual(alm[1,1], data[2])
     alm[1,1] = 4+4j
     self.assertEqual(alm[1,1], 4+4j)
Beispiel #4
0
 def test_alm_create(self):
     while True: alm = a.Alm(20,20)
Beispiel #5
0
 def setUp(self):
     self.alm = a.Alm(10,10)
Beispiel #6
0
 def test_set_to_zero(self):
     alm = a.Alm(3,3)
     np.testing.assert_equal(alm.get_data(), 0)
Beispiel #7
0
 def test_set_data(self):
     alm = a.Alm(1,1)
     data = np.array([1+1j, 2+2j, 3+3j], dtype=np.complex128)
     alm.set_data(data)
     np.testing.assert_equal(alm.get_data(), data)
Beispiel #8
0
 def test_get_data(self):
     alm = a.Alm(1,1)
     data = alm.get_data()
     self.assertEqual(data.size, 3)
Beispiel #9
0
 def test_init(self):
     """Test initializing a aipy._alm object"""
     alm = a.Alm(10, 5)
     self.assertEqual(alm.lmax(), 10)
     self.assertEqual(alm.mmax(), 5)
     self.assertRaises(Exception, a.Alm, 5, 10)