def slice_polar_coords(dist, angles, dist_range, angle_range):
    """
    Returns a subset of pixel radial distances and angles, such that any pixel's radial distance and angle fall within specified range
    :param dist: list of pixel radial distances
    :param angles: list of corresponding pixel angles in degrees
    :param dist_range: binding range for radial distances
    :param angle_range: binding range for angles in degrees
    :return: list of distances and corresponding list of angles
    """
    # find an intersection of indices that satisfy distance and angle thresholds
    indices_slice = list(filter(lambda idx: angles[idx] <= angle_range[1] and \
                                            angles[idx] >= angle_range[0] and \
                                            dist[idx] <= dist_range[1] and \
                                            dist[idx] >= dist_range[0],range(len(angles))))

    # create a list of distance and angles that correspond to above indices
    dist1 = list()
    angles1 = list()
    dist1 = [dist[idx] for idx in indices_slice]
    angles1 = [angles[idx] for idx in indices_slice]

    if len(dist1) == 0:  # if no index found i.e dist1 is empty, return None
        return None, None
    else:
        return dist1, angles1