def hcp_diamond_coord_test(x, y, z):
    """Test for coordinate in HCP diamond grid"""
    for pt in [[0, 0, 0], [3, 3, 3], [6, 0, 6], [9, 3, 9]]:
        tx = x - pt[0]
        ty = y - pt[1]
        tz = z - pt[2]
        s = tx + ty + tz
        if s % 24 == 0:
            n8 = s // 3
            if (tx - n8) % 6 == 0 and (ty - n8) % 6 == 0 and (tz - n8
                ) % 6 == 0:
                return True
    return False
