def valid_phage_titer(titer, o):
    """
    Decides wether or not a phage titer is valid and, if not decides why.
    Args:
        titer(float): Titer to decide on.
        o (Options): Options object for lookup
    Returns(int):
            -1 if the phage titer was lower than mincp at some transfer point
            0 if the phage titer was valid the whole time
            1 if the phage titer was higher than maxcp at some transfer point
    """

    gen = 1

    while o.min_cp < titer[(gen * (o.tsteps + 1)) - 1] < o.max_cp:
        if gen == o.epochs:
            return gen, 0
        gen += 1

    if o.min_cp > titer[(gen * (o.tsteps + 1)) - 1]:
        tendency = -1
    else:
        tendency = 1

    return gen, tendency