def sanitize_latlon(lat_lon_tuple, ppd=1, start_from_90N=False):
    """
    Wraps around latitude & longitudes, including interpretation of points past the poles

    @param lat_lon_tuple: (lat, lon), in either degrees or pixels
    @param ppd: pixels-per-degree
    @param start_from_90N: consider 90N to be 0 latitude

    @return Latitude and Longitude after they have been sanitized
    """
    lat, lon = lat_lon_tuple
    if start_from_90N:
        if lat < 0:
            return [-lat, (lon + 180 * ppd) % (360 * ppd)]
        elif lat > 180 * ppd:
            return [-360 * ppd - lat, (lon + 180 * ppd) % (360 * ppd)]
        else:
            return [lat, lon % (360 * ppd)]
    elif lat > 90 * ppd:
        return [180 * ppd - lat, (lon + 180 * ppd) % (360 * ppd)]
    elif lat < -90 * ppd:
        return [-180 * ppd - lat, (lon + 180 * ppd) % (360 * ppd)]
    else:
        return [lat, lon % (360 * ppd)]
