Ejemplo n.º 1
0
def timeStepSum(field, offset=-1):
    """set the value of each time step N:
    D(N)= D(N) + D(N+offset)
    where offset should be negative
    """
    offset = int(offset)
    return GridMath.timeStepSum(field, offset)
Ejemplo n.º 2
0
def timeStepSum(field,offset=-1):
    """set the value of each time step N:
    D(N)= D(N) + D(N+offset)
    where offset should be negative
    """
    offset = int(offset)
    return GridMath.timeStepSum(field,offset);
Ejemplo n.º 3
0
def runave(grid, nave=3, option=0):
    """generate a running average:
    <div class=jython>
    Where:<br>
          grid = grid to average<br>
          nave - number of steps to average over<br>
          option - option for unsmoothed end points<br>
                   0 - set to missing<br>
                   1 - use symmetry<br>
                  -1 - assume cyclic <br>
    </div>
    """
    steps = int(nave)
    opt = int(option)
    return GridMath.timeRunningAverage(grid, steps, opt)
Ejemplo n.º 4
0
def runave(grid, nave=3, option=0):
    """generate a running average:
    <div class=jython>
    Where:<br>
          grid = grid to average<br>
          nave - number of steps to average over<br>
          option - option for unsmoothed end points<br>
                   0 - set to missing<br>
                   1 - use symmetry<br>
                  -1 - assume cyclic <br>
    </div>
    """
    steps = int(nave)
    opt = int(option)
    return GridMath.timeRunningAverage(grid,steps,opt)
Ejemplo n.º 5
0
def wgt_runave(grid, wgts, option=0):
    """generate a weighted running average:
    <div class=jython>
    Where:<br>
          grid = grid to average<br>
          wgts - comma separated list of weights<br>
          option - option for unsmoothed end points<br>
                   0 - set to missing<br>
                   1 - use symmetry<br>
                  -1 - assume cyclic <br>
    </div>
    """
    from ucar.unidata.util import Misc
    weights = Misc.parseFloats(wgts)
    opt = int(option)
    return GridMath.timeWeightedRunningAverage(grid, weights, opt)
Ejemplo n.º 6
0
def wgt_runave(grid, wgts, option=0):
    """generate a weighted running average:
    <div class=jython>
    Where:<br>
          grid = grid to average<br>
          wgts - comma separated list of weights<br>
          option - option for unsmoothed end points<br>
                   0 - set to missing<br>
                   1 - use symmetry<br>
                  -1 - assume cyclic <br>
    </div>
    """
    from ucar.unidata.util import Misc
    weights = Misc.parseFloats(wgts)
    opt = int(option)
    return GridMath.timeWeightedRunningAverage(grid,weights,opt)
Ejemplo n.º 7
0
def sumFromBaseTime(field):
    """set the value of each time step N:
    D(N)= D(N) + D(0)
    """
    return GridMath.sumFromBaseTime(field)
Ejemplo n.º 8
0
def differenceFromBaseTime(field):
    """set the value of each time step N:
    D(N)= D(N) - D(0)
    """
    return GridMath.differenceFromBaseTime(field)
Ejemplo n.º 9
0
def averageOverTime(field, makeTimes=0):
    """Average the values in each time step
    If makeTimes is true (1) then we return a field mapping all of the times
    to the average. Else we just return the average """
    return GridMath.averageOverTime(field, makeTimes)
Ejemplo n.º 10
0
def sumFromBaseTime(field):
    """set the value of each time step N:
    D(N)= D(N) + D(0)
    """
    return GridMath.sumFromBaseTime(field);
Ejemplo n.º 11
0
def differenceFromBaseTime(field):
    """set the value of each time step N:
    D(N)= D(N) - D(0)
    """
    return GridMath.differenceFromBaseTime(field);
Ejemplo n.º 12
0
def averageOverTime(field,makeTimes=0):
    """Average the values in each time step
    If makeTimes is true (1) then we return a field mapping all of the times
    to the average. Else we just return the average """
    return GridMath.averageOverTime(field,makeTimes);