updates to survey time problem

This commit is contained in:
rowanc1
2014-04-27 15:31:54 -07:00
parent 6e3d3863c1
commit a39bf58a2b
2 changed files with 13 additions and 7 deletions
+11 -3
View File
@@ -126,7 +126,7 @@ class FieldsTest_Time(unittest.TestCase):
def test_SetGet(self):
F = self.F
nTx = F.survey.nTx
nT = F.survey.prob.nT
nT = F.survey.prob.nT + 1
e = np.random.rand(F.mesh.nE, nTx, nT)
F[:, 'e'] = e
b = np.random.rand(F.mesh.nF, nTx, nT)
@@ -138,9 +138,13 @@ class FieldsTest_Time(unittest.TestCase):
self.assertTrue(np.all(F[:, 'e'] == e))
self.assertTrue(np.all(F[:, 'b'] == b))
b = np.random.rand(F.mesh.nF,nT)
b = np.random.rand(F.mesh.nF,1,nT)
F[self.Tx0, 'b'] = b
self.assertTrue(np.all(F[self.Tx0, 'b'] == b))
self.assertTrue(np.all(F[self.Tx0, 'b'] == b[:,0,:]))
b = np.random.rand(F.mesh.nF,1,nT)
F[self.Tx0, 'b', 0] = b[:,:,0]
self.assertTrue(np.all(F[self.Tx0, 'b', 0] == b[:,0,0]))
phi = np.random.rand(F.mesh.nC,2,nT)
F[[self.Tx0,self.Tx1], 'phi'] = phi
@@ -161,6 +165,10 @@ class FieldsTest_Time(unittest.TestCase):
self.assertTrue(np.all(F[self.Tx0,'b',4] == b[:,0,4]))
self.assertTrue(np.all(F[self.Tx1,'b',4] == b[:,1,4]))
b = np.random.rand(F.mesh.nF, 2, nT)
F[[self.Tx0, self.Tx1],'b', 0] = b[:,:,0]
def test_assertions(self):
freq = [self.Tx0, self.Tx1]
bWrongSize = np.random.rand(self.F.mesh.nE, self.F.survey.nTx)