Beispiel #1
0
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)
Beispiel #2
0
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)
Beispiel #3
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)
Beispiel #4
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)
Beispiel #5
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)
Beispiel #6
0
def newName(field, varname, copy=0):
    """ create a new field with a new parameter name """
    return GridUtil.setParamType(field, varname, copy)
Beispiel #7
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)
Beispiel #8
0
def newName(field, varname, copy = 0):
  """ create a new field with a new parameter name """
  return GridUtil.setParamType(field, varname, copy)