Esempio n. 1
0
def makeVector(a,b):
  """ Make a vector from 2 components
  <div class=jython>
      makeVector(a,b) = [a,b]
  </div>
  """
  return DerivedGridFactory.createFlowVectors(a,b)
Esempio n. 2
0
def makeFlowField(a,b,c):
  """ Make a vector from 3 components
  <div class=jython>
      makeVector(a,b,c) = [a,b,c]
  </div>
  """
  return DerivedGridFactory.createFlowVectors(a,b,c)
Esempio n. 3
0
def makeFlowField(a, b, c):
    """ Make a vector from 3 components
  <div class=jython>
      makeVector(a,b,c) = [a,b,c]
  </div>
  """
    return DerivedGridFactory.createFlowVectors(a, b, c)
Esempio n. 4
0
def makeVector(a, b):
    """ Make a vector from 2 components
  <div class=jython>
      makeVector(a,b) = [a,b]
  </div>
  """
    return DerivedGridFactory.createFlowVectors(a, b)
Esempio n. 5
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)
Esempio n. 6
0
def extractPressureFromNWPGrid(fieldimpl):
    """Get the pressure coordinate from a time series grid and
     return a grid of the pressure at all points.  Input
     grid must have pressure or height (which is converted
     to pressure in the standard atmosphere).
     User must be sure input is a suitable FlatField.
  """
    ff = fieldimpl.getSample(0)
    return DerivedGridFactory.createPressureGridFromDomain(ff)
Esempio n. 7
0
def extractPressureFromNWPGrid(fieldimpl):
  """Get the pressure coordinate from a time series grid and
     return a grid of the pressure at all points.  Input
     grid must have pressure or height (which is converted
     to pressure in the standard atmosphere).
     User must be sure input is a suitable FlatField.
  """
  ff = fieldimpl.getSample(0)
  return DerivedGridFactory.createPressureGridFromDomain(ff)
Esempio n. 8
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)
Esempio n. 9
0
def horizontalAdvection(param, vector):
    """ horizontal advection """
    u = DerivedGridFactory.getUComponent(vector)
    v = DerivedGridFactory.getVComponent(vector)
    return DerivedGridFactory.createHorizontalAdvection(param, u, v)
Esempio n. 10
0
def horizontalAdvection(param, u, v):
    """ horizontal advection """
    return DerivedGridFactory.createHorizontalAdvection(param, u, v)
Esempio n. 11
0
def makeTrueVector(u, v):
    """ true wind vectors """
    return DerivedGridFactory.createTrueWindVectors(u, v)
Esempio n. 12
0
def flowVector(field):
  """ Make a vector from flow direction"""
  a=newName(sin(field),"a")
  b=newName(cos(field),"b")
  return DerivedGridFactory.createFlowVectors(a,b)
Esempio n. 13
0
def maskGrid(grid, mask, value=0, resample=0):
    """mask one grid by the values in the other.  value is the masking value"""
    return DerivedGridFactory.mask(grid, mask, value, resample)
Esempio n. 14
0
def horizontalAdvection(param, u, v):
  """ horizontal advection """
  return DerivedGridFactory.createHorizontalAdvection(param,u,v)
Esempio n. 15
0
def layerAverage(grid, top, bottom, unit=None):
   """ Wrapper for calculating layer average """
   return DerivedGridFactory.createLayerAverage(grid, top, bottom, unit)
Esempio n. 16
0
def horizontalDivergence(param, u, v):
  """ horizontal flux divergence """
  return DerivedGridFactory.createHorizontalFluxDivergence(param,u,v)
Esempio n. 17
0
def extractLongitudeFromNWPGrid(fieldimpl):
  """Get the longitude coordinate from a grid.  Return a grid
  of the longitudes at each point.
  """
  ff = DerivedGridFactory.createLongitudeGrid(fieldimpl)
  return ff
Esempio n. 18
0
def maskGrid(grid, mask, value=0,resample=0):
    """mask one grid by the values in the other.  value is the masking value"""
    return DerivedGridFactory.mask(grid, mask, value, resample)
Esempio n. 19
0
def makeTopographyFromField(grid):
    """make a topography out of a grid """
    c = newUnit(grid, "topo", "m")
    return DerivedGridFactory.create2DTopography(grid,c)
Esempio n. 20
0
def horizontalDivergence(param, u, v):
    """ horizontal flux divergence """
    return DerivedGridFactory.createHorizontalFluxDivergence(param, u, v)
Esempio n. 21
0
def combineFields(*a):
    """ combine several fields together """
    return DerivedGridFactory.combineGrids(a)
Esempio n. 22
0
def thetaSurfaceV(gridt, griduv, theta0):
    return DerivedGridFactory.extractVectorGridOverThetaTopoSurface(
        gridt, griduv, float(theta0))
Esempio n. 23
0
def flowVector(field):
    """ Make a vector from flow direction"""
    a = newName(sin(field), "a")
    b = newName(cos(field), "b")
    return DerivedGridFactory.createFlowVectors(a, b)
Esempio n. 24
0
def extractLongitudeFromNWPGrid(fieldimpl):
    """Get the longitude coordinate from a grid.  Return a grid
  of the longitudes at each point.
  """
    ff = DerivedGridFactory.createLongitudeGrid(fieldimpl)
    return ff
Esempio n. 25
0
def makeTopographyFromField(grid):
    """make a topography out of a grid """
    c = newUnit(grid, "topo", "m")
    return DerivedGridFactory.create2DTopography(grid, c)
Esempio n. 26
0
def makeTrueVector(u, v):
  """ true wind vectors """
  return DerivedGridFactory.createTrueWindVectors(u,v)
Esempio n. 27
0
def thetaSurfaceA(grid, grid1, theta0):
    return DerivedGridFactory.extractGridOverThetaTopoSurface(
        grid, grid1, float(theta0))
Esempio n. 28
0
def combineFields(*a):
  """ combine several fields together """
  return DerivedGridFactory.combineGrids(a)
Esempio n. 29
0
def thetaSurfaceADV(gridt, griduv, other, theta0):
    return DerivedGridFactory.extractGridADVOverThetaTopoSurface(
        gridt, griduv, other, float(theta0))
Esempio n. 30
0
def layerAverage(grid, top, bottom, unit=None):
    """ Wrapper for calculating layer average """
    return DerivedGridFactory.createLayerAverage(grid, top, bottom, unit)
Esempio n. 31
0
def layerDiff(grid, top, bottom, unit=None):
    """ Wrapper for calculating layer difference """
    return DerivedGridFactory.createLayerDifference(grid, top, bottom, unit)
Esempio n. 32
0
def layerDiff(grid, top, bottom, unit=None):
   """ Wrapper for calculating layer difference """
   return DerivedGridFactory.createLayerDifference(grid, top, bottom, unit)