Mercurial > repos > greg > insect_phenology_model
comparison insect_phenology_model.R @ 67:e8923653a5bf draft
Uploaded
author | greg |
---|---|
date | Tue, 14 Nov 2017 13:05:25 -0500 |
parents | f575148ce157 |
children | c0a950ae7902 |
comparison
equal
deleted
inserted
replaced
66:f575148ce157 | 67:e8923653a5bf |
---|---|
41 # Compute the length of daylight for the day of the year. | 41 # Compute the length of daylight for the day of the year. |
42 daylight_length_vector[i] <- 24 - (24 / pi * acos((sin(p * pi / 180) + sin(latitude * pi / 180) * sin(phi)) / (cos(latitude * pi / 180) * cos(phi)))) | 42 daylight_length_vector[i] <- 24 - (24 / pi * acos((sin(p * pi / 180) + sin(latitude * pi / 180) * sin(phi)) / (cos(latitude * pi / 180) * cos(phi)))) |
43 } | 43 } |
44 # Append daylight_length_vector as a new column to temperature_data_matrix. | 44 # Append daylight_length_vector as a new column to temperature_data_matrix. |
45 cbind(temperature_data_matrix, newColumn=daylight_length_vector) | 45 cbind(temperature_data_matrix, newColumn=daylight_length_vector) |
46 # Give the new column a name. | |
47 colnames(temperature_data_matrix)[7] <- c("DAYLEN") | |
48 } | 46 } |
49 | 47 |
50 get_temperature_at_hour = function(latitude, temperature_data_matrix, row, num_days) { | 48 get_temperature_at_hour = function(latitude, temperature_data_matrix, row, num_days) { |
51 # Base development threshold for Brown Marmolated Stink Bug | 49 # Base development threshold for Brown Marmolated Stink Bug |
52 # insect phenology model. | 50 # insect phenology model. |