An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110913/262ab97d/attachment.pl>
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:
Hi everybody, I'm looking for satellite data about rainfall or precipitation... I think * ftp://disc2.nascom.nasa.gov/data/s4pa/TRMM_L3/TRMM_3B42_daily/2010/001/3B42_daily.2010.01.02.6.bin * could be what I'm looking for (as it's accessible via ftp, is 0.25? spatial resolution and daily temporal resolution), but I can't get correct values from this binary file (I read the documentation about data structure, it speaks about two-byte integer, but I can't understand how to get values). Does anyone know how to read this kind of file into R or an alternative way of having spatial data about precipitation?
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:
Hi everybody, I'm looking for satellite data about rainfall or precipitation... I think * ftp://disc2.nascom.nasa.gov/data/s4pa/TRMM_L3/TRMM_3B42_daily/2010/001/3B42_daily.2010.01.02.6.bin * could be what I'm looking for (as it's accessible via ftp, is 0.25? spatial resolution and daily temporal resolution), but I can't get correct values from this binary file (I read the documentation about data structure, it speaks about two-byte integer, but I can't understand how to get values).
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
~~~~~~~~~~~~~~~~~~~~~~~~~~ Matthew Landis, Ph.D. Research Scientist ISciences, LLC 61 Main St. Suite 200 Burlington VT 05401 802.864.2999 ~~~~~~~~~~~~~~~~~~~~~~~~~~
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110913/5ece92b0/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20110914/d34fb9f2/attachment.pl>