get_daymet_apsim_met | R Documentation |
Uses download_daymet
from the daymetr package to download data to create an APSIM met file.
get_daymet_apsim_met(lonlat, years, wrt.dir = ".", filename, silent = FALSE)
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 |
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
It returns an object of class ‘met’ and writes a file to disk when filename is supplied.
The data is retrieved using the daymetr package. For the original source see: https://daymet.ornl.gov/
## Not run:
require(daymetr)
## I write to a temp directory but replace as needed
dmet12 <- get_daymet_apsim_met(lonlat = c(-93,42), years = 2012)
summary(dmet12)
## Check for reasonable ranges
check_apsim_met(dmet12)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.