[gradsusr] how to open he5 data in grads

James E. Johnson James.Johnson at nasa.gov
Tue Mar 13 17:01:46 EDT 2012


On Tuesday, March 13, 2012 02:39:50 pm Midhun M wrote:
> Thank your for your response. I made some mistake in .ctl file and that
> lead to the errors.  (I wrote the line
> "/HDFEOS/GRIDS/NadirGrid/Data~Fields/H2O=>h2o   15  x,y,z   H2O mixing
> ratio profile" in two lines.) Now that .ctl file is working properly.
> 
> Can you please explain the way you created .ctl file for he5 file. I want
> to do the same for Daily data from TES. Links for such files are given
> below..
> 
> ftp://l4ftl01.larc.nasa.gov/tesl1l2l3/TES/TL3H2OD.003/2006.01.12/TES-Aura_L
> 3-H2O_r0000003241_F01_09.he5
> ftp://l4ftl01.larc.nasa.gov/tesl1l2l3/TES/TL3H2OD.003/2006.01.14/TES-Aura_
> L3-H2O_r0000003243_F01_09.he5
> ftp://l4ftl01.larc.nasa.gov/tesl1l2l3/TES/TL3H2OD.003/2006.01.16/TES-Aura_
> L3-H2O_r0000003248_F01_09.he5
> ftp://l4ftl01.larc.nasa.gov/tesl1l2l3/TES/TL3H2OD.003/2006.01.18/TES-Aura_
> L3-H2O_r0000003256_F01_09.he5
> ftp://l4ftl01.larc.nasa.gov/tesl1l2l3/TES/TL3H2OD.003/2006.01.20/TES-Aura_
> L3-H2O_r0000003264_F01_09.he5
> ftp://l4ftl01.larc.nasa.gov/tesl1l2l3/TES/TL3H2OD.003/2006.01.22/TES-Aura_
> L3-H2O_r0000003269_F01_09.he5
> ftp://l4ftl01.larc.nasa.gov/tesl1l2l3/TES/TL3H2OD.003/2006.01.24/TES-Aura_
> L3-H2O_r0000003274_F01_09.he5
> ftp://l4ftl01.larc.nasa.gov/tesl1l2l3/TES/TL3H2OD.003/2006.01.28/TES-Aura_
> L3-H2O_r0000003288_F01_09.he5
> 
> Please help me in this regard,
> 
> sincerely,

You just need to read the GrADS documentation at 
http://grads.iges.org/grads/gadoc/index.html particularly the section on 
'Reading netCDF and HDF-SDS Files' and the section on control file 
http://grads.iges.org/grads/gadoc/gadocindex.html. The user forum has some 
examples as well. Also you should review TES data documentation at 
http://eosweb.larc.nasa.gov/PRODOCS/tes/table_tes.html for dimensionality, 
grid resolution and pressure levels.

You need to do a dump of the contents of one of these files to be able to 
write a control file. Here is a h5dump of file contents:

$ h5dump -n TES-Aura_L3-H2O_r0000003264_F01_09.he5 

HDF5 "TES-Aura_L3-H2O_r0000003264_F01_09.he5" {
FILE_CONTENTS {
 group      /HDFEOS
 group      /HDFEOS/ADDITIONAL
 group      /HDFEOS/ADDITIONAL/FILE_ATTRIBUTES
 group      /HDFEOS/GRIDS
 group      /HDFEOS/GRIDS/NadirGrid
 group      /HDFEOS/GRIDS/NadirGrid/Data Fields
 dataset    /HDFEOS/GRIDS/NadirGrid/Data Fields/H2O
 dataset    /HDFEOS/GRIDS/NadirGrid/Data Fields/H2OAtSurface
 dataset    /HDFEOS/GRIDS/NadirGrid/Data Fields/Latitude
 dataset    /HDFEOS/GRIDS/NadirGrid/Data Fields/Longitude
 dataset    /HDFEOS/GRIDS/NadirGrid/Data Fields/Pressure
 dataset    /HDFEOS/GRIDS/NadirGrid/Data Fields/SurfacePressure
 dataset    /HDFEOS/GRIDS/NadirGrid/Data Fields/TotalColumnDensity
 group      /HDFEOS INFORMATION
 dataset    /HDFEOS INFORMATION/StructMetadata.0
 dataset    /HDFEOS INFORMATION/coremetadata
 }
}

Then examine each of the dataset array/variables for their size, missing 
value, etc.:

$ h5dump -H -d/HDFEOS/GRIDS/NadirGrid/Data\ Fields/H2O TES-Aura_L3-
H2O_r0000003264_F01_09.he5 
HDF5 "TES-Aura_L3-H2O_r0000003264_F01_09.he5" {
DATASET "/HDFEOS/GRIDS/NadirGrid/Data Fields/H2O" {
   DATATYPE  H5T_IEEE_F32LE
   DATASPACE  SIMPLE { ( 15, 83, 90 ) / ( 15, 83, 90 ) }
   ATTRIBUTE "_FillValue" {
      DATATYPE  H5T_IEEE_F32LE
      DATASPACE  SIMPLE { ( 1 ) / ( 1 ) }
   }
   ATTRIBUTE "MissingValue" {
      DATATYPE  H5T_IEEE_F32LE
      DATASPACE  SIMPLE { ( 1 ) / ( 1 ) }
   }
   ATTRIBUTE "Title" {
      DATATYPE  H5T_STRING {
            STRSIZE 3;
            STRPAD H5T_STR_NULLTERM;
            CSET H5T_CSET_ASCII;
            CTYPE H5T_C_S1;
         }
      DATASPACE  SCALAR
   }
   ATTRIBUTE "Units" {
      DATATYPE  H5T_STRING {
            STRSIZE 3;
            STRPAD H5T_STR_NULLTERM;
            CSET H5T_CSET_ASCII;
            CTYPE H5T_C_S1;
         }
      DATASPACE  SCALAR
   }
   ATTRIBUTE "UniqueFieldDefinition" {
      DATATYPE  H5T_STRING {
            STRSIZE 21;
            STRPAD H5T_STR_NULLTERM;
            CSET H5T_CSET_ASCII;
            CTYPE H5T_C_S1;
         }
      DATASPACE  SCALAR
   }
}
}

Using this information it is now easy to make the .ctl file (assuming you have 
GrADS 2.0.a8 or higher):

---------- tl3hdod.ctl --------------
DSET ^TES-Aura_L3-H2O_r00000%t5_F01_09.he5
OPTIONS template
DTYPE hdf5_grid
TITLE TES L3 Daily Water Vapor (H2O) Collection 003 (F01_09)
UNDEF -999.0 _FillValue
XDEF 90 linear -180 4.0
YDEF 83 linear -82 2.0
ZDEF 15 levels 825.402, 681.291, 464.16, 316.227, 215.444, 146.779,
               100, 68.1295, 46.4158, 31.6229, 21.5443, 14.678, 10,
               6.81291, 4.6416
TDEF 20000 linear 15jul2004 1dy
VARS 3
/HDFEOS/GRIDS/NadirGrid/Data~Fields/H2O=>h2o                         15  z,y,x    
HDO mixing ratio profile
/HDFEOS/GRIDS/NadirGrid/Data~Fields/H2OAtSurface=>h2osfc              0  y,x      
HDO mixing ratio profile standard deviation
/HDFEOS/GRIDS/NadirGrid/Data~Fields/TotalColumnDensity=>h2ocol        0  y,x      
HDO total column density
ENDVARS
---------- tl3hdod.ctl --------------

If you have GrADS 2.0.a7 then change the first line to
DSET ^TES-Aura_L3-H2O_r0000003%t3_F01_09.he5



$ grads

Grid Analysis and Display System (GrADS) Version 2.0.a7.1
Copyright (c) 1988-2008 by Brian Doty and the 
Institute for Global Environment and Society (IGES)
GrADS comes with ABSOLUTELY NO WARRANTY
See file COPYRIGHT for more information

Config: v2.0.a7.1 little-endian readline printim grib2 netcdf hdf4-sds hdf5 
geotiff
Issue 'q config' command for more information.
Landscape mode? ('n' for portrait):  
GX Package Initialization: Size = 11 8.5 
ga-> open tl3hdod.ctl 
Scanning description file:  tl3hdod.ctl
Data file TES-Aura_L3-H2O_r0000003%t3_F01_09.he5 is open as file 1
LON set to 0 360 
LAT set to -82 82 
LEV set to 825.402 825.402 
Time values set: 2004:7:15:0 2004:7:15:0 
E set to 1 1 
ga-> set lon -180 180
LON set to -180 180 
ga-> set z 2
LEV set to 681.291 681.291 
ga-> set t 264
Time values set: 2005:4:4:0 2005:4:4:0 
ga-> set gxout grfill
ga-> d h2o
Contouring: 0.003 to 0.024 interval 0.003 
ga->


The TES files are named with a run number (e.g. r0000003264) and doesn't map 
to a date (there can be multiple runs on a day, or none, and the next run 
number isn't necessarily the next day). So here I'm just using time as an 
index based on run number, not as an actual date. So ignore the dates here, 
they are wrong. Of course you could always rename the files if you want the 
dates correct.

------------------------------------------------------------------------------
| James E. Johnson                      | address:                           |
| Wyle Information Systems, Inc.        |  NASA Goddard Space Flight Center  |
| e-mail: james.johnson at nasa.gov        |  Distributed Active Archive Center |
| phone:  301-614-5121                  |  Code 610.2, Bldg 32, Room S130G   |
| fax:    301-614-5268                  |  Greenbelt, MD  20771              |
------------------------------------------------------------------------------



More information about the gradsusr mailing list