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

Home » Public Forums » archive » Re: How do I get IDL to place a string array into a netdcf file attribute?
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: How do I get IDL to place a string array into a netdcf file attribute? [message #84408] Mon, 03 June 2013 12:08 Go to next message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 6/1/13 7:19 AM, Fabien wrote:
> An array of strings is not really an attribute anymore. You should
> define a new variable (as a string array) for this. Why do you want to
> keep it as an attribute?
>
> Cheers,
>
> fab

Another option is to make a scalar string from your string array by
concatenating with STRJOIN (using the appropriate CR/LF delimiters).

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
Re: How do I get IDL to place a string array into a netdcf file attribute? [message #84427 is a reply to message #84408] Sun, 02 June 2013 10:40 Go to previous messageGo to next message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
Hi again,

On 06/02/2013 02:19 AM, Peter Thorne wrote:
> how to pass a flag meanings attribute which makes the flag
> arrays make sense to a user

I use NetCDF extensively, and as a user I will not expect a variable
attribute to be an array (I don't think that it is allowed by NetCDF
but I did not check it).
I don't see the problem with giving flag information as a variable. You
need to define a new dimension, nflags = 50 and then a variable
flags(nflags). You can refer to this flag variable in the concerned
variable's attributes.
I know that some institutions provide extensive metadata in their
attributes using XML (cf HDF_EOS formats), but this is not very handy
for everyone.

This is my personal opinion, but maybe someone out here has more
experience on writing attributes as arrays...

Cheers,
Fab
Re: How do I get IDL to place a string array into a netdcf file attribute? [message #84433 is a reply to message #84427] Sat, 01 June 2013 17:19 Go to previous messageGo to next message
Peter Thorne is currently offline  Peter Thorne
Messages: 13
Registered: October 2000
Junior Member
On Saturday, June 1, 2013 9:19:17 AM UTC-4, Fabien wrote:
> An array of strings is not really an attribute anymore. You should
>
> define a new variable (as a string array) for this. Why do you want to
>
> keep it as an attribute?
>
>
>
> Cheers,
>
>
>
> fab

Thanks. Am trying to make some cf compliant netcdf files for which a large number of integer (short) vectors are flag values of the same dimension as the (much smaller number of) data vectors which are floats. I can write the fag values vectors themselves and the flag values attributes themselves w/o issue but am struggling with how to pass a flag meanings attribute which makes the flag arrays make sense to a user. In one case I have 50+ unique legal flag values which need to be interpretable by a user.

Peter
Re: How do I get IDL to place a string array into a netdcf file attribute? [message #84434 is a reply to message #84433] Sat, 01 June 2013 06:19 Go to previous messageGo to next message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
An array of strings is not really an attribute anymore. You should
define a new variable (as a string array) for this. Why do you want to
keep it as an attribute?

Cheers,

fab
Re: How do I get IDL to place a string array into a netdcf file attribute? [message #84566 is a reply to message #84427] Wed, 05 June 2013 06:26 Go to previous message
Peter Thorne is currently offline  Peter Thorne
Messages: 13
Registered: October 2000
Junior Member
Thanks. This was also suggested by a contact I have on the CF convention board. I'm going to try this and see whether it is 'compliant'. I can't see another work around.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Puzzling over inherited objects
Next Topic: How to improve the efficiency of IDL on cluster

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

Current Time: Wed Oct 08 11:44:43 PDT 2025

Total time taken to generate the page: 0.00448 seconds