problem display contents in hdf file

Mike Bosilovich mike.bosilovich at GMAIL.COM
Mon Jan 14 14:21:18 EST 2008


Hi,

I've been able to use the MOD11 data in grads on a linux box for some time.
one of my xdf files is attached below. (note I'm using MOD11C1)

You didn't mention why you have the "1 z" in the VARS line for lst_day_cmg
and no others. Is it only that variable? In other words, change "1 z,y,x" to
"0 y,x".

I could be wrong, but grads links to the libraries on each machine. You may
like to check the hdf libraries, if this persists.

Also, were it me, I'd have the correct date in the TDEF. I don't think that
is your problem, but it could lead to difficulties down the line.

Good Luck,

Mike

DSET data/Y2004/M%m2/MOD11C1.A2004%m2%d2.004.hdf
title MODIS Land Surface Temperature (LST) CMG v4 by Zhengming Wan
DTYPE hdfsds
OPTIONS yrev template
unpack scale_factor add_offset
undef -999.0
XDEF 7200 linear -180 0.05
YDEF 3600 linear  -90 0.05
ZDEF 1 linear 1 1
TDEF 31  linear 01JUL2004 1dy
VARS 6
LST_Day_CMG=>LSTDay 0 y,x Daily daytime 3min CMG Land-surface Temp
LST_Night_CMG=>LSTNite 0 y,x Daily nighttime 3min CMG Land-surface Temp
QC_Day=>QCDay  0 y,x Quality control for daytime LST and emissivity
QC_Night=>QCNite  0 y,x Quality control for nighttime LST and emissivity
Day_view_time=>DayTime  0 y,x Time of daytime LST observation (UTC)
Night_view_time=>NiteTime  0 y,x Time of nighttime LST observation (UTC)
ENDVARS



On Jan 12, 2008 2:34 PM, li zhao <janelizhao at yahoo.com> wrote:

> Hi Brian,
>
> I think the problem is not with scale_factor and
> add_off. Also, I did  "ncdump" on that hdf file and
> figured out the variables and included them in the ctl
> file when I posted my question in the previous mail.
>
> Infact I ran this script on GrADS v1.9b4 on alpha
> machine. However when I run the same version of grads
> on LINUX X86_64, the script gives error messages as I
> mentioned in the last mail.
>
>
> For your information I am attaching the errors again:
>  ga-> d lst_day_cmg
> 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
>
>
> Please also see the attached ctl file:
>
>
>  ***********************************************
>  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
> ***********************************************************************
>
> regards
> Zhao
>
> --- brian vant-hull <brianvanthull at YAHOO.COM> wrote:
>
> > 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 <http://www.atmos.umd.edu/%7Egcm> 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
> >
>
>
>
>
>  ____________________________________________________________________________________
> Never miss a thing.  Make Yahoo your home page.
> http://www.yahoo.com/r/hs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20080114/c9ceab6e/attachment.html 


More information about the gradsusr mailing list