11 - use case: monthy gridded data

From the monthly folder at gridbase, we want to download .asc.gz files for selected years and open them in R for further processing.

index <- grep("monthly",   gridIndex, value=TRUE) # 12'295
index <- grep('precipitation', index, value=TRUE) #  1'664
index <- grep('2014|2015|2016',index, value=TRUE) #     36 (3*12)

precip_files <- dataDWD(index[6:8], base=gridbase, joinbf=TRUE, read=FALSE, 
precip <- readDWD(precip_files)

For .asc.gz files, readDWD calls readDWD.raster. This runs faster if called a second time due to skip=TRUE in gunzip.
Now we can project and visualize with:

plotRadar(precip[[1]], proj="seasonal", extent=precip[[1]]@extent, main=names(precip)[1])

For further processing, we can create a raster stack from the list, which e.g. enables fast and easy indexing.

precip_stack <- raster::stack(precip)

This is expanded upon in the next use case.

A few projection references:

The Beschreibung file leads to https://spatialreference.org/ref/epsg/31467/ from which the proj4 format is used internally in projectRasterDWD, currently at line 62.
Bettina Ohse reported using dwd.projection <- '+init=epsg:31467' instead.