import math


def calculate_DewP(AirT, RelH):
    """ Calculates dew point using the same formula the Met Office uses
    """
    if AirT == None or RelH == None: return None

    ea = (8.082 - AirT / 556.0) * AirT
    e = 0.4343 * math.log(RelH / 100) + ea / (256.1 + AirT)
    sr = math.sqrt(((8.0813 - e) ** 2) - (1.842 * e))
    return 278.04 * ((8.0813 - e) - sr)