This function is a wrapper for the nasapower::get_power() with predefined parameters suitable for use in epicrop.

get_wth(lonlat, dates, duration)

Arguments

lonlat

A numeric vector of geographic coordinates for a cell or region entered as x, y coordinates.

dates

A character vector of start and end dates in that order.

duration

A numeric value indicating how many days a single growing season being simulated is to be. If this is used, only the start date will be used and the end date will be ignored if supplied. This must match the duration parameter value passed along to SEIR() or any of the predict family of functions.

Value

A data.table::data.table() of weather data, dates and geolocation information (LAT/LON values) suitable for use in epicrop

with the following columns:

Field NameValue
YYYYMMDDDate as Year Month Day (ISO8601)
DOYConsecutive day of year, commonly called "Julian date"
TEMPMean daily temperature (°C)
RHUMMean daily relative humidity (%)
RAINMean daily rainfall (mm)
LATLatitude of area of interest
LONLongitude of area of interest

Author

Adam H. Sparks, adamhsparks@gmail.com

Examples

if (FALSE) { # interactive()

# get weather for IRRI Zeigler Experiment Station in wet season 2000 from the
# default NASA POWER data.
power <- get_wth(
  lonlat = c(121.25562, 14.6774),
  dates = c("2000-06-30", "2000-12-31")
)

# get 120 days of weather for IRRI Zeigler Experiment Station in wet season
# 2000 by specifying the duration but not the end-date and specifying to use
# POWER data.
power <- get_wth(
  lonlat = c(121.25562, 14.6774),
  dates = "2000-06-30",
  duration = 120,
  source = "nasapower"
)
}