コード例 #1
0
ファイル: grid.py プロジェクト: relaxar/mcidasv
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)
コード例 #2
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)
コード例 #3
0
ファイル: grid.py プロジェクト: relaxar/mcidasv
def getAltitude(z):
    """ Change units from geopotential meters to meters """
    import ucar.visad.quantities.GeopotentialAltitude as ga
    import ucar.visad.quantities.Gravity as gr
    zUnit = GridUtil.getParamType(z).getRealComponents()[0].getDefaultUnit()
    if zUnit.equals(ga.getGeopotentialMeter()):
        z = z.divide(gr.newReal())
    return z
コード例 #4
0
def getAltitude(z):
   """ Change units from geopotential meters to meters """
   import ucar.visad.quantities.GeopotentialAltitude as ga
   import ucar.visad.quantities.Gravity as gr
   zUnit = GridUtil.getParamType(z).getRealComponents()[0].getDefaultUnit()
   if zUnit.equals(ga.getGeopotentialMeter()):
      z = z.divide(gr.newReal())
   return z