José, Andy, thanks a lot. I´ve found pyhdf package and read the file.. but...
Previous TRMM files used to be a 480x1440 array... representing 60 degrees N, 60 degrees S x 360 degrees.. and the specification said: # All fields are 1440x480 grid boxes (0-360ºE,60ºN-S). The first grid box center is at # (0.125ºE,59.875ºN). Files are produced every 3 hours on synoptic observation hours (00 UTC, # 03 UTC, ..., 21 UTC) using that hour's 3B40RT and 3B41RT data sets. Valid estimates are only # provided in the band 50ºN-S. Then, I calculated the latitude using the following formula: Lat= 59.875 - 0.25*x Now I see that it changed to 400x1440, keeping coverage from 50 degrees north to 50 degrees south. It´s almost obvious that it does not work any more... (I'm assuming that it was the right way of doing it..now I´m not sure..) Does anybody know wich are the effects of that? How can I get the latitude now? Thanks again.. 2011/7/2 Jose Gomez-Dans <[email protected]> > Hi, > > On 2 July 2011 17:07, jpaulini <[email protected]> wrote: > >> files, but today I was so surprised that now they implemented a >> different data format... >> >> Looking for some information on how to read the new data with python, >> I only got that it uses HDF file format, but no more... >> > > HDF is a very frequenty-encountered format, and as such, there are a few > pythonic ways of reading it in (& saving it, I guess). It would appear that > the format is HDF4. I am partial to GDAL through its python bindings, but it > is a bit limited (if they pack in 1D arrays and stuff, GDAL will just ignore > them). pydf <http://pysclint.sourceforge.net/pyhdf/> deals with all that > stuff. Using gdal to read data into a numpy array (consider that all the > products have the same spatial extent) is quite easy. Suppose you have a > file called 3B42.110531.0.6A.HDF, you just then... > > from osgeo import gdal > g = gdal.Open('HDF4_SDS:UNKNOWN:"3B42.110531.0.6A.HDF":0') > precip = g.ReadAsArray() > # precip is a 1440x400 array with the precipitation dataset > g = gdal.Open('HDF4_SDS:UNKNOWN:"3B42.110531.0.6A.HDF":1') > err= g.ReadAsArray() > # err is a 1440x400 array with the relative error > > > Hope that helps > Jose >
