本文整理汇总了Python中ucar.unidata.data.grid.GridUtil.sliceAtLevel方法的典型用法代码示例。如果您正苦于以下问题:Python GridUtil.sliceAtLevel方法的具体用法?Python GridUtil.sliceAtLevel怎么用?Python GridUtil.sliceAtLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ucar.unidata.data.grid.GridUtil
的用法示例。
在下文中一共展示了GridUtil.sliceAtLevel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getSliceAtLevel
# 需要导入模块: from ucar.unidata.data.grid import GridUtil [as 别名]
# 或者: from ucar.unidata.data.grid.GridUtil import sliceAtLevel [as 别名]
def getSliceAtLevel(fieldimpl, level) :
"""Extract a 2D horizontal slice from a 3D grid at "Level."
level is a real number; must be appropriate for the grid.
param fieldimpl is a grid which may have one or more time steps. """
level = float(level)
ff = GridUtil.sliceAtLevel(fieldimpl, level)
return ff
示例2: getSliceAtAltitude
# 需要导入模块: from ucar.unidata.data.grid import GridUtil [as 别名]
# 或者: from ucar.unidata.data.grid.GridUtil import sliceAtLevel [as 别名]
def getSliceAtAltitude(fieldimpl, alt, unit="m") :
""" Extract a 2D horizontal slice from a 3D grid at the given altitude;
level is a real number; if unit is supplied, it must
be compatible with meters (ft, fathoms, etc)
param fieldimpl is a grid which may have
one or more time steps. """
#import methods from
from visad import RealType
from visad import Real
alt = float(alt)
unit = Util.parseUnit(unit)
altitude = Real(RealType.Altitude, alt, unit)
ff = GridUtil.sliceAtLevel(fieldimpl, altitude)
return ff