def d_stp(t_ref, t_in_situ, ds):
    """
    Calculates viscosity from Mostafa H. Sharqawy 12-18-2009,
    MIT (mhamed@mit.edu) (Sharqawy M. H., Lienhard J. H., and Zubair, S. M.,
    Desalination and Water Treatment, 2009)
    Viscosity used as input into Stokes-Einstein equation

    t_ref:  reference temperature
    t_in_situ:   in situ temperature
    ds:  Diffusion coefficient at reference temperature
    """
    # Viscosity at reference temperature
    muwd = (4.2844324477E-05 +
            1 /
            (1.5700386464E-01 * (t_ref + 6.4992620050E+01)**2+-9.1296496657E+01))
    A = 1.5409136040E+00 + 1.9981117208E-02 * t_ref + -9.5203865864E-05 * t_ref**2
    B = 7.9739318223E+00 + -7.5614568881E-02 * t_ref + 4.7237011074E-04 * t_ref**2
    visd = muwd*(1 + A*0.035 + B*0.035**2)

    # Viscosity vector
    muw = (4.2844324477E-05 + 1
           / (1.5700386464E-01*(t_in_situ + 6.4992620050E+01)**2+-9.1296496657E+01))
    C = 1.5409136040E+00 + 1.9981117208E-02 * t_in_situ + -9.5203865864E-05 * t_in_situ**2
    D = 7.9739318223E+00 + -7.5614568881E-02 * t_in_situ + 4.7237011074E-04 * t_in_situ**2
    vis = muw*(1 + C*0.035 + D*0.035**2)
    t_in_situ = t_in_situ + 273.15
    t_ref = t_ref + 273.15
    return t_in_situ / vis * visd * ds / t_ref