readDWD.raster {rdwd} | R Documentation |
read dwd gridded raster data
Description
Read gridded raster data.
Intended to be called via readDWD()
.
Note that R.utils
must be installed to unzip the .asc.gz files.
Usage
readDWD.raster(file, gargs = NULL, dividebyten, quiet = rdwdquiet(), ...)
Arguments
file |
Name of file on harddrive, like e.g. DWDdata/grids_germany/seasonal/air_temperature_mean/ 16_DJF_grids_germany_seasonal_air_temp_mean_188216.asc.gz |
gargs |
Named list of arguments passed to |
dividebyten |
Logical: Divide the numerical values by 10? See readDWD. DEFAULT: TRUE |
quiet |
Ignored.
DEFAULT: FALSE through |
... |
Further arguments passed to |
Value
terra::rast
object
Author(s)
Berry Boessenkool, berry-b@gmx.de, Dec 2018
See Also
Examples
## Not run: # Excluded from CRAN checks, but run in localtests
rasterbase <- paste0(gridbase,"/seasonal/air_temperature_mean")
ftp.files <- indexFTP("/16_DJF", base=rasterbase, dir=tempdir())
localfiles <- dataDWD(ftp.files[1:2], base=rasterbase, joinbf=TRUE,
dir=locdir(), read=FALSE)
rf <- readDWD(localfiles[1])
rf <- readDWD(localfiles[1]) # runs faster at second time due to skip=TRUE
terra::plot(rf)
plotRadar(rf, proj="seasonal", extent=NULL)
testthat::expect_equal(c(terra::minmax(rf)), c(-8.2,4.4))
rf10 <- readDWD(localfiles[1], dividebyten=FALSE)
terra::plot(rf10)
testthat::expect_equal(c(terra::minmax(rf10*1)), c(-82,44))
## End(Not run)