Ejemplo 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)
Ejemplo 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)
Ejemplo 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)
Ejemplo 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)
Ejemplo 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)
Ejemplo 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)
Ejemplo 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)
Ejemplo 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)
Ejemplo n.º 9
0
def horizontalAdvection(param, vector):
    """ horizontal advection """
    u = DerivedGridFactory.getUComponent(vector)
    v = DerivedGridFactory.getVComponent(vector)
    return DerivedGridFactory.createHorizontalAdvection(param, u, v)
Ejemplo n.º 10
0
def horizontalAdvection(param, u, v):
    """ horizontal advection """
    return DerivedGridFactory.createHorizontalAdvection(param, u, v)
Ejemplo n.º 11
0
def makeTrueVector(u, v):
    """ true wind vectors """
    return DerivedGridFactory.createTrueWindVectors(u, v)
Ejemplo 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)
Ejemplo 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)
Ejemplo n.º 14
0
def horizontalAdvection(param, u, v):
  """ horizontal advection """
  return DerivedGridFactory.createHorizontalAdvection(param,u,v)
Ejemplo n.º 15
0
def layerAverage(grid, top, bottom, unit=None):
   """ Wrapper for calculating layer average """
   return DerivedGridFactory.createLayerAverage(grid, top, bottom, unit)
Ejemplo n.º 16
0
def horizontalDivergence(param, u, v):
  """ horizontal flux divergence """
  return DerivedGridFactory.createHorizontalFluxDivergence(param,u,v)
Ejemplo 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
Ejemplo 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)
Ejemplo n.º 19
0
def makeTopographyFromField(grid):
    """make a topography out of a grid """
    c = newUnit(grid, "topo", "m")
    return DerivedGridFactory.create2DTopography(grid,c)
Ejemplo n.º 20
0
def horizontalDivergence(param, u, v):
    """ horizontal flux divergence """
    return DerivedGridFactory.createHorizontalFluxDivergence(param, u, v)
Ejemplo n.º 21
0
def combineFields(*a):
    """ combine several fields together """
    return DerivedGridFactory.combineGrids(a)
Ejemplo n.º 22
0
def thetaSurfaceV(gridt, griduv, theta0):
    return DerivedGridFactory.extractVectorGridOverThetaTopoSurface(
        gridt, griduv, float(theta0))
Ejemplo 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)
Ejemplo 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
Ejemplo n.º 25
0
def makeTopographyFromField(grid):
    """make a topography out of a grid """
    c = newUnit(grid, "topo", "m")
    return DerivedGridFactory.create2DTopography(grid, c)
Ejemplo n.º 26
0
def makeTrueVector(u, v):
  """ true wind vectors """
  return DerivedGridFactory.createTrueWindVectors(u,v)
Ejemplo n.º 27
0
def thetaSurfaceA(grid, grid1, theta0):
    return DerivedGridFactory.extractGridOverThetaTopoSurface(
        grid, grid1, float(theta0))
Ejemplo n.º 28
0
def combineFields(*a):
  """ combine several fields together """
  return DerivedGridFactory.combineGrids(a)
Ejemplo n.º 29
0
def thetaSurfaceADV(gridt, griduv, other, theta0):
    return DerivedGridFactory.extractGridADVOverThetaTopoSurface(
        gridt, griduv, other, float(theta0))
Ejemplo n.º 30
0
def layerAverage(grid, top, bottom, unit=None):
    """ Wrapper for calculating layer average """
    return DerivedGridFactory.createLayerAverage(grid, top, bottom, unit)
Ejemplo n.º 31
0
def layerDiff(grid, top, bottom, unit=None):
    """ Wrapper for calculating layer difference """
    return DerivedGridFactory.createLayerDifference(grid, top, bottom, unit)
Ejemplo n.º 32
0
def layerDiff(grid, top, bottom, unit=None):
   """ Wrapper for calculating layer difference """
   return DerivedGridFactory.createLayerDifference(grid, top, bottom, unit)