def mycombineRGB(red, green, blue): """Three Color (RGB) Image (Auto-scale) formula.""" global uniqueID uniqueID += 1 red = GridUtil.setParamType(red, makeRealType("redimage%d" % uniqueID), 0) green = GridUtil.setParamType(green, makeRealType("greenimage%d" % uniqueID), 0) blue = GridUtil.setParamType(blue, makeRealType("blueimage%d" % uniqueID), 0) return DerivedGridFactory.combineGrids([red, green, blue], 1)
def mycombineRGB(red, green, blue): """Three Color (RGB) Image (Auto-scale) formula.""" global uniqueID uniqueID += 1 red = GridUtil.setParamType(red, makeRealType("redimage%d" % uniqueID), 0) green = GridUtil.setParamType(green, makeRealType("greenimage%d" % uniqueID), 0) blue = GridUtil.setParamType(blue, makeRealType("blueimage%d" % uniqueID), 0) return DerivedGridFactory.combineGrids([red, green, blue], 1)
def noUnit(field): """ remove the units from a grid """ import visad from visad import CommonUnit newunit = CommonUnit.promiscuous rt = GridUtil.getParamType(field).getRealComponents()[0] newType = Util.makeRealType(rt.getName(), visad.CommonUnit.promiscuous) return GridUtil.setParamType(field, newType, 0)
def noUnit(field): """ remove the units from a grid """ import visad from visad import CommonUnit newunit = CommonUnit.promiscuous rt = GridUtil.getParamType(field).getRealComponents()[0] newType = Util.makeRealType(rt.getName(), visad.CommonUnit.promiscuous) 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)
def newName(field, varname, copy=0): """ create a new field with a new parameter name """ return GridUtil.setParamType(field, varname, copy)
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 newName(field, varname, copy = 0): """ create a new field with a new parameter name """ return GridUtil.setParamType(field, varname, copy)