本文整理汇总了Python中ecl.summary.EclSum.getStartTime方法的典型用法代码示例。如果您正苦于以下问题:Python EclSum.getStartTime方法的具体用法?Python EclSum.getStartTime怎么用?Python EclSum.getStartTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ecl.summary.EclSum
的用法示例。
在下文中一共展示了EclSum.getStartTime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_labscale
# 需要导入模块: from ecl.summary import EclSum [as 别名]
# 或者: from ecl.summary.EclSum import getStartTime [as 别名]
def test_labscale(self):
case = self.createTestPath("Statoil/ECLIPSE/LabScale/HDMODEL")
sum = EclSum(case, lazy_load=True)
self.assertEqual(sum.getStartTime(), datetime.datetime(2013,1,1,0,0,0))
self.assertEqual(sum.getEndTime() , datetime.datetime(2013,1,1,19,30,0))
self.assertFloatEqual(sum.getSimulationLength(), 19.50)
sum = EclSum(case, lazy_load=False)
self.assertEqual(sum.getStartTime(), datetime.datetime(2013,1,1,0,0,0))
self.assertEqual(sum.getEndTime() , datetime.datetime(2013,1,1,19,30,0))
self.assertFloatEqual(sum.getSimulationLength(), 19.50)
示例2: EclSum
# 需要导入模块: from ecl.summary import EclSum [as 别名]
# 或者: from ecl.summary.EclSum import getStartTime [as 别名]
"2014-10-01": 84.40,
"2014-11-01": 75.79,
"2014-12-01": 59.29,
"2015-01-01": 47.22,
"2015-02-01": 50.58,
"2015-03-01": 47.82,
"2015-04-01": 54.45,
"2015-05-01": 59.27,
"2015-06-01": 59.82,
"2015-07-01": 50.90,
"2015-08-01": 42.87,
"2015-09-01": 45.48}
if __name__ == '__main__':
ecl_sum = EclSum("SNAKE_OIL_FIELD")
start_time = ecl_sum.getStartTime()
date_ranges = ecl_sum.timeRange(start_time, interval="1M")
production_sums = ecl_sum.blockedProduction("FOPT", date_ranges)
npv = 0.0
for index in range(0, len(date_ranges) - 1):
date = date_ranges[index + 1] # end of period
production_sum = production_sums[index]
oil_price = OIL_PRICES[date.date().strftime("%Y-%m-%d")]
production_value = oil_price * production_sum
npv += production_value
with open("snake_oil_npv.txt", "w") as output_file:
output_file.write("NPV %s\n" % npv)