2019-08-19 13:46:14 +02:00
|
|
|
########################################################################################
|
|
|
|
|
# This example generates a derived property in an synchronous manner
|
|
|
|
|
# Meaning it completes reading each result before calculating the derived result
|
|
|
|
|
# See InputPropTestAsync for how to do this asynchronously instead.
|
|
|
|
|
########################################################################################
|
2019-06-03 21:11:27 +02:00
|
|
|
import rips
|
2019-06-04 10:34:31 +02:00
|
|
|
import time
|
2019-08-14 09:14:12 +02:00
|
|
|
import grpc
|
2019-05-30 18:52:38 +02:00
|
|
|
|
2019-06-03 21:11:27 +02:00
|
|
|
resInsight = rips.Instance.find()
|
2019-06-04 10:34:31 +02:00
|
|
|
start = time.time()
|
2019-06-03 14:33:16 +02:00
|
|
|
case = resInsight.project.case(id=0)
|
2019-05-30 18:52:38 +02:00
|
|
|
|
2019-08-19 13:46:14 +02:00
|
|
|
# Read poro result into list
|
2019-08-07 23:33:08 +02:00
|
|
|
poroResults = case.properties.activeCellProperty('STATIC_NATIVE', 'PORO', 0)
|
2019-08-19 13:46:14 +02:00
|
|
|
# Read permx result into list
|
2019-08-07 23:33:08 +02:00
|
|
|
permxResults = case.properties.activeCellProperty('STATIC_NATIVE', 'PERMX', 0)
|
2019-05-30 18:52:38 +02:00
|
|
|
|
2019-08-19 13:46:14 +02:00
|
|
|
# Generate output result
|
2019-06-03 14:33:16 +02:00
|
|
|
results = []
|
|
|
|
|
for (poro, permx) in zip(poroResults, permxResults):
|
|
|
|
|
results.append(poro * permx)
|
|
|
|
|
|
2019-08-19 13:46:14 +02:00
|
|
|
try:
|
|
|
|
|
# Send back output result
|
2019-08-14 09:14:12 +02:00
|
|
|
case.properties.setActiveCellProperty(results, 'GENERATED', 'POROPERMXSY', 0)
|
|
|
|
|
except grpc.RpcError as e:
|
|
|
|
|
print("Exception Received: ", e)
|
|
|
|
|
|
2019-05-30 18:52:38 +02:00
|
|
|
|
2019-06-04 10:34:31 +02:00
|
|
|
end = time.time()
|
|
|
|
|
print("Time elapsed: ", end - start)
|
2019-08-19 13:46:14 +02:00
|
|
|
print("Transferred all results back")
|
|
|
|
|
|
|
|
|
|
view = case.views()[0].applyCellResult('GENERATED', 'POROPERMXSY')
|