Import TRMM

From GRASS-Wiki
Revision as of 11:54, 17 November 2010 by Neteler (talk | contribs) (added rotation trick from Markus Metz)
Jump to navigation Jump to search

TRMM data are usually delivered in a specific HDF format which is (partially) supported from GDAL 1.8+ (so, r.in.gdal would in theory work, see also below for rotation problem).

However, it is easier to get instead binary grids from here:

ftp://disc2.nascom.nasa.gov/data/TRMM/Gridded/3B43_V6/

The format is explained here. Hence, to import gridded TRMM into a Lat-long location with is done via

# generally
r.in.bin -f -b north=50 south=-50 east=180 west=-180 rows=400 cols=1440 ....

e.g.

r.in.bin -f -b input=3B43.100101.6.precipitation.bin output=3B43.100101.6.precipitation \
         north=50 south=-50 east=180 west=-180 rows=400 cols=1440

Optionally convert then to mm/hr to some other time unit.

Getting rotated maps in TRMM-HDF?

The TRMM 3B43 HDF files are rotated by 90° (clockwise), so north is right and west is up. The included datasets "precipitation" and "error" can be dumped from the HDF files to a binary or ASCII file with the "hdp" tool which should be on any system that has the HDF4 library installed.

Rotate "precipitation" with

 hdp dumpsds -r 4 -d -o <outfile> -b <TRMM_3B43.hdf>

and "error" with

 hdp dumpsds -r 5 -d -o <outfile> -b <TRMM_3B43.hdf>

These are rotated and need to be rotated back. The (properly oriented) binary grids are much easier to handle than the original HDF files.