python FieldProperties can return numpy double arrays.

This commit is contained in:
Steinar Foss
2019-12-23 11:35:52 +01:00
parent d6c1d64ba0
commit d3a4b536d2
3 changed files with 23 additions and 13 deletions

View File

@@ -32,11 +32,11 @@ if (test_field_props()):
def test_getitem(self):
p = self.props
poro = p['PORO']
poro = p.get_double_array('PORO')
self.assertEqual(324, len(poro))
self.assertEqual(0.13, poro[0])
self.assertTrue( 'PERMX' in p )
px = p['PERMX']
px = p.get_double_array('PERMX')
print(len(px))
self.assertEqual(324, len(px))
@@ -47,7 +47,7 @@ if (test_field_props()):
field_props = self.props
grid = self.spe3.grid()
permx = field_props['PERMX']
permx = field_props.get_double_array('PERMX')
print('set(PERMX) = %s' % set(permx))
# 130mD, 40mD, 20mD, and 150mD, respectively, top to bottom
darcys = {0:md2si(130), 1:md2si(40), 2:md2si(20), 3:md2si(150)}

View File

@@ -19,6 +19,9 @@ class TestProps(unittest.TestCase):
def setUp(self):
parser = Parser()
deck = parser.parse(test_path('spe3/SPE3CASE1.DATA'))
#int_array = np.array([0, 1, 2, 3])
#hbnum_kw = DeckKeyword( parser["HBNUM"], int_array)
#deck.add(hbnum_kw)
self.spe3 = EclipseState(deck)
self.props = self.spe3.ecl3d_props()
if (not test_field_props()):