Learn R Programming

hddtools (version 0.5)

TRMM: Download and convert TRMM data

Description

The TRMM dataset provide global historical rainfall estimation in a gridded format.

Usage

TRMM(inputLocation = NULL, product = "3B43", version = 7,
  type = "precipitation.accum", twindow = NULL, areaBox = NULL,
  outputfileLocation = NULL)

Arguments

inputLocation
location where data is stored. By default it points to the TRMM ftp server (ftp://disc2.nascom.nasa.gov/data/TRMM/Gridded/) but it can also be a local directory. If you are using a local directory, this function expects to find inside 'inputLocation' a folder with the name of product and version (e.g. "i3B43_V7") and inside this a folder for each year( e.g. "2012").
product
this is the code that identifies a product, default is "3B43"
version
this is the version number, default is 7
type
this is the type of information needed, default is "precipitation.accum". Other types could be "gaugeRelativeWeighting.bin" and "relativeError.bin"
twindow
is a vector of dates and times for which the data should be retrieve
areaBox
OPTIONAL bounding box, a list made of 4 elements: minimum longitude (xmin), minimum latitude (ymin), maximum longitude (xmax), maximum latitude (ymax)
outputfileLocation
file path where to save the GeoTiff

Value

Data is loaded as multilayer GeoTIFF and loaded as a RasterBrick.

Details

This code is based upon Martin Brandt's blog post: http://matinbrandt.wordpress.com/2013/09/04/automatically-downloading-and-processing-trmm-rainfall-data/ and on the TRMM FAQ: http://disc.sci.gsfc.nasa.gov/additional/faq/precipitation_faq.shtml

Examples

Run this code
## Not run: ------------------------------------
#   # Define a bounding box
#   areaBox <- raster::extent(-10, 5, 48, 62)
#   twindow <- seq(as.Date("2012-01-01"), as.Date("2012-01-31"), by = "months")
# 
#   TRMMfile <- TRMM(product = "3B43", version = 7,
#                    type = "precipitation.accum",
#                    twindow = twindow, areaBox = areaBox)
# 
#   raster::plot(TRMMfile)
## ---------------------------------------------

Run the code above in your browser using DataLab