def closest_pixel_to_set(self, start, pixel_set, direction, w=13, t=0.5):
        """Starting at pixel, moves start by direction * t until there is a
        pixel from pixel_set within a radius w of start. Then, returns start.

        Parameters
        ----------
        start : :obj:`numpy.ndarray` of float
            The initial pixel location at which to start.

        pixel_set : set of 2-tuples of float
            The set of pixels to check set intersection with

        direction : :obj:`numpy.ndarray` of float
            The 2D direction vector in which to move pixel.

        w : int
            A circular diameter in which to check for pixels.
            As soon as the current pixel has some non-zero pixel with a diameter
            w of it, this function returns the current pixel location.

        t : float
            The step size with which to move pixel along direction.

        Returns
        -------
        :obj:`numpy.ndarray` of float
            The first pixel location along the direction vector at which there
            exists some intersection with pixel_set within a radius w.
        """

        # create circular structure for checking clearance
        y, x = np.meshgrid(np.arange(w) - w / 2, np.arange(w) - w / 2)
        cur_px_y = np.ravel(y + start[0]).astype(np.uint16)
        cur_px_x = np.ravel(x + start[1]).astype(np.uint16)
        
        # create comparison set, check set overlap
        cur_px = set(zip(cur_px_y, cur_px_x))
        includes = True
        if np.all(
            cur_px_y >= 0) and np.all(
            cur_px_y < self.height) and np.all(
            cur_px_x >= 0) and np.all(
                cur_px_x < self.width):
            includes = not cur_px.isdisjoint(pixel_set)
        else:
            return None

        # Continue until out of bounds or sets overlap
        while not includes:
            start = start + t * direction
            cur_px_y = np.ravel(y + start[0]).astype(np.uint16)
            cur_px_x = np.ravel(x + start[1]).astype(np.uint16)
            cur_px = set(zip(cur_px_y, cur_px_x))
            if np.all(
                cur_px_y >= 0) and np.all(
                cur_px_y < self.height) and np.all(
                cur_px_x >= 0) and np.all(
                    cur_px_x < self.width):
                includes = not cur_px.isdisjoint(pixel_set)
            else:
                return None
        
        return start
Starting at pixel, moves start by direction * t until there is a
        pixel from pixel_set within a radius w of start. Then, returns start.

        Parameters
        ----------
        start : :obj:`numpy.ndarray` of float
            The initial pixel location at which to start.

        pixel_set : set of 2-tuples of float
            The set of pixels to check set intersection with

        direction : :obj:`numpy.ndarray` of float
            The 2D direction vector in which to move pixel.

        w : int
            A circular diameter in which to check for pixels.
            As soon as the current pixel has some non-zero pixel with a diameter
            w of it, this function returns the current pixel location.

        t : float
            The step size with which to move pixel along direction.

        Returns
        -------
        :obj:`numpy.ndarray` of float
            The first pixel location along the direction vector at which there
            exists some intersection with pixel_set within a radius w.