def METHOD_NAME(
    self, gantry_angles, gantry_tol, allow_missing_angles=False
):
    masks = [
        self._gantry_angle_mask(gantry_angle, gantry_tol)
        for gantry_angle in gantry_angles
    ]
    for mask in masks:
        if np.all(mask == 0):
            continue
        # TODO: Apply mask by more than just gantry angle to appropriately
        # extract beam index even when multiple beams have the same gantry
        # angle
        is_duplicate_gantry_angles = (
            np.sum(np.abs(np.diff(np.concatenate([[0], mask, [0]])))) != 2
        )
        if is_duplicate_gantry_angles:
            raise ValueError("Duplicate gantry angles not yet supported")
    try:
        assert np.all(
            np.sum(masks, axis=0) == 1
        ), "Not all beams were captured by the gantry tolerance of " " {}".format(
            gantry_tol
        )
    except AssertionError:
        if not allow_missing_angles:
            print("Allowable gantry angles = {}".format(gantry_angles))
            gantry = np.array(self.gantry, copy=False)
            out_of_tolerance = np.unique(
                gantry[np.sum(masks, axis=0) == 0]
            ).tolist()
            print(
                "The gantry angles out of tolerance were {}".format(
                    out_of_tolerance
                )
            )
            raise
    return masks