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 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: HDF_SD_ADDDATA with strings [message #60477] Tue, 20 May 2008 18:06
kostya is currently offline  kostya
Messages: 3
Registered: May 2008
Junior Member
thanks a lot,
the HDF files were created with Java NEXUS library so there is not
much I can do in regards to creating the files. I looked at the Java
code that we use to create and modify HDF files and it looks pretty
easy there (changing string size is straightforward), I thought I
could do similar things with IDL but it looks like it's not the case.
Re: HDF_SD_ADDDATA with strings [message #60480 is a reply to message #60477] Tue, 20 May 2008 17:14 Go 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.
Re: HDF_SD_ADDDATA with strings [message #60486 is a reply to message #60480] Tue, 20 May 2008 15:40 Go to previous message
kostya is currently offline  kostya
Messages: 3
Registered: May 2008
Junior Member
sorry, forgot to mention I'm using IDL 6.4
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Wed Oct 08 17:48:09 PDT 2025

Total time taken to generate the page: 0.00629 seconds