15 - use case: daily radar files

Download and read with readDWD.radar with dividebyten=TRUE:

# library("rdwd")
radbase <- paste0(gridbase,"/daily/radolan/recent/bin/")
radfile <- format(Sys.Date()-5, "raa01-sf_10000-%y%m%d1450-dwd---bin.gz")
rad <- dataDWD(radfile, base=radbase, joinbf=TRUE, dir=locdir())

Project and then plot:

radp <- projectRasterDWD(rad$dat)
plotRadar(radp, main=paste("mm in 24 hours preceding", rad$meta$date), project=FALSE)

Save the projected radar image as NCDF file, read back and plot (not executed):

raster::writeRaster(radp, "rad_0714_2350.nc", format="CDF", overwrite=TRUE, 
                    varname="pre", varunit="mm/day", longname="precipitation24hrs", 
                    xname="X", yname="Y",zname="nbands", zunit="numeric")

nc <- ncdf4::nc_open("rad_0714_2350.nc")
pre <- ncdf4::ncvar_get(nc, "pre")
lon <- nc$dim$X$vals
lat <- nc$dim$Y$vals
image(lon, rev(lat), pre[,ncol(pre):1]) # takes several seconds