# HG changeset patch # User greg # Date 1510594008 18000 # Node ID a3bdf0d35d1de916ffcf408946a29333bfc4c1f0 # Parent 1d4e864b77204a85ad8743ad239aa9a11966afa2 Uploaded diff -r 1d4e864b7720 -r a3bdf0d35d1d insect_phenology_model.R --- a/insect_phenology_model.R Mon Nov 13 12:14:26 2017 -0500 +++ b/insect_phenology_model.R Mon Nov 13 12:26:48 2017 -0500 @@ -35,7 +35,7 @@ for (i in 1:num_days) { # Get the day of the year from the current row # of the temperature data for computation. - doy <- temperature_data[c(i:i), 4] + doy <- temperature_data[i, 4] theta <- 0.2163108 + 2 * atan(0.9671396 * tan(0.00860 * (doy - 186))) phi <- asin(0.39795 * cos(theta)) # Compute the length of daylight for the day of the year. @@ -234,7 +234,7 @@ # All the days included in the input temperature dataset. for (row in 1:opt$num_days) { # Get the integer day of the year for the current row. - doy <- temperature_data[c(row:row), 4] + doy <- temperature_data[row, 4] # Photoperiod in the day. photoperiod <- daylight_length_vector[row] temp.profile <- get_temperature_at_hour(latitude, temperature_data, daylight_length_vector, row, opt$num_days)