def mb_bl_ind(tr1, tr2):
    """Returns the baseline index for given track indices.

    By convention, tr1 < tr2. Otherwise, a warning is printed,
    and same baseline returned.
    """
    if tr1 == tr2:
        print("ERROR: no baseline between same tracks")
        return None
    if tr1 > tr2:
        print("WARNING: tr1 exepcted < than tr2")
    mx = max(tr1, tr2)
    bl = mx*(mx-1)/2 + min(tr1, tr2)
    return bl.astype(int)