Tuesday, November 26, 2013

New R package raincpc: Obtain and Analyze Global Rainfall data from the Climate Prediction Center (CPC)

The Climate Prediction Center's (CPC) daily rainfall data for the entire world, 1979 - present & 50-km resolution, is one of the few high quality and long term observation-based rainfall products. Data is available at CPC's ftp site. However, it is a lot of data and there is no software to analyze and visualize the data.

Some issues with size/format of the CPC data:

  • too many files (365/366 files per year * 34 years, separate folder for each year)
  • each file has 360 rows and 720 columns
  • file naming conventions have changed over time - one format prior to 2006 and couple of different formats afterwards
  • file formats have changed over time - gzipped files prior to 2008 and plain binary files afterwards
  • downloading multiple files simultaneously from the CPC ftp site, using wget, does not seem to work properly
  • there is no software/code readily available to easily process/visualize the data

The R package `raincpc` makes life easier by providing functionality to download and process the data from CPC's ftp site. Some features of this new package are:

  • Data for anytime period during 1979-present can be downloaded and processed
  • Just two functions required: one to download the data (`cpc_get_rawdata`) and another to process the downloaded data (`cpc_read_rawdata`)
  • Making spatial maps using the processed data is easy, via ggplot

Here are some examples on how to obtain and visualize the data - https://github.com/RationShop/raincpc

Below are the relevant CRAN and GitHub sites:
Please let me know if you find any errors or if you have any comments or suggestions.

1 comment:


hello, I want ask to you about raincpc packages, I have downloaded raincpc, but when I download rainfall raw data from cpc, the result is Warning messages like this : In download.file(url = fileUrl, destfile = outFile, mode = "wb", ... : InternetOpenUrl failed: '' can you give me solution? thank you

please email me to: novvria.sagita.ut@gmail.com