Exemplo n.º 1
0
 def test_unpack_calpar(self):
     calpar = np.zeros((2,3,3+2*(self.info.nAntenna+len(self.info.ublcount))), dtype=np.float32)
     m,g,v = Oc.unpack_calpar(self.info,calpar)
     self.assertEqual(m['iter'].shape, (2,3))
     self.assertTrue(np.all(m['iter'] == 0))
     self.assertTrue(np.all(m['chisq'] == 0))
     self.assertEqual(len(g), 32)
     for i in xrange(32):
         self.assertTrue(np.all(g[i] == 1)) # 1 b/c 10**0 = 1
     self.assertEqual(len(v), len(self.info.ublcount))
     ubls = {}
     for i,j in v:
         n = self.info.bl1dmatrix[i,j]
         ubls[self.info.bltoubl[n]] = n
     for u in xrange(len(self.info.ublcount)):
         self.assertTrue(ubls.has_key(u))
Exemplo n.º 2
0
 def test_unpack_calpar(self):
     calpar = np.zeros(
         (2, 3, 3 + 2 * (self.info.nAntenna + len(self.info.ublcount))),
         dtype=np.float32)
     m, g, v = Oc.unpack_calpar(self.info, calpar)
     self.assertEqual(m['iter'].shape, (2, 3))
     self.assertTrue(np.all(m['iter'] == 0))
     self.assertTrue(np.all(m['chisq'] == 0))
     self.assertEqual(len(g), 32)
     for i in xrange(32):
         self.assertTrue(np.all(g[i] == 1))  # 1 b/c 10**0 = 1
     self.assertEqual(len(v), len(self.info.ublcount))
     ubls = {}
     for i, j in v:
         n = self.info.bl1dmatrix[i, j]
         ubls[self.info.bltoubl[n]] = n
     for u in xrange(len(self.info.ublcount)):
         self.assertTrue(ubls.has_key(u))
Exemplo n.º 3
0
 def test_unpack_calpar(self):
     calpar = np.zeros((2,3,Oc.calpar_size(self.info.nAntenna, len(self.info.ublcount))), dtype=np.float32)
     m,g,v = Oc.unpack_calpar(self.info,calpar)
     self.assertEqual(m['iter'].shape, (2,3))
     self.assertEqual(len(filter(lambda s: 'chisq' in s, m.keys()))-1, self.info.nAntenna)
     self.assertTrue(np.all(m['iter'] == 0))
     self.assertTrue(np.all(m['chisq'] == 0))
     for a in self.info.subsetant:
         self.assertTrue(np.all(m['chisq%d'%a] == 0))
     self.assertEqual(len(g), 32)
     for i in xrange(32):
         self.assertTrue(np.all(g[i] == 1)) # 1 b/c 10**0 = 1
     self.assertEqual(len(v), len(self.info.ublcount))
     ubls = {}
     for i,j in v:
         n = self.info.bl1dmatrix[i,j]
         ubls[self.info.bltoubl[n]] = n
     for u in xrange(len(self.info.ublcount)):
         self.assertTrue(ubls.has_key(u))