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

Home » Public Forums » archive » Re: opening .h5 data files
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: opening .h5 data files [message #74239 is a reply to message #74238] Wed, 05 January 2011 08:23 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 1/5/11 7:55 am, David Fanning wrote:
> Liam Gumley writes:
>
>> Neil, try this:
>>
>> result = h5_parse(file, /read_data)
>> help, result, /structure
>
> Whoa! That's pretty impressive. :-)
>
> So, now I have the data:
>
> IDL> help, result.hdfeos.grids.set1.data_fields.u._data
> <Expression> FLOAT = Array[360, 180]
>
> How do I read just that variable out of the file
> without reading everything?

I use MG_H5_GETDATA to do it:

IDL> u = mg_h5_getdata(file, '/result/hdfeos/grids/set1/data_fields/u')

It also can grab a section of a variable if you don't want to read the
entire variable:

IDL> f = filepath('hdf5_test.h5', subdir=['examples', 'data'])
IDL> res3 = mg_h5_getdata(f, '/arrays/3D int array[3, 5:*:2, 0:49:3]')

Get mg_h5_getdata.pro at:

http://michaelgalloy.com/wp-content/uploads/2011/01/mg_h5_ge tdata.pro

Mike
--
www.michaelgalloy.com
Research Mathematician
Tech-X Corporation
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDL output directed to STDERR-- can't seem to work around...
Next Topic: Book Editors Needed. Apply Within

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

Current Time: Wed Oct 08 18:19:35 PDT 2025

Total time taken to generate the page: 0.00262 seconds