2020-04-01 06:32:27 -05:00
|
|
|
import rips
|
2020-04-15 06:23:05 -05:00
|
|
|
import time
|
2020-04-07 03:16:27 -05:00
|
|
|
|
2020-04-01 06:32:27 -05:00
|
|
|
resinsight = rips.Instance.find()
|
|
|
|
|
|
|
|
project = resinsight.project
|
|
|
|
|
2020-04-15 06:23:05 -05:00
|
|
|
# Use the following commented lines to import a file from disk
|
|
|
|
# filename = "path/to/file/1_R001_REEK-0.SMSPEC"
|
|
|
|
# summary_case = project.import_summary_case(filename)
|
|
|
|
|
|
|
|
# Assumes at least one summery case loaded with case_id 1
|
|
|
|
summary_case = project.summary_case(1)
|
|
|
|
if summary_case is None:
|
|
|
|
print("No summary case found")
|
|
|
|
exit()
|
2020-04-01 06:32:27 -05:00
|
|
|
|
|
|
|
vector_name = "FOPT"
|
2020-04-15 06:23:05 -05:00
|
|
|
summary_data = summary_case.summary_vector_values(vector_name)
|
2020-04-01 06:32:27 -05:00
|
|
|
|
|
|
|
print("Data for summary vector " + vector_name)
|
2020-04-07 03:16:27 -05:00
|
|
|
print(summary_data.values)
|
|
|
|
|
2020-04-15 06:23:05 -05:00
|
|
|
time_steps = summary_case.available_time_steps()
|
2020-04-07 03:16:27 -05:00
|
|
|
print(time_steps.values)
|
2020-04-15 06:23:05 -05:00
|
|
|
|
|
|
|
summary_data_sampled = summary_case.resample_values("FOPT", "QUARTER")
|
|
|
|
print("\nResampled data")
|
|
|
|
|
|
|
|
for t, value in zip(summary_data_sampled.time_steps, summary_data_sampled.values):
|
|
|
|
print(time.strftime("%a, %d %b %Y ", time.gmtime(t)) + " | " + str(value))
|