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

Home » Public Forums » archive » Re: HDF_SD_ADDDATA with strings
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_SD_ADDDATA with strings [message #60480 is a reply to message #60477] Tue, 20 May 2008 17:14 Go to previous messageGo to previous message
jameskuyper is currently offline  jameskuyper
Messages: 79
Registered: October 2007
Member
kostya wrote:
> Hi everybody,
>
> I'm having trouble modifying a string in SD dataset in HDF4 file.
> Basically I'm trying to overwrite 'true' with 'false' and this is what
> I get: HDF_SD_ADDDATA: Cannot write 5 elements. The data area is not
> that big.
>
> I could not find any option to modify the string size in SD using IDL.
> Another option would be to delete this dataset and create a new one
> with the same name but I can't seem to find this option either. Any
> ideas?

HDF SDSs have a length that can be modified, only if they were initially
created with that option. Using the IDL HDF_SD_* interface, this can be
done by setting the dimension length to a number less than 1 in the call
to HDF_SD_Create(). This can only be done on the last dimension. If that
option was selected when the SDS was created, the SDS automatically
gets extended when you write beyond it's current length; otherwise, the
length is fixed. The SD that you're writing to apparently has a fixed
length.

That's why it's generally a better idea to make strings HDF attributes.
When you write a new value for an attribute which is bigger than the
original value, the old value remains in the file, but it's marked to
indicate that it's no longer in use. The new value is written to the
file, and the appropriate parts of the file are changed to indicate that
the new location is where the current value for the specified attribute
is stored. I'm not sure whether this is also done if the new value is
shorter.
An HDF attribute can be attached to many kinds of HDF construct: Files,
Scientific Datasets, Raster images, Vdatas, or Vdata fields.
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: problem in using function ll_to_utm.pro
Next Topic: iTools export to variable woes

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

Current Time: Sun Oct 12 13:03:57 PDT 2025

Total time taken to generate the page: 0.96336 seconds