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

Home » Public Forums » archive » Reading .h5 files into IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Reading .h5 files into IDL [message #62125] Wed, 27 August 2008 06:10 Go to next message
Shawn[1] is currently offline  Shawn[1]
Messages: 5
Registered: August 2008
Junior Member
Hi all,

I got a problem with .h5 files and IDL. I am currently trying to read
data from my .h5 files into a GUI i created using IDL. May i know what
routines i could use for this? My .h5 file is of a matrix of 200x
200x60.
Re: Reading .h5 files into IDL [message #62213 is a reply to message #62125] Wed, 27 August 2008 07:47 Go to previous messageGo to next message
Wox is currently offline  Wox
Messages: 184
Registered: August 2006
Senior Member
On Wed, 27 Aug 2008 06:10:46 -0700 (PDT), Shawn
<shawnyeo_m@hotmail.com> wrote:

> Hi all,
>
> I got a problem with .h5 files and IDL. I am currently trying to read
> data from my .h5 files into a GUI i created using IDL. May i know what
> routines i could use for this? My .h5 file is of a matrix of 200x
> 200x60.

Depends on how your .h5 file is structured and whether you know the
structure on beforehand. This is the simplest case:

file_id = H5F_OPEN(file)
; You know e.g. that the data is in the "groupname"
; group and the dataset is called "dataname"
data_id = H5D_OPEN(file_id, '/groupname/dataname')
data = H5D_READ(data_id)
H5D_CLOSE, data_id
H5F_CLOSE, file_id

Check IDL's help for examples.
Re: Reading .h5 files into IDL [message #62567 is a reply to message #62125] Sun, 14 September 2008 20:18 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Shawn writes:

> I need some help on reading .h5 files.
> I am using a GUI to read in a .h5 file.
>
>
> My dataset is name a CAPPI
> This is the routines which i use:
>
> file_ID = H5F_OPEN (file_path)
> dataset_ID = H5D_OPEN(file_ID,CAPPI) ----- line 2
> data_space = h5d_get_space(dataset_ID)
> result_space = h5s_create_simple([200,200,30])
> vol_data = H5D_READ( dataset_ID)
> h5s_close, result_space
> h5s_close, data_space
> h5d_close, dataset_ID
> h5f_close, file_ID
>
> But whenever i run the program , i cannot seem to get get pass line
> 2 , It gives me an error mesage saying :H5D_OPEN: String expression
> required in this context: CAPPI.
>
> Can someone tell me what mistake or things have i left out.

I would try putting quotes around CAPPI (I.e., "CAPPI")
to make it a string. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Reading .h5 files into IDL
Next Topic: Maximum index for arrays?

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

Current Time: Wed Oct 08 15:10:47 PDT 2025

Total time taken to generate the page: 0.00561 seconds