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