예제 #1
0
def anilagindices(data, pwdist, lag, tol, angle, atol):
    '''
    Input:  (data)   NumPy array where the frist two columns
                     are the spatial coordinates, x and y, and
                     the third column is the variable of interest
            (pwdist) square NumPy array of pairwise distances
            (lag)    the distance, h, between points
            (tol)    the tolerance we are comfortable with around (lag)
            (angle)  float, [0,360), North = 0 --> 360 clockwise
            (atol)   number of degrees about (angle) to consider
    '''
    index = lagindices(pwdist, lag, tol)
    brngs = utilities.bearings(data, index)
    bridx = list(zip(brngs, index))
    index = [
        idx.tolist() for br, idx in bridx
        if utilities.inangle(br, angle, atol)
    ]
    # add 180 to the angle and take the modulus
    angle = (angle + 180) % 360
    index += [
        idx.tolist() for br, idx in bridx
        if utilities.inangle(br, angle, atol)
    ]
    return np.array(index)
예제 #2
0
def anilagindices(data, pwdist, lag, tol, angle, atol):
    '''
    Input:  (data)   NumPy array where the fris t two columns
                     are the spatial coordinates, x and y, and
                     the third column is the variable of interest
            (pwdist) square NumPy array of pairwise distances
            (lag)    the distance, h, between points
            (tol)    the tolerance we are comfortable with around (lag)
            (angle)  float, [0,360), North = 0 --> 360 clockwise
            (atol)   number of degrees about (angle) to consider
    '''
    index = lagindices(pwdist, lag, tol)
    brngs = utilities.bearings(data, index)
    bridx = list(zip(brngs, index))
    index = [idx for br, idx in bridx if utilities.inangle(br, angle, atol)]
    # add 180 to the angle and take the modulus
    angle = (angle + 180) % 360
    index += [idx for br, idx in bridx if utilities.inangle(br, angle, atol)]
    return index