2019-06-04 08:43:57 +02:00
|
|
|
import sys
|
|
|
|
|
import os
|
|
|
|
|
sys.path.insert(1, os.path.join(sys.path[0], '..'))
|
|
|
|
|
import rips
|
|
|
|
|
import itertools
|
|
|
|
|
import time
|
|
|
|
|
|
|
|
|
|
resInsight = rips.Instance.find()
|
2019-06-04 10:34:31 +02:00
|
|
|
|
|
|
|
|
start = time.time()
|
2019-06-04 08:43:57 +02:00
|
|
|
case = resInsight.project.case(id=0)
|
|
|
|
|
grid = case.grid(index = 0)
|
|
|
|
|
|
|
|
|
|
timeSteps = case.timeSteps()
|
|
|
|
|
|
|
|
|
|
averages = []
|
2019-06-04 10:34:31 +02:00
|
|
|
for i in range(0, len(timeSteps.dates)):
|
2019-06-04 08:43:57 +02:00
|
|
|
resultChunks = case.properties.activeCellProperty('DYNAMIC_NATIVE', 'SOIL', i)
|
|
|
|
|
mysum = 0.0
|
|
|
|
|
count = 0
|
|
|
|
|
for chunk in resultChunks:
|
|
|
|
|
mysum += sum(chunk.values)
|
|
|
|
|
count += len(chunk.values)
|
|
|
|
|
|
|
|
|
|
averages.append(mysum/count)
|
|
|
|
|
|
|
|
|
|
end = time.time()
|
|
|
|
|
print("Time elapsed: ", end - start)
|
|
|
|
|
print(averages)
|