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

Home » Public Forums » archive » H5D_Read on compound type (GDL)
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
H5D_Read on compound type (GDL) [message #88430] Thu, 24 April 2014 06:58 Go to next message
rjp23 is currently offline  rjp23
Messages: 97
Registered: June 2010
Member
I was hoping someone could help with this.

I'm converting some code from IDL to GDL. In IDL I normally use h5_parse but as that's not supported in GDL I'm trying to use the H5 procedures individually:

file_id = H5F_OPEN(file)
data_id = H5D_OPEN(file_id, '/path/to/variable/')
variable = H5D_READ(data_id)
H5D_CLOSE, data_id

This works fine for almost all the variables I need to read in.

However, it fails on the "time" variable as this is a "H5T_compound" type:

Dataset: 'Time'
H5T_COMPOUND (12 bytes)
10 elements

When trying this I get:

% H5D_READ: Read failed

Is there another way I should be trying to read this in?

Cheers

Rob
Re: H5D_Read on compound type (GDL) [message #88433 is a reply to message #88430] Thu, 24 April 2014 10:42 Go to previous messageGo to next message
markb77 is currently offline  markb77
Messages: 217
Registered: July 2006
Senior Member
I tested this on IDL 8.3, and it looks like you're reading it correctly. For a compound variable type, the command

var = h5d_read(data_id)

should simply read in the entire variable. I tested this by creating a compound variable in a new hdf5 file using HDFView. I was then able to read that variable back into IDL using the same command sequence you used.

Mark
Re: H5D_Read on compound type (GDL) [message #88434 is a reply to message #88433] Thu, 24 April 2014 11:20 Go to previous messageGo to next message
rjp23 is currently offline  rjp23
Messages: 97
Registered: June 2010
Member
Hi Mark,

Thanks for testing it. I can get it to work fine in IDL but GDL fails. I've submitted a GDL bug support but that doesn't help for now.

I wondered if there was another way to read it in that avoided using h5d_read? I'm hoping to avoid a messy solution like using python to read it in and writing that to a file that GDL can then read but I'm not sure what other options I have.

Any help appreciated.

Cheers

Rob
Re: H5D_Read on compound type (GDL) [message #88438 is a reply to message #88434] Thu, 24 April 2014 13:54 Go to previous message
kramers541 is currently offline  kramers541
Messages: 3
Registered: April 2014
Junior Member
H5D_read is a low-level routine, I'm afraid... no way around that.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: solve cubic polynomial for dummies?
Next Topic: Incrementing an element multiple times without a loop?

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

Current Time: Wed Oct 08 13:54:42 PDT 2025

Total time taken to generate the page: 0.00346 seconds