Every degree-days model is an approximate integral over time of some function of temperature. The function -- the "rate function" -- is an approximation to the rate at which development -- or some other biological process -- occurs happens as a function of temperature. In theory, if we had continuous temperature measurements, we would simply integrate the rate function of temperature over time.
However, for many weather stations, we only have daily maximum and minimum temperatures, so we must approximate. A number of different approximations, which we call "calculation methods," are in use. When a researcher develops a model, they specify the calculation method they used in developing it as well as the rate function. In general, a model is only valid with degree-days computed using that calculation method.
For most models, uspest.org uses the appropriate calculation method automatically, and users don't need to worry about it. But if you are developing a new model, or if you are curious, this page describes the calculation methods we use.
While the rate function and the calculation method are distinct concepts, modelers often present a single procedure or formula which combines them. The calculation methods listed below are in fact combinations of this sort, consisting of a rate function (usually with temperature threshold parameters) and a calculation method per se.
The rate functions in most of our models are piecewise linear functions described by these parameters:
That is, for most models the rate function is zero for temperatures less than Tlo, increases with slope 1 from Tlo to Thi, and then remains constant or drops depending on the cutoff method.
Note that this description does not apply all degree-day models. The rate function can have any form. Notable exceptions are Potato P-days and Heating Degree-days. P-days use a piecewise quadratic function. Heating Degree-days is a measure of cold, not heat. Its rate function is zero for temperatures above Tlo, and increases linearly as temperature decreases below that. (It does not use Thi.)
Notation: Tlo and Thi are the lower and upper threshold temperatures (parameters of the calculation method). Tmin and Tmax are the minimum and maximum temperatures that day (weather data from observations or forecasts). DDs is the number of degree-days for that day; it's calculated for each day and the results added together.
This calculation method is sometimes called Growing Degree-days. It is used for the growth of crops other than corn. It uses horizontal cutoff, except that if the whole day is above the upper threshold (Tmin > Thi) it uses vertical cutoff.
This method is traditionally for corn; it is deprecated for other uses. Uses horizontal cutoff.
These methods are derived by estimating the temperature throughout the day and then integrating the rate function of that estimated temperature. They differ in how they construct the estimated temperature, though they tend to produce very similar values. Another description of them is given at UC IPM's About Degree-Days page.
These four methods are used by most of our insect phenology models and nearly half of our crop development models. Almost all of those use Single Sine. All use horizontal cutoff.
This is code in the Perl programming language. Thresholds $thi and $tlow are global variables.
sub docalcs_S {
local($max, $min) = @_;
if ($min > $thi) {
$heat = $thi - $tlow;
}
else {
if ($max <= $tlow) {
$heat = 0;
}
else {
$fk1 = 2 * $tlow;
$diff = $max - $min;
$sum = $max + $min;
if ($min >= $tlow) {
$heat = ($sum - $fk1) / 2;
}
else {
$heat = &sinec($sum, $diff, $fk1);
}
if ($max > $thi) {
$fk1 = 2 * $thi;
$heat -= sinec($sum, $diff, $fk1);
}
}
}
$ddtmp = $heat / 2;
return $ddtmp;
}
sub sinec {
local($sum, $diff, $fk1) = @_;
$twopi = 6.28318530717959;
$pihlf = 1.5707963267949;
$d2 = $fk1 - $sum;
my $d3 = $diff * $diff - $d2 * $d2;
# keep roundoff from causing errors like "Can't take sqrt of -1.20792e-13"
$d3 = 0 if $d3<0 and $d3 > -1e-9;
$theta = atan2($d2, sqrt($d3));
if (($d2 < 0) && ($theta > 0)) {
$theta = $theta - 3.1416;
}
$heat = ($diff * cos($theta) - $d2 * ($pihlf - $theta)) / $twopi;
$heat;
}
These methods use the same temperature estimate as Double Sine and Single Sine, but use a rate function with intermediate cutoff. Our implementations use the same code as for the horizontal cutoff sine methods, but and then subtract off the difference.
These calculation methods were developed for specific models, and are normally used only with those models.
sub docalcs_PD
{ # P-DAYS used for potato growth and early blight treatment initiation
# this is the daily approx version of equation 2 by Sands
my ( $max, $min ) = @_;
my ( $dp1, $dp2, $dp3, $dp4 ) = 0;
my ( $cmax, $cmin );
$cmax = ( $max - 32 ) * 5 / 9;
$cmin = ( $min - 32 ) * 5 / 9;
$dp1 = &dp($cmin);
$dp2 = &dp( 0.66667 * $cmin + 0.333333 * $cmax );
$dp3 = &dp( 0.66667 * $cmax + 0.333333 * $cmin );
$dp4 = &dp($cmax);
$ddtmp = 1 / 24 * ( 5 * $dp1 + 8 * $dp2 + 8 * $dp3 + 3 * $dp4 );
return $ddtmp;
}
sub dp { #estimate delta-p with $t temperature
my ($t) = @_;
my $dp = 0;
if ( $t < 7 || $t > 30 ) { $dp = 0.0 }
elsif ( ( $t >= 7 ) && ( $t < 21 ) ) {
$dp = 10 * ( 1 - ( $t - 21 )**2 / 196 );
}
elsif ( ( $t >= 21 ) && ( $t <= 30 ) ) {
$dp = 10 * ( 1 - ( $t - 21 )**2 / 81 );
}
if ( $dp < 0 ) { $dp = 0 }
return $dp;
}
sub docalcs_WG { # WHEAT (Bauer model) GROWING DEGREE-DAYS
$tlow =32
my ( $max, $min, $dd_cum ) = @_;
my $l_thi;
my $ddtmp;
# FAHRENHEIT
if ($dd_cum < 215) {
# use thi=70 if prior to 2nd Leaf Stage ( < 215 DD )
$l_thi = 70;
}
elsif ($dd_cum >= 215) {
# use thi=95 if not prior to 2nd Leaf Stage ( >= 215 DD )
$l_thi = 95;
}
if ( ( $max < $tlow ) && ( $min < $tlow ) ) {
$ddtmp = 0.0;
} else {
if ( $min < $tlow ) {
$min = $tlow;
}
if ( $max > $l_thi ) {
$max = $l_thi;
}
$ddtmp = ( $max + $min ) / 2 - $tlow;
if ( $ddtmp < 0 ) {
$ddtmp = 0.0;
}
}
return $ddtmp;
}
These measures are used primarily for measuring the demand for building heating and cooling, e.g., by power utilities and HVAC companies. We have included them for convenience, but they are not normally used for pest management.
These are not actually degree-day methods, but appear in some places in our software for programming convenience. Everyone else can safely ignore them. They simply return the daily minimum temperatures or daily maximum temperatures. They are useful in programming, primarily to allow code developed for interpolating degree-days to be used for interpolating temperatures. They ignore both Tlo and Thi and have no cutoff method.