comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » IDL 5.2: Can't read HDF files any more ...
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: IDL 5.2: Can't read HDF files any more ... [message #14310 is a reply to message #14269] Wed, 10 February 1999 00:00 Go to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
Harald Jeszenszky wrote:
> I've recently upgraded to IDL 5.2 on my NT machine and now I can't
> read my HDF files any more (which works perfectly well under IDL
> 5.1.1). The HDF files contains image data stored in scientific data
> sets (SDS). Every time I try to read the SDS, I get the following
> error message:
>
> %HDF_SD_GETDATA: Unsupported or unknown HDF data type (16406).
>
> The same error message appears if I use the HDF_BROWSER program.
>
> Does anybody know about this bug/behaviour?

I've reported a bug I found when trying to read HDF3.3r1 files in IDL
5.2. It turns out the bug (in my case) stems from the HDF4.1r2 library
from NCSA - it cannot read SDS objects created with HDF3.3r1.

The following code was very helpful in tracking down the problem. Try
running it on your HDF file in IDL 5.2 vs. IDL 5.1.

My advice; go back to IDL 5.1. I believe a fix for this problem is
planned for IDL 5.2.1.

Cheers,
Liam.

;---cut here---
PRO HDF_VERSION, FILE

;+
;Purpose:
; To print the version of HDF used by IDL and
; the version of HDF used to create a particular file.
;
;Input:
; FILE Name of the HDF file
;
;Output:
; None
;
;Author:
; Liam.Gumley@ssec.wisc.edu
;-

;- Check arguments

if n_elements( file ) ne 1 then $
message, 'Argument FILE is missing'

;- Check that input file is really HDF

if not hdf_ishdf( file ) then begin
help, file
message, 'Argument FILE is not HDF'
endif

;- Print version of IDL

print, ''
print, 'This is IDL version ', !version

;- Print version of HDF library used internally by IDL

hdf_lib_info, version=ver
print, 'This version of IDL was built with ', ver

;- Print version of HDF library used to create file

id = hdf_open( file, /read )
hdf_lib_info, id, version=ver
print, ''
print, file, ' was created with ', ver
hdf_close, id

;- List the names of all SDS in the file

sd_id = hdf_sd_start( file, /read )
hdf_sd_fileinfo, sd_id, nsds, natt
print, file, nsds, $
format = '( a, " contains ", i6, " SDS objects" )'
if nsds gt 0 then begin
print, ''
for index = 0, nsds-1 do begin
sds_id = hdf_sd_select( sd_id, index )
hdf_sd_getinfo, sds_id, name=name
print, index, name, $
format = '( "SDS object ", i6, " name is ", a )'
hdf_sd_endaccess, sds_id
endfor
endif
hdf_sd_end, sd_id

END
;---cut here---

---
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
1225 W. Dayton St., Madison WI 53706, USA
Phone (608) 265-5358, Fax (608) 262-5974
http://cimss.ssec.wisc.edu/~gumley
[Message index]
 
Read Message
Read Message
Previous Topic: Problems to use variables in a keyword-expression
Next Topic: DICOM3 read/write module with AVS and/or IDL ?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Apr 25 19:52:01 PDT 2026

Total time taken to generate the page: 1.12169 seconds