Re: HDF File Label and Description [message #22150 is a reply to message #22031] |
Thu, 19 October 2000 00:00   |
majewski
Messages: 15 Registered: March 2000
|
Junior Member |
|
|
On Wed, 18 Oct 2000 14:50:55 -0600, Kelly Dean <krdean@lamar.colostate.edu> wrote:
> However, the HDF_BROWSER from IDL 5.3 returned these file labels and
> descriptions as "AN". Unfortunetly, the HDF_BROWSER is a SAV and I am unable
> to see how they do it. Time to open up those manuals.
>
> Kelly
When you are using the HDF_BROWSER function what output does it return and secondly which
part do you want to access?
ie
a = HDF_BROWSER(filename)
help, a, /structure
is the info you want in
help, /structure, a.an
if so... then i think this might get you going in the right direction.
first off, i've never looked at the an section before - i only use sd bits
secondly, im using 5.2 - i don't know if hdf has changed though (still ver 4?)
that said
PRO HDF_AN_TEST
path = 'c:\my documents\leon\data\chl\'
Filename = path + 'test.hdf'
MY_FILE_ID = HDF_OPEN(Filename)
MY_AN_ID = HDF_AN_START(MY_FILE_ID)
Result = HDF_AN_FILEINFO(MY_AN_ID, nfl, nfd, ndl, nds)
if Result eq 0 then begin
print, nfl, nfd, ndl, nds
;annot types see HDF_AN_SELECT
;annot_type = 2 (file labels)
my_annot_type = 2
;index see HDF_AN_SELECT
my_index = 0
ann_id = HDF_AN_SELECT(an_id, my_index, my_annot_type)
if ann_id ne -1 then begin
Result = HDF_AN_READANN(ann_id, my_file_annot)
if Result ne -1 then begin
print, 'File_Label:',my_file_annot
endif else print,'AN failure 2'
endif else print,'AN failure 1'
endif else print,'AN failure 0'
HDF_AN_ENDACCESS, Result
HDF_CLOSE, MY_FILE_ID
END
-------------------------
Leon Majewski
Remote Sensing & Satellite Research Group
Curtin University of Technology, Perth, Australia
email: majewski@ses.curtin.edu.au
|
|
|