Degree days calculation
Heating Degree Days (HDD) and Cooling Degree Days (CDD) are computed with the mean temperature method.
Each day, the average outside air temperature of the day is computed as the mean of min and max temperature (Tmin and Tmax). Then the degree days for that day are computed as the difference between that average temperature and the chosen base temperature (Tbase), taking 0 if negative.
HDD = Max(0, Tbase - (Tmax - Tmin) / 2)
CDD = Max(0, (Tmax - Tmin) / 2 - Tbase)