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

Home » Public Forums » archive » Writing SD HDF files in IDL - prob with attributes
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
Writing SD HDF files in IDL - prob with attributes [message #8463] Fri, 14 March 1997 00:00
Anne I. Morrison is currently offline  Anne I. Morrison
Messages: 1
Registered: March 1997
Junior Member
My colleague has been trying to write an IDL procedure to write an HDF
file with a set of global attributes and 4 SD datasets. It appears to
write the file ok, but when trying to read it back in, it doesn't appear
to have the attributes. Also, the file seems to be much bigger than it
should be (nearly 4MB instead of about 1MB) Can anyone help?

Creating file goes like this:

file_id=HDF_OPEN(hdfile_name, /ALL)
sd_id=HDF_SD_START(hdfile_name, /RDWR)

sds_id_0=HDF_SD_CREATE(sd_id, count_string+'_0', [512,512], /FLOAT)
sds_id_1=HDF_SD_CREATE(sd_id, count_string+'_1', [512,512], /FLOAT)
sds_id_2=HDF_SD_CREATE(sd_id, count_string+'_2', [512,512], /INT)
sds_id_3=HDF_SD_CREATE(sd_id, count_string+'_3', [512,512], /FLOAT)
HDF_SD_ATTRSET, sd_id, 'AcTime', acquisition_time
HDF_SD_ATTRSET, sd_id, 'View', view
HDF_SD_ADDDATA, sds_id_0, latitude_grid
HDF_SD_ADDDATA, sds_id_1, longitude_grid
HDF_SD_ADDDATA, sds_id_2, con_word
HDF_SD_ADDDATA, sds_id_3, plot_param

AcTime_attr=HDF_SD_ATTRFIND(sd_id, 'AcTime')
HDF_SD_ATTRINFO, sd_id, AcTime_attr

HDF_SD_FILEINFO, sd_id, datasets, attributes

HDF_SD_END, sd_id

Reading the file back goes like this:

file_id=HDF_OPEN('tout', /READ)
sd_id=HDF_SD_START('tout', /READ)

HDF_SD_FILEINFO, sd_id, datasets, attributes
help, datasets, attributes

AcTime_attr=HDF_SD_ATTRFIND(sd_id, 'AcTime')
HDF_SD_ATTRINFO, sd_id, AcTime_attr, data=acquistion_time

And it falls over at the HDF_SD_ATTRFIND line.
Any ideas anyone?
Thanks, Anne.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: PLOT with tick marks?
Next Topic: Re: shaded surface

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

Current Time: Wed Oct 08 11:51:07 PDT 2025

Total time taken to generate the page: 0.00565 seconds