6 Raster data

For observational data at dwdbase, selectDWD is the main function to choose data to be downloaded.

For gridded data at gridbase, including data interpolated onto a 1 km raster and radar data up to the last hour, I don’t yet understand the structure of the FTP server as well.
For now, you’ll have to query gridIndex yourself, e.g. with

If you send me examples of how you use it, I can then expand this in rdwd.
For files that are not yet read correctly, you can also consult the Kompositformatbeschreibung at https://www.dwd.de/DE/leistungen/radolan/radolan.html

Besides dwdbase and gridbase, there’s yet more data at ftp://ftp-cdc.dwd.de/weather.

A helper function to reduce code duplication:

The following overview will usually unzip only a few selected files for speed and memory considerations. In real life, you might not want to unzip to a temporary exdir and (at least when calling it for the first time) not use quiet=TRUE. You can also remove read=FALSE in dataDWD and add the needed arguments right there, but I wanted to be explicit here.

The first line in each code block shows for which FTP folder at gridbase this function will be called.
The last line shows what projection and extent to use in projectRasterDWD.

6.6 readDWD.nc

readDWD.nc

## [1] "vobjtovarid4: **** WARNING **** I was asked to get a varid for dimension named x BUT this dimension HAS NO DIMVAR! Code will probably fail at this point"
## [1] "vobjtovarid4: **** WARNING **** I was asked to get a varid for dimension named y BUT this dimension HAS NO DIMVAR! Code will probably fail at this point"

6.7 binary file errors

Binary files must be downloaded by download.file with wb=TRUE (at least on Windows, due to CRLF issues). download.file will automatically do that for some file endings (like .gz, .zip). For others, dataDWD has a dbin=TRUE option.
If you do not use this, your plots will look partially shifted like this (and have the wrong units):

I’m considering to set the default dbin to TRUE but need to assess the implications yet.