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

Home » Public Forums » archive » Help with HDF_VD_WRITE - field names
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
Help with HDF_VD_WRITE - field names [message #59644] Fri, 04 April 2008 07:29 Go to next message
Thiago Biscaro is currently offline  Thiago Biscaro
Messages: 4
Registered: December 2005
Junior Member
Hi everybody

I'm trying to write a Vdata to an HDF file, but for some reason, the
only field description IDL accepts is 'PX', like the example in the
IDL user's guide.

The command

HDF_VD_WRITE, Vdat, 'PX', intarr(5)

works fine, but

HDF_VD_WRITE, Vdat, 'RR', intarr(5)

returns

HDF_VD_WRITE: Unable to set the VDATA fieldnames to <STRING ('RR')>.

I need to set the field name to something that I can understand later,
so PX is not an option... Any ideas on how to sole this? I know I can
write as an SDS, but I need to do as Vdata for compatibility with some
files we process here.

Thanks!
Re: Help with HDF_VD_WRITE - field names [message #59676 is a reply to message #59644] Tue, 08 April 2008 05:47 Go to previous message
Thiago Biscaro is currently offline  Thiago Biscaro
Messages: 4
Registered: December 2005
Junior Member
On 7 abr, 14:37, jameskuy...@verizon.net wrote:
> Thiago Biscaro wrote:
>> Hi everybody
>
>> I'm trying to write a Vdata to an HDF file, but for some reason, the
>> only field description IDL accepts is 'PX', like the example in the
>> IDL user's guide.
>
>> The command
>
>> HDF_VD_WRITE, Vdat, 'PX', intarr(5)
>
>> works fine, but
>
>> HDF_VD_WRITE, Vdat, 'RR', intarr(5)
>
>> returns
>
>> HDF_VD_WRITE: Unable to set the VDATA fieldnames to <STRING ('RR')>.
>
>> I need to set the field name to something that I can understand later,
>> so PX is not an option... Any ideas on how to sole this? I know I can
>> write as an SDS, but I need to do as Vdata for compatibility with some
>> files we process here.
>
> The following code works fine for me. Could you provide a more precise
> explanation of what you're trying to do?
>
> filename = 'test.hdf'
> fieldname = 'RR'
>
> file = HDF_Open(filename,/CREATE)
> Vdat = HDF_VD_Attach(file, -1)
> HDF_VD_FDefine, Vdat, fieldname
> ; /INT, ORDER=5HDF_VD_WRITE, Vdat, fieldname, intarr(5)
> HDF_VD_Detach, Vdat
> HDF_Close, file

Yes, this works just fine. I didn't know that I had to pre-define the
field name with the HDF_VD_DEFINE. Thank you very much!
Re: Help with HDF_VD_WRITE - field names [message #59686 is a reply to message #59644] Mon, 07 April 2008 10:37 Go to previous message
jameskuyper is currently offline  jameskuyper
Messages: 79
Registered: October 2007
Member
Thiago Biscaro wrote:
> Hi everybody
>
> I'm trying to write a Vdata to an HDF file, but for some reason, the
> only field description IDL accepts is 'PX', like the example in the
> IDL user's guide.
>
> The command
>
> HDF_VD_WRITE, Vdat, 'PX', intarr(5)
>
> works fine, but
>
> HDF_VD_WRITE, Vdat, 'RR', intarr(5)
>
> returns
>
> HDF_VD_WRITE: Unable to set the VDATA fieldnames to <STRING ('RR')>.
>
> I need to set the field name to something that I can understand later,
> so PX is not an option... Any ideas on how to sole this? I know I can
> write as an SDS, but I need to do as Vdata for compatibility with some
> files we process here.

The following code works fine for me. Could you provide a more precise
explanation of what you're trying to do?

filename = 'test.hdf'
fieldname = 'RR'

file = HDF_Open(filename,/CREATE)
Vdat = HDF_VD_Attach(file, -1)
HDF_VD_FDefine, Vdat, fieldname
; /INT, ORDER=5
HDF_VD_WRITE, Vdat, fieldname, intarr(5)
HDF_VD_Detach, Vdat
HDF_Close, file
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Anyone link GSL into IDL?
Next Topic: Tilde with IDL

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

Current Time: Fri Oct 10 17:28:49 PDT 2025

Total time taken to generate the page: 0.88167 seconds