get_daymet2_apsim_met {apsimx} | R Documentation |
Get DAYMET data for an APSIM met file
Description
Uses download_daymet
from the daymetr package to download data to create an APSIM met file.
Usage
get_daymet2_apsim_met(lonlat, years, wrt.dir = ".", filename, silent = FALSE)
Arguments
lonlat |
Longitude and latitude vector |
years |
a numeric vector of years to extract (c(start, end)). For example, f you need 2012 through 2015, use c(2012, 2015). |
wrt.dir |
write directory (default is the current directory) |
filename |
file name for writing out to disk |
silent |
argument passed to |
Details
This function requires the daymetr package. This function should replace
the get_daymet_apsim_met
function.
If the filename is not provided it will not write the file to disk,
but it will return an object of class ‘met’. This is useful in case manipulation
is required before writing to disk. The variable ‘srad’ as downloaded from
daymet is average solar radiation, so it is converted to total.
Daily total radiation (MJ/m2/day) can be calculated as
follows: ((srad (W/m2) * dayl (s/day)) / 1,000,000)
Vapor Pressure Deficit (vp) should be in hecto Pascals
Value
It returns an object of class ‘met’ and writes a file to disk when filename is supplied.
Source
The data is retrieved using the daymetr package. For the original source see: https://daymet.ornl.gov/
Examples
## Not run:
require(daymetr)
## I write to a temp directory but replace as needed
dmet12 <- get_daymet2_apsim_met(lonlat = c(-93,42), years = 2012)
summary(dmet12)
## Check for reasonable ranges
check_apsim_met(dmet12)
## End(Not run)