import math


def temp_its90(g, h, i, j, f0, f):
    """SBE equation for converting engineering units to Celcius according to ITS-90.

    g, h, i, j, f0: coefficients given in calibration.
    f: frequency sampled by sensor.

    Original form from calib sheet dated 2012:
    Temperature ITS-90 = 1/{g+h[ln(f0/f )]+i[ln2(f0/f)]+j[ln3(f0/f)]} - 273.15 (°C)

    """
    ITS90 = 1/(g +
        h * (math.log(f0/f)) +
        i * math.pow((math.log(f0/f)),2) +
        j * math.pow((math.log(f0/f)),3)
        ) - 273.15
    return ITS90