def linterp(m0, m1, p0, p1, p):
    """Interpolates linearly dictionaries of numpy arrays m0 and m1

    m0, m1 correspond to variables p0, p1
    Result is a dictionary interpolated to the variable p (p0 < p < p1)
    """
    s = 1.*(p-p0)/(p1-p0)
    m = {}
    for col in m0.keys():
        m[col] = (1.-s)*m0[col] + s*m1[col]
    return m