Options for HDF and units

M.Mahakur mmahakur at TROPMET.RES.IN
Tue Aug 29 15:51:56 EDT 2006


Respected Jennifer,

Thanks for your suggestions. I tried with variable as:

Actual_var_name_in_hdf_file=>npp 0 y,x

It is opening the data file and plots. But 'q attr' does not give anything:

ga-> q attr
No Attributes for File 1 :

Now I could get the actual name of variable as in the HDF data file
using a 'hdf_read' code, which I was using for reading some other HDF5
data. But, h5dump did not worked (which I had tried earlier)!

I checked with different UNDEF values, it display the same range of
values. so, its OK.

Whether "0 y,x" only will take care of non-standard binary (i.e. 16-bits
signed integer in this case)? The plot is showing data range 0-10000.
Actual value will go max. upto 32767, all negative values are missing
data as per the data documentations.

Here is the sample data I got from hdf_read:

File: /home/mm/test/test.HDF


Array:  NPP_VGT1_19980401SD_0
        reference = 2
        number type = 16-bit signed integer
        number of dimensions = 2 (3222x3275)
        number of attributes = 0


Dimension 1: fakeDim0
        size = 3222
        number type = number-type not set
        number of attributes = 0


Dimension 2: fakeDim1
        size = 3275
        number type = number-type not set
        number of attributes = 0


Data:


    -2     -3      0      0      0      0      0      0      0      0      0
     0      0      0      0      0      0      0      0    145    357    177
     0      0      0      0      0      0      0      0      0     64    114
    48     64    131    132     31     48    232    198     81     31     48
    65    183    233    149    185    134    100    168     49      0      0
     0      0      0      0      0    205    170    153    101     67     67
    85     85     85     85     85    206    102    102     32     50      0
     0      0      0      0      0      0      0     33      0      0      0
     0      0      0      0      0      0     -3      0     -3     -3     -3
     0     86    156     86      0      0      0      0      0     -3      0
    -2     -2     -2     -2     -2     -4     -2     -3      0      0      0
     0     -2     -3     -2     -2     -3      0      0      0     -3     -3
 ............... .... ...

Thanks again.

Regards,

Mahakur

Jennifer M. Adams wrote:

>
> On Aug 28, 2006, at 8:22 AM, M.Mahakur wrote:
>
>> GrADS Users:
>>
>> I  created a ctl for the HDF (Gridded) data file. But, it shows entire
>> domain as undefined!! The data is "16 bits signed short integer". What
>> should I write in the ctl for 'OPTIONS' and 'variable units' for
>> non-standard binary (as I guess I have to treat like non-standard
>> binary!!).
>
> With 'dtype hdfsds', you use the variable declaration as documented here:
>    http://iges.org/grads/gadoc/SDFdescriptorfile.html
>
> For your data set, it will probably look like this:
> npp 0 y,x npp
>
> Also, you may have to change your undef value -- most HDF files I have
> met have an undef of the same type as the data, and many use an undef
> value of "0" (zero).  If you can GrADS to open the descriptor file,
> try the 'q attr' command and see what other metadata is there...
>
> Jennifer
>
>
>
>
>>
>> The No. of lats and lons are 3275 and 3222. I feel the file size should
>> be 21104100 bytes (=3275*3222*2). However, the actual file size is
>> 21106990 i.e. 2890 extra bytes. Is this because of some 'HEADER' inside
>> the HDF data file?
>>
>> I had mentioned earlier I could NOT open using 'sdfopen'.
>>
>> Thanks.
>>
>> With Regards,
>>
>> M. Mahakur
>>
>> P.S. : I am using the following as ctl:
>>
>> DSET ^test.HDF
>> DTYPE hdfsds
>> UNDEF -1.0E-33
>> XDEF  3275  LINEAR 68.1442 0.008928571
>> YDEF  3222 linear 6.74583 0.008928571
>> TDEF  1 LINEAR 01apr1998 1dy
>> ZDEF  1 LINEAR 1 1
>> VARS 1
>> npp -1,40,2,-1 0  NPP
>> ENDVARS
>>
>
> Jennifer M. Adams
> IGES/COLA
> 4041 Powder Mill Road, Suite 302
> Beltsville, MD 20705
> jma at cola.iges.org <mailto:jma at cola.iges.org>
>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20060830/764384b9/attachment.html 


More information about the gradsusr mailing list