| Title: | Model Cumulative Growing Degree-Days for Pest Monitoring |
|---|---|
| Description: | Raw data from pest monitoring/traps can be correlated with environmental factors such as temperature, growing degree day etc. to get useful insights about the pest phenology. This package pulls temperature data from the California Irrigation Management Information System ('CIMIS', <https://cimis.water.ca.gov>) or the 'Daymet' application programming interface ('API', <https://daymet.ornl.gov>) for a user-specified time period and calculates cumulative growing degree-days. Users provide pest development thresholds (lower and upper temperatures) and the geographic coordinates of the trap location to track emergence and phenology. |
| Authors: | Santosh Bhandari [aut, cre] |
| Maintainer: | Santosh Bhandari <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-05-20 13:45:36 UTC |
| Source: | https://github.com/cran/TrackTrap |
Calculate cumulative degree-days for a pest using Daymet API or CIMIS CSV FILE
calc_pest_phenology( trap_data, pest = NULL, lat = NULL, lon = NULL, custom_lower = NULL, custom_upper = NULL, cimis_csv = NULL )calc_pest_phenology( trap_data, pest = NULL, lat = NULL, lon = NULL, custom_lower = NULL, custom_upper = NULL, cimis_csv = NULL )
trap_data |
A data frame containing |
pest |
A string representing the pest code (e.g., "OLFF", "NOW"). See |
lat |
Latitude of the trap location (numeric). |
lon |
Longitude of the trap location (numeric). |
custom_lower |
Optional. Override the database with a custom lower threshold. |
custom_upper |
Optional. Override the database with a custom upper threshold. |
cimis_csv |
Optional. File path to a manually downloaded CIMIS daily CSV file. |
A data frame joining the trap data with daily temperatures and cumulative degree-days.
# Create mock trap data for testing trap_df <- data.frame(date = as.Date(c("2024-05-01", "2024-05-08")), trap_counts = c(2, 14)) # Calculate phenology using Daymet API results <- calc_pest_phenology(trap_df, pest = "OLFF", lat = 38.5, lon = -121.8)# Create mock trap data for testing trap_df <- data.frame(date = as.Date(c("2024-05-01", "2024-05-08")), trap_counts = c(2, 14)) # Calculate phenology using Daymet API results <- calc_pest_phenology(trap_df, pest = "OLFF", lat = 38.5, lon = -121.8)
A dataset containing the lower and upper developmental temperature thresholds (in Fahrenheit) for common agricultural pests in California.
pest_thresholdspest_thresholds
A data frame with 5 rows and 4 variables:
Short abbreviation for the pest (e.g., OLFF, NOW)
Common name of the pest
Lower developmental temperature threshold (°F)
Upper developmental temperature threshold (°F)
Plot Cumulative Degree-Days against Trap Counts
plot_phenology_trend(df, save_plot = FALSE)plot_phenology_trend(df, save_plot = FALSE)
df |
The data frame outputted by |
save_plot |
Logical. If TRUE, saves the plot to your working directory. |
A ggplot object.