problem to open TRMM 3B42RT 3hr binary files
Henrique Barbosa
hmjbarbosa at GMAIL.COM
Fri Oct 19 08:20:26 EDT 2007
Dear All,
I am trying to open the TRMM 3B42RT 3hr binary
files available from:
ftp://trmmopen.gsfc.nasa.gov/pub/merged/mergeIRMicro
Its a plain binary file, but it has a 2880 bytes header
and precipitation, error and source number are
packed as 2byte-integer, 2byte-integer and 1byte-integer
respectivelly (see file header below).
I wrote the ctl below but it is not working. Only 0 and -1
are unpacked correctly... All other values are wrong.
For instance, 76 (0.76mm/hr) is unpacked by grads
as 19456 and 162 (1.62mm/hr) is unpacked as -24064.
I can read the data correctly if I open it from a fortran
program thou. If I use it to write a new binary file
containing only the rescaled precipitation as real*4,
than I can access the data correctly from grads.
I would prefer to open the original data instead.
Any ideas how to fix the ctl?
thanks,
Henrique
=======GRADS unpacking x F90================
nx | ny | Grads | F90
1261 | 40 | -1 | -1
1261 | 41 | 0 | 0
1261 | 60 | 6656 | 26
1261 | 61 | 1264 | 44
1261 | 403 | -24064 | 162
1261 | 404 | 19456 | 76
==========GRADS VERSION==================
Config: v1.9b4 32-bit little-endian readline lats printim
Running on P4 with opensuse 10.1
===========CTL===========================
DSET ^mergeIRMicro/2002/3B42RT.2002090100.bin
UNDEF -31999
OPTIONS YREV BIG_ENDIAN
fileheader 2880
TITLE trmm data
XDEF 1440 LINEAR 0.125 0.25
YDEF 480 LINEAR -59.875 0.25
ZDEF 1 LEVELS 1 1
TDEF 1 LINEAR 00Z01SEP2002 3HR
VARS 3
prec 0 -1,40,2,-1 prec (mm/hr)
error 0 -1,40,2,-1 error (mm/hr)
source 0 -1,40,1 source
ENDVARS
===========FILE HEADER====================
algorithm_ID=3B42RT algorithm_version=01.00
granule_ID=3B41RT.2002090100.bin header_byte_length=2880
file_byte_length=(char2880)_header+(int2)x1440x720x2_data+(int1)x1440x720_data
nominal_YYYYMMDD=20020901 nominal_HHMMSS=000000
begin_YYYYMMDD=20020831 begin_HHMMSS=223000 end_YYYYMMDD=20020901
end_HHMMSS=013000 creation_date=20020901 west_boundary=0E
east_boundary=360E north_boundary=60N south_boundary=60S
origin=northwest number_of_latitude_bins=480
number_of_longitude_bins=1440 grid=0.25x0.25_deg_lat/lon
first_box_center=59.875N,0.125E second_box_center=59.875N,0.375E
last_box_center=59.875S,359.875E number_of_variables=3
variable_name=precipitation,precipitation_error,source
variable_units=mm/hr,mm/hr,source_number variable_scale=100,100,1
variable_type=signed_integer2,signed_integer2,signed_integer1
byte_order=big_endian flag_value=-31999
flag_name=insufficient_observations contact_name=TSDIS_Helpdesk
contact_address=NASA/GSFC_Code_902_Greenbelt_MD_20771_USA
contact_telephone=301-614-5184 contact_facsimile=301-614-5575
contact_email=helpdesk at tsdis.gsfc.nasa.gov
More information about the gradsusr
mailing list