mirror of
https://github.com/wassname/simpeg.git
synced 2026-08-12 12:30:37 +08:00
Updates to data objects.
This commit is contained in:
@@ -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)))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user