get_wth: Get Weather Data for Use in epicrop Modelling

View source: R/get_wth.R

get_wthR Documentation

Get Weather Data for Use in epicrop Modelling

Description

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

Usage

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 Name Value
YYYYMMDD Date as Year Month Day (ISO8601)
DOY Consecutive day of year, commonly called "Julian date"
TEMP Mean daily temperature (°C)
RHUM Mean daily relative humidity (%)
RAIN Mean daily rainfall (mm)
LAT Latitude of area of interest
LON Longitude of area of interest

Author(s)

Adam H. Sparks, adamhsparks@gmail.com

Examples



# 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"
)


adamhsparks/epiRice documentation built on Nov. 23, 2023, 12:31 a.m.