Skip to content

Spatial rainfall or precipitation data

5 messages · Barry Rowlingson, Matthew Landis, Robert J. Hijmans +1 more

#
On Tue, Sep 13, 2011 at 3:57 PM, luca candeloro
<luca.candeloro at gmail.com> wrote:
you could try the IRI Data Library:

http://iridl.ldeo.columbia.edu/

 the interface is a bit clunky but persevere. There's definitely
rainfall data in there over space and time, but it does concentrate on
Africa and tropical areas for backing up disease research.

Barry
#
On 9/13/2011 10:57 AM, luca candeloro wrote:
Luca, I haven't used the TRMM binary data specifically, but I've read in 
similar files into R.  It's a little tricky to go from binary data to 
something you can visualize, e.g. with the raster package.  I found that 
there was a fair bit of trial and error.

# This gives a vector of values
trmm.data <- readBin(file(trmm.data.file, open = 'rb'), size = 2, 
endian='little')

# If it looks like nonsense, you might try setting endian to 'swap' or 
'big',  or changing the 'size'

# assign to a raster layer
# The array might have to be transposed to work right
trmm.array <- array(trmm.data, dim = c(1440, 400))

trmm.raster <- raster(trmm.array, xmn = -180, xmx = 180, ymn = -50, ymx 
= 50,
     crs = '+proj=longlat +datum=WGS84 +ellps=WGS84')

plot(trmm.raster)
# If image doesn't look right, you might look into the rotate() and 
flip() functions in the raster package.

Good luck.

M