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

Home » Public Forums » archive » Re: HDF frustrations
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: HDF frustrations [message #38153 is a reply to message #38143] Fri, 20 February 2004 14:56 Go to previous message
savoie is currently offline  savoie
Messages: 68
Registered: September 1996
Member
Michael Wallace <mwallace.removethismunge@swri.edu.invalid> writes:


> Anyway, someone far away on this vast internet was gracious enough to make
> some of his data available, but he created HDF files (with ample
> documentation of what all the fields mean). Maybe it's because I don't
> understand the HDF format itself, but I couldn't find any coherent
> explanation of the IDL API to HDF. In the past hour or so, I've only managed
> to determine that there are 13 tags in the file in question. And I've found
> which tags are being referenced. I tried using HDF_Browser to create a
> template for me, and I can see the field names and such, but there's nothing
> to click on to the make the template extract everything. When I try an
> HDF_Read afterward, I only get a couple of the metadata items in my
> structure. Where's the rest of the data? Why isn't it there?

This is a common complaint with HDF data. How do I get at the data!?

The IDL HDF_BROWSER function will let you make a template to extract all of
the data fields. The trick is that you have to explicity tell the template
to extract the data.

You have to highlight the data fields that you want in the GUI**, and then push
down the 'Read' button under the ATTRIBUTE VALUES button. Then the Extract
As: field will be visible. You can change this if you want, but this is the
tag within the structure that the selected data will be located after
extraction.


** Note: you must do this one at a time, you can't highlight multiple fields
and then say read, but you can select multiple fields within a single
hdf_browser() session and get multiple fields out with the hdf_read().


Of course, your mileage may vary depending on how the data is stored in the
HDF file. For all of my purposes, the data I want are the SDs. I can
highlight the one I want and select Read. Then the data is in the returned
structure after my HDF_READ().



IDL> mytemp = hdf_browser()
IDL> mydatastruct = hdf_read(template=mytemp)
IDL> help, mydatastruct,/st
** Structure <849814c>, 4 tags, length=25920036, data length=25920036, refs=1:
FILENAME STRING '/data/MOD10C2/MOD10C2.A2002313.003.20023280234'...
VERSION STRING '1.1'
DATE STRING 'Fri Feb 20 15:52:02 2004'
MOD_CMG_SNOW_5KM_EIGHT_DAY_CMG_SNOW_COVER
BYTE Array[7200, 3600]




> All I want to do is dump all of the data in the file into a structure! Is
> that too much to ask?! I really have no need or desire to learn all the ins
> and outs of HDF; I just want to read this data. Had this been plain text, I
> would already have my plots by now. Plain text files are _so_ much better.

Yup. But don't hesitate to ask if you have any more questions, I just wanted
to answer this as soon as possible. It is Friday afterall!


cheers,

Matt

--
Matthew Savoie - Scientific Programmer
National Snow and Ice Data Center
(303) 735-0785 http://nsidc.org
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: IDLgrModel, rotation angles
Next Topic: Optional parameters

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

Current Time: Sat Oct 11 09:03:14 PDT 2025

Total time taken to generate the page: 2.31808 seconds