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
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
def newUnit(field, varname, unitname): """ set the name and unit on a grid """ newunit = Util.parseUnit(unitname) newType = Util.makeRealType(varname, newunit) return GridUtil.setParamType(field, newType, 0)
def newUnit(field, varname, unitname): """ set the name and unit on a grid """ newunit = Util.parseUnit(unitname) newType = Util.makeRealType(varname, newunit) return GridUtil.setParamType(field, newType,0)