def sal_res_crain(resistivity, temperature):
    """Return salinity following Crain's petrophysical handbook.

    Salinity is calculated as a function of resistivity and temperature.

    Note
    ----
    Resistivity OR temperature can be arrays, but not both at the same time.

    Parameters
    ----------
    resistivity : float or array
        Resistivity in Ohm.m.

    temperature : float or array
        Temperature in °C.

    Returns
    -------
    salinity : float or array
        Salinity in parts per million (ppm).

    """
    return 400000/(temperature*9/5 + 32)/resistivity**1.14