[ncl-talk] how to read a variable in group of hdf file?

Li Jiapeng hjiapli at gmail.com
Tue Nov 4 17:23:01 MST 2014


HDF appears to be much complicated than netCDF, The HDF example page has a FYI section on the difference between HDF4 and HDF-EOS:

www.ncl.ucar.edu/Applications/HDF.shtml

Sorry for my ignorance about this subject and the hasty reply (made by lijpbasin at 126.com).

---
Regards

I've changed the subscribing email from lijpbasin at 126.com to hjiapli at gmail.com.

On November 5, 2014 2:34:35 AM GMT+08:00, David Brown <dbrown at ucar.edu> wrote:
>There are certain variables, specifically coordinate variables, that
>are
>alluded to in the metadata when the file is read as HDF, but which are
>not
>visible as variables. To actually get the coordinate values you need to
>read the file as HDFEOS. The HDFEOS reader has specialized support for
>HDFEOS coordinates. From your print out, it appears that there are 3
>different swaths in the files (in HDF terms these are represented as
>different groups), and 3 corresponding coordinates named 'Time'. Since
>I
>think this is an HDFEOS2 file, NCL appends the group name to variables
>within the group. So for example Time_Low_Res_Swath means the Time
>coordinate variable in the Low_Res_Swath group.
>The HDFEOS2 reader was written before support for groups was added to
>NCL,
>so you cannot use the group syntax. However, all the variables in the
>HDFEOS file should be available. Hope this helps.
> -dave
>
>
>
>On Tue, Nov 4, 2014 at 10:13 AM, dyjbean at gmail.com <dyjbean at gmail.com>
>wrote:
>
>>
>> after i have changed the suffix of AMSR_E_L2A_201108010017_D.hdf into
>AMSR_E_L2A_201108010017_D.hdf.hdfeos,
>> there gave a
>> another variation, the "Time" variable has new variable names:
>>
>> double Time_High_Res_B_Swath ( DataTrack_lo_High_Res_B_Swath )
>> double Time_High_Res_A_Swath ( DataTrack_lo_High_Res_A_Swath )
>> double Time_Low_Res_Swath ( DataTrack_lo_Low_Res_Swath )
>>
>> above these three variables didn't appear in hdf file but in
>hdfeos,this
>> is a file format change.
>>
>>
>>
>> ------------------------------
>>  dyjbean at gmail.com
>>
>>
>> *From:* 李嘉鹏 <lijpbasin at 126.com>
>> *Date:* 2014-11-04 18:32
>> *To:* ncl-talk <ncl-talk at ucar.edu>
>> *Subject:* Re: [ncl-talk] how to read a variable in group of hdf
>file?
>> Hi, Try `ncl_filedump AMSR_E_L2A_201108010017_D.hdf`, it might give
>you
>> some hints of the corresponding variable name in NCL.
>>
>> On November 4, 2014 6:13:49 PM GMT+08:00, "dyjbean at gmail.com" <
>> dyjbean at gmail.com> wrote:
>> >hi,
>> >i want to read a variable "Time" which is involved in group  in a
>hdf
>> >file, a part of information of this hdf file is as follows:
>> >+++++++++++++++++++++++++++++++++++++++++++
>> >......
>> >GROUP=GeoField
>> >OBJECT=GeoField_1
>> >GeoFieldName="Time"
>> >DataType=DFNT_FLOAT64
>> >DimList=("DataTrack_lo")
>> >END_OBJECT=GeoField_1
>> >OBJECT=GeoField_2
>> >GeoFieldName="Latitude"
>> >DataType=DFNT_FLOAT32
>> >DimList=("DataTrack_lo","DataXTrack_lo")
>> >END_OBJECT=GeoField_2
>> >OBJECT=GeoField_3
>> >GeoFieldName="Longitude"
>> >DataType=DFNT_FLOAT32
>> >DimList=("DataTrack_lo","DataXTrack_lo")
>> >END_OBJECT=GeoField_3
>> >END_GROUP=GeoField
>> >......
>> >++++++++++++++++++++++++++++++++++++++++++++++++++
>> >
>> >i want to extract the "Time" in ncl, but it showed:
>>
>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> >
>> >ncl 0> ff=addfile("AMSR_E_L2A_201108010017_D.hdf","r")
>> >ncl 1> time=ff->Time
>> >fatal:["Execute.c":6321]:variable (Time) is not in file (ff)
>> >fatal:["Execute.c":8565]:Execute: Error occurred at or near line 1
>>
>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>> >
>> >it seems that there doesn't exist "Time" variable in this hdf
>file,but
>> >it does,
>> >
>> >how can i read this time info in ncl?
>> >
>> >
>> >thanks
>> >
>> >
>> >
>> >
>> >dyjbean at gmail.com
>> >
>> >
>>
>>------------------------------------------------------------------------
>> >
>> >_______________________________________________
>> >ncl-talk mailing list
>> >List instructions, subscriber options, unsubscribe:
>> >http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>ncl-talk mailing list
>List instructions, subscriber options, unsubscribe:
>http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.


More information about the ncl-talk mailing list