def findValveSpokeAngle(points):
    '''
    Determine the location of the valve spoke angle
    By binning the spoke returns. returns angle in degrees
    '''

    #np.savetxt("/home/mfallon/Desktop/spoke_points.csv", points, delimiter=",")


    # convert all points to degrees in range [0,120]
    angle = np.degrees( np.arctan2( points[:,1] ,  points[:,0] ) )
    qq = np.where(0 < angle)[0]
    angle[qq] += 360
    angle = np.mod( angle, 120)

    # find the spoke as the max of a histogram:
    bins = range(0,130,10)  # 0,10,...130
    freq, bins = np.histogram(angle, bins)
    amax = np.argmax(freq)
    spoke_angle = bins[amax] + 5 # correct for 5deg offset

    return spoke_angle
dataset/ETHPy150Open RobotLocomotion/director/src/python/director/segmentation.py/findValveSpokeAngle/swapped operands of `<`