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 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)