def compass_dir(angle):
    """
    Accepts angle in degrees.
    Returns 16-wind direction abbreviation.
    """
    angle %= 360
    
    if angle < 11.25 or angle >= 348.75:
        return 'N'
    elif angle < 33.75:
        return 'NNE'
    elif angle < 56.25:
        return 'NE'
    elif angle < 78.75:
        return 'ENE'
    elif angle < 101.25:
        return 'E'
    elif angle < 123.75:
        return 'ESE'
    elif angle < 146.25:
        return 'SE'
    elif angle < 168.75:
        return 'SSE'
    elif angle < 191.25:
        return 'S'
    elif angle < 213.75:
        return 'SSW'
    elif angle < 236.25:
        return 'SW'
    elif angle < 258.75:
        return 'WSW'
    elif angle < 281.25:
        return 'W'
    elif angle < 303.75:
        return 'WNW'
    elif angle < 326.25:
        return 'NW'
    elif angle < 348.75:
        return 'NNW'