Download German rain radar data and convert it to NetCDF (or what they should provide in the first place)

For a private project, I wanted to have a look at the German radar archive. I found that they have quasi-calibrated 5-minute precipitation data on a 1km2 grid available in the public domain. So, let’s download and process the data set, so that it is easier to use for further data analysis.

This post is part of the germanRADARanalysis project. All code is available on GitHub.

Continue reading “Download German rain radar data and convert it to NetCDF (or what they should provide in the first place)”

How to process many gridded climate data files in parallel with find, xargs and cdo

Climate data often comes in the format of NetCDF and most of the time we have to deal with a large number of files. For instance, when they are split into one file per year. So, what can we do if we want to process all files in the same way?

Luckily, there are tools to accomplish this task easily and even improve the performance by parallel execution. Here, I will show you a simple way to do this. In this example, I will download a small part of a global climate data set and extract a region from it. It’s just a one-liner.

Continue reading “How to process many gridded climate data files in parallel with find, xargs and cdo”

How to run multiple instances of a program with different input data in parallel with xargs

Sometimes, we might want to run a single program with many input files. For example, if we want to resize or crop a large number of photos to the same dimensions. The long way would be to open the first file in a photo editing program and manually resize it, then open the next one, do it again and so on. But, of course we are faster if we automate the task and, most important, use multiple processor cores for parallel processing. Certainly, there are specialized software tools that will do a batch resizing of images for you (most likely not in parallel, though). However, here I will demonstrate a structured and flexible way of applying a program to multiple files in parallel on the command line in a Linux environment using xargs.

Continue reading “How to run multiple instances of a program with different input data in parallel with xargs”