Updates to data objects.

This commit is contained in:
rowanc1
2014-03-17 09:55:34 -07:00
parent 31da380804
commit 5c4ec4a1cd
4 changed files with 49 additions and 164 deletions
+15
View File
@@ -16,6 +16,7 @@ class FieldsTest(unittest.TestCase):
mesh = Mesh.TensorMesh([np.ones(n)*5 for n in [10,11,12]],[0,0,-30])
survey = EM.FDEM.SurveyFDEM(txList)
self.F = EM.FDEM.FieldsFDEM(mesh, survey)
self.D = EM.FDEM.DataFDEM(survey)
self.Tx0 = Tx0
self.Tx1 = Tx1
@@ -68,6 +69,20 @@ class FieldsTest(unittest.TestCase):
self.assertRaises(AssertionError, EM.FDEM.SurveyFDEM, txs)
def test_dataFDEM(self):
V = []
for tx in self.D.survey.txList:
v = np.random.rand(tx.nD)
V += [v]
self.D[tx] = v
self.assertTrue(np.all(v == self.D[tx]))
V = np.concatenate(V)
self.assertTrue(np.all(V == Utils.mkvc(self.D)))
D2 = EM.FDEM.DataFDEM(self.D.survey, V)
self.assertTrue(np.all(Utils.mkvc(D2) == Utils.mkvc(self.D)))