Calculate the temperature