def makeVector(a,b): """ Make a vector from 2 components <div class=jython> makeVector(a,b) = [a,b] </div> """ return DerivedGridFactory.createFlowVectors(a,b)
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)
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)
def makeVector(a, b): """ Make a vector from 2 components <div class=jython> makeVector(a,b) = [a,b] </div> """ return DerivedGridFactory.createFlowVectors(a, b)
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)
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)
def horizontalAdvection(param, vector): """ horizontal advection """ u = DerivedGridFactory.getUComponent(vector) v = DerivedGridFactory.getVComponent(vector) return DerivedGridFactory.createHorizontalAdvection(param, u, v)
def horizontalAdvection(param, u, v): """ horizontal advection """ return DerivedGridFactory.createHorizontalAdvection(param, u, v)
def makeTrueVector(u, v): """ true wind vectors """ return DerivedGridFactory.createTrueWindVectors(u, v)
def flowVector(field): """ Make a vector from flow direction""" a=newName(sin(field),"a") b=newName(cos(field),"b") return DerivedGridFactory.createFlowVectors(a,b)
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)
def horizontalAdvection(param, u, v): """ horizontal advection """ return DerivedGridFactory.createHorizontalAdvection(param,u,v)
def layerAverage(grid, top, bottom, unit=None): """ Wrapper for calculating layer average """ return DerivedGridFactory.createLayerAverage(grid, top, bottom, unit)
def horizontalDivergence(param, u, v): """ horizontal flux divergence """ return DerivedGridFactory.createHorizontalFluxDivergence(param,u,v)
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
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)
def makeTopographyFromField(grid): """make a topography out of a grid """ c = newUnit(grid, "topo", "m") return DerivedGridFactory.create2DTopography(grid,c)
def horizontalDivergence(param, u, v): """ horizontal flux divergence """ return DerivedGridFactory.createHorizontalFluxDivergence(param, u, v)
def combineFields(*a): """ combine several fields together """ return DerivedGridFactory.combineGrids(a)
def thetaSurfaceV(gridt, griduv, theta0): return DerivedGridFactory.extractVectorGridOverThetaTopoSurface( gridt, griduv, float(theta0))
def flowVector(field): """ Make a vector from flow direction""" a = newName(sin(field), "a") b = newName(cos(field), "b") return DerivedGridFactory.createFlowVectors(a, b)
def makeTopographyFromField(grid): """make a topography out of a grid """ c = newUnit(grid, "topo", "m") return DerivedGridFactory.create2DTopography(grid, c)
def makeTrueVector(u, v): """ true wind vectors """ return DerivedGridFactory.createTrueWindVectors(u,v)
def thetaSurfaceA(grid, grid1, theta0): return DerivedGridFactory.extractGridOverThetaTopoSurface( grid, grid1, float(theta0))
def thetaSurfaceADV(gridt, griduv, other, theta0): return DerivedGridFactory.extractGridADVOverThetaTopoSurface( gridt, griduv, other, float(theta0))
def layerDiff(grid, top, bottom, unit=None): """ Wrapper for calculating layer difference """ return DerivedGridFactory.createLayerDifference(grid, top, bottom, unit)