本文整理汇总了Python中cdo.Cdo.thicknessOfLevels方法的典型用法代码示例。如果您正苦于以下问题:Python Cdo.thicknessOfLevels方法的具体用法?Python Cdo.thicknessOfLevels怎么用?Python Cdo.thicknessOfLevels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cdo.Cdo
的用法示例。
在下文中一共展示了Cdo.thicknessOfLevels方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_verticalLevels
# 需要导入模块: from cdo import Cdo [as 别名]
# 或者: from cdo.Cdo import thicknessOfLevels [as 别名]
def test_verticalLevels(self):
cdo = Cdo()
# check, if a given input files has vertival layers of a given thickness array
targetThicknesses = [50.0, 100.0, 200.0, 300.0, 450.0, 600.0, 800.0, 1000.0, 1000.0, 1000.0]
sourceLevels = "25 100 250 500 875 1400 2100 3000 4000 5000".split()
thicknesses = cdo.thicknessOfLevels(input = "-selname,T " + cdo.stdatm(','.join(sourceLevels),options = "-f nc"))
self.assertEqual(targetThicknesses,thicknesses)
示例2: test_bndLevels
# 需要导入模块: from cdo import Cdo [as 别名]
# 或者: from cdo.Cdo import thicknessOfLevels [as 别名]
def test_bndLevels(self):
cdo = Cdo()
ofile = cdo.stdatm(25,100,250,500,875,1400,2100,3000,4000,5000,options = "-f nc")
self.assertEqual([0, 50.0, 150.0, 350.0, 650.0, 1100.0, 1700.0, 2500.0, 3500.0, 4500.0, 5500.0],
cdo.boundaryLevels(input = "-selname,T " + ofile))
self.assertEqual([50.0, 100.0, 200.0, 300.0, 450.0, 600.0, 800.0, 1000.0, 1000.0, 1000.0],
cdo.thicknessOfLevels(input = ofile))
示例3: test_thickness
# 需要导入模块: from cdo import Cdo [as 别名]
# 或者: from cdo.Cdo import thicknessOfLevels [as 别名]
def test_thickness(self):
cdo = Cdo()
levels = "25 100 250 500 875 1400 2100 3000 4000 5000".split(' ')
targetThicknesses = [50.0, 100.0, 200.0, 300.0, 450.0, 600.0, 800.0, 1000.0, 1000.0, 1000.0]
self.assertEqual(targetThicknesses, cdo.thicknessOfLevels(input = "-selname,T -stdatm,"+ ','.join(levels)))