problem display contents in hdf file

brian vant-hull brianvanthull at YAHOO.COM
Fri Jan 11 13:32:52 EST 2008


Zhao;
'scale_factor' and 'add_off' are just example
variables in user's guide.  You have to provide names
that are spelled exactly as they appear in the hdf
file.  Unfortunately these names often change
depending on the variable within each file!  In that
case you'd have to open the file separately for each
variable.

I don't know if there's a way to have GrADS dump the
variable names so you can put them in the ctl file.
If not, IDL and Matlab have built in functions, and
you can download libraries to read hdf in C or
Fortran.  Or just ask someone else who's figured out
how to use your particular dataset.  Once you have the
correct names for the offset and scale you are good to
go.

Anybody who has worked with hdf before should be able
to give you something that will get the variable names
for you, but it's a multiple step process or program.
If you have IDL or Matlab go to
http://www.atmos.umd.edu/~gcm and click on the blue
useful button, then go down to the link about reading
hdf in matlab and IDL.  This will show you how to go
about it.

-Brian.

--- li zhao <janelizhao at YAHOO.COM> wrote:

> Hi everybody,
>
> Probably this is a simple fix but I must be missing
> something. I try to open a hdf file and it loads
> well,
> but giving the following error message when
> displaying
> the variable.
>
> ga-> d lst_day_cmg
> Warning: HDF attribute named "add_off" does not
> exist
> Warning: Could not retrieve "add_off" -- setting to
> 0.0
> HDF-SDS Read Error for dtype UINT16
> Data Request Error:  Error for variable
> 'lst_day_cmg'
>   Error ocurred at column 1
> DISPLAY error:  Invalid expression
>   Expression = lst_day_cmg
>
>
> Grads configuration as follows:
> (Config: v1.9b4 32-bit little-endian readline
> sdf/xdf
> hdf-sds netcdf lats printim)
>
>
> Below is the actual ctl file I am using:
>
> ***********************************************
> dset ^MOD11C3.A2000061.004.2004116185101.hdf
> dtype hdfsds
> options yrev
> undef 0s
> unpack scale_factor add_off
> xdef 7200 linear -180.0 0.05
> ydef 3600 linear  -90.0 0.05
> zdef 1 levels 1
> tdef 1 linear 1jan1989 1dy
> vars 16
> LST_Day_CMG=>lst_day_cmg 1 z,y,x Monthly daytime
> 3min
> CMG Land-surface Temperature
> QC_Day=>qc_day 0 y,x Sea surface temperature
> Day_view_time=>day_view_time 0 y,x Sea surface
> temperature
> Day_view_angl=>day_view_angl 0 y,x Sea surface
> temperature
> Clear_sky_days=>clear_sky_days 0 y,x Sea surface
> temperature
> LST_Night_CMG=>lst_night_cmg 0 y,x Sea surface
> temperature
> QC_Night=>qc_night 0 y,x Sea surface temperature
> Night_view_time=>night_view_time 0 y,x Sea surface
> temperature
> Night_view_angl=>night_view_angl 0 y,x Sea surface
> temperature
> Clear_sky_Night=>clear_sky_night 0 y,x Sea surface
> temperature
> Emis_20=>emis_20 0 y,x Sea surface temperature
> Emis_22=>emis_22 0 y,x Sea surface temperature
> Emis_23=>emis_23 0 y,x Sea surface temperature
> Emis_29=>emis_29 0 y,x Sea surface temperature
> Emis_31=>emis_31 0 y,x Sea surface temperature
> Emis_32=>emis_32 0 y,x Sea surface temperature
> endvars
>
> Thanks for your help,
> Zhao
>
>
>
>
____________________________________________________________________________________
> Looking for last minute shopping deals?
> Find them fast with Yahoo! Search.
>
http://tools.search.yahoo.com/newsearch/category.php?category=shopping
>


Brian Vant-Hull
917-318-4481


      ____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping



More information about the gradsusr mailing list