Description Usage Arguments Value Author(s) References Examples
This function downloads and preprocesses climate data from a variety of sources.
1 2 3 4 5 6 7 | get_climate_data(climate_source, date_range, dates,
download_folder, final_folder, standardize = TRUE,
snow_nthreads = 1, overwrite = FALSE,
wnd_speed_height_correction = TRUE, verbose = FALSE,
enable_download = FALSE, local_files,
preconvert = TRUE, output_basename = "climstats_data",
proj, zvalue)
|
climate_source |
A datasource to fetch climate data from. The following datasources are currently supported:
|
date_range |
A vector of length 2 containing the starting date and ending date of a range of climate data to download. |
dates |
Unused at present. |
download_folder |
The target download directory of the raw data. |
final_folder |
The final directory to store the preprocessed grd files. |
standardize |
standardize=TRUE converts the downloaded dataset to standard units used by eto and water balance
|
snow_nthreads |
The number of threads (CPUs) to use when processing. If snow_nthreads>1, the algorithm will attempt to use the multiple processing package snow via MPI. CURRENTLY UNSUPPORTED. |
overwrite |
overwrite=TRUE will allow overwriting of downloaded and preprocessed files. Setting overwrite=FALSE (default) lets the process pick up where it left off if interrupted. |
wnd_speed_height_correction |
wnd_speed_height_correction=TRUE (default) corrects wind speed data to wind speed at 2m above the terrain using the wind profile relationship described in http://www.fao.org/docrep/x0490e/x0490e07.htm equation 47. |
verbose |
verbose=TRUE will print process information. |
enable_download |
If enable_download=TRUE (default), data will be downloaded, otherwise download will be skipped. |
local_files |
A search string for local files which will be used to create the climate stack when climate_source="generic" |
preconvert |
If preconvert=TRUE (default), raw data will be preconverted to format=raster before any further processing occurs. |
output_basename |
A string representing the output files. Note that most formats have their own defaults which will override this. |
proj |
A PROJ string which will be used for climate_source='generic'. |
zvalue |
The zvalue applied to the output raster (only used with climate_source= 'generic'). This should be a character string of dates for each of the output layers. If zvalue='months' and the output is exactly 12 bands, the zvalue will be set to dates corresponding to the first of each month. |
Returns a RasterLayer, RasterBrick or RasterStack object, as well as saving the objects to disk.
Jonathan A. Greenberg
PRISM data: http://www.prism.oregonstate.edu/
PRISM terms of use: http://www.prism.oregonstate.edu/terms.phtml
PRISM metadata: http://www.prism.oregonstate.edu/docs/meta
NCEP North American Regional Reanalysis: http://www.esrl.noaa.gov/psd/ \cr data/gridded/data.narr.html
NCEP NARR Data Description: ftp://ftp.cdc.noaa.gov/Datasets/ \cr NARR/README
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## Not run:
# Download and decompress PRISM monthly precipitation data
# but do not post-process it.
ppt=get_climate_data("PRISM-4km-ppt",
date_range=c("1999/1/1","1999/12/31"),
standardize=FALSE, enable_download=TRUE)
# Note the raw, decompressed downloaded data.
dir()
# Download and post-process PRISM monthly precipitation data
# (note that as long as overwrite=FALSE, it will not redownload the files,
# just post-process the files already acquired during the previous step.
ppt=get_climate_data("PRISM-4km-ppt",
date_range=c("1999/1/1","1999/12/31"),
standardize=TRUE, enable_download=TRUE, overwrite=TRUE)
# Note the raw raster format files (*_raw.grd), and the corrected raster
# format data (*_climstats.grd).
dir()
summary(ppt)
getZ(ppt)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.