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

Home » Public Forums » archive » Reading HDF5 Variable
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: Reading HDF5 Variable [message #42591 is a reply to message #42521] Mon, 14 February 2005 16:43 Go to previous messageGo to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
David Fanning wrote:
> Folks,
>
> Does anyone know if it is even *possible* to learn how
> to access a variable from an HDF5 file from the IDL
> documentation!?

I'm not sure what you mean by a "variable". HDF5 files contain groups,
which can contain datasets, and virtually any HDF5 feature can have an
attribute. I'll assume you're talking about a dataset.

> I really don't have a week to figure this out. Does
> anyone have a simple example. I can see and access
> the data with H5_QUERY. But I can't make any sense
> of the palette that is suppose to be attached to the
> data. It is 976 elements long. That doesn't even
> begin to divide by 256. :-(
>
> What I am trying to do is extract a 2D image and its
> accompanying palette in order to build and save a JPEG
> file. (Typically I don't mind spending hours and hours
> researching a topic, but the FAFSA Student Aid forms
> are due today and I'm working on income taxes. :-(

I didn't know much of anything about HDF5 a few minutes ago, but I am
quite familiar with HDF4. The IDL interface for HDF5 is sufficiently
similar to the one for HDF4 that it didn't take me long to figure out
the following from the IDL documentation. However, I have no easy way to
obtain a test file to try it with. Since you're having problems, and
this was so trivial, I presume that it either doesn't work, or that
you're talking about something else.

file_id = H5F_Open(filename)
dataset_id = H5D_Open(file_id, dataset_name)
data = H5D_Read(dataset_id)
H5D_Close, dataset_id
H5F_Close, file_id
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Mapping the Pacific
Next Topic: GDL 0.8.8 released...

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

Current Time: Sat Oct 11 07:53:06 PDT 2025

Total time taken to generate the page: 0.88033 seconds