当前位置: 首页>>代码示例>>Python>>正文


Python EclSum.getSimulationLength方法代码示例

本文整理汇总了Python中ert.ecl.EclSum.getSimulationLength方法的典型用法代码示例。如果您正苦于以下问题:Python EclSum.getSimulationLength方法的具体用法?Python EclSum.getSimulationLength怎么用?Python EclSum.getSimulationLength使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ert.ecl.EclSum的用法示例。


在下文中一共展示了EclSum.getSimulationLength方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: EclCase

# 需要导入模块: from ert.ecl import EclSum [as 别名]
# 或者: from ert.ecl.EclSum import getSimulationLength [as 别名]
class EclCase(object):
    def __init__(self , case):
        self.case = case

        self.grid = None
        self.restart = None
        self.init = None
        self.summary = None
        
        self.loadSummary( )


    def __contains__(self , key):
        return key in self.summary

    
    def keys(self):
        return self.summary.keys()


    def wells(self):
        return self.summary.wells( )
            
    def loadSummary(self):
        self.summary = EclSum( self.case )


    def startTimeEqual(self , other):
        if self.summary.getDataStartTime() == other.summary.getDataStartTime():
            return True
        else:
            return False

    def endTimeEqual(self , other):
        if self.summary.getEndTime() == other.summary.getEndTime():
            return True
        else:
            return False


    def cmpSummaryVector(self , other , key , sample = 100):
        if key in self and key in other:
            days_total = min( self.summary.getSimulationLength() , other.summary.getSimulationLength() )
            dt = days_total / (sample - 1)
            days = [ x * dt for x in range(sample) ]
            
            ref_data = self.summary.get_interp_vector( key , days_list = days )
            test_data = other.summary.get_interp_vector( key , days_list = days )
            diff_data = ref_data - test_data

            ref_sum = sum(ref_data)
            diff_sum = sum( abs(diff_data) )
            return (diff_sum , ref_sum)
        else:
            raise KeyError("Key:%s was not present in both cases" % key)
开发者ID:Ensembles,项目名称:ert,代码行数:57,代码来源:ecl_cmp.py

示例2: test_labscale

# 需要导入模块: from ert.ecl import EclSum [as 别名]
# 或者: from ert.ecl.EclSum import getSimulationLength [as 别名]
 def test_labscale(self):
     case = self.createTestPath("Statoil/ECLIPSE/LabScale/HDMODEL")
     sum = EclSum( case )
     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() , 0.8125 )
开发者ID:agchitu,项目名称:ert,代码行数:8,代码来源:test_ecl_sum.py


注:本文中的ert.ecl.EclSum.getSimulationLength方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。