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

Home » Public Forums » archive » Re: Problems writing netCDF files
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: Problems writing netCDF files [message #7029] Thu, 12 September 1996 00:00
Andy Loughe is currently offline  Andy Loughe
Messages: 174
Registered: November 1995
Senior Member
POLCHER Jan wrote:
>
> Sorry for causing all this noise on the Internet !!
>
> Found the answer to this stupid question myself !
>
> netCDF only supports characters. Thus it should be like this, and it is
> rather s


Or is that "only supports numerals"?



> --
> Jan Polcher TEL:
> -33-1-44322243
> Laboratoire de M�t�orologie Dynamique du CNRS FAX:
> -33-1-43368392
> �cole Normale Sup�rieure
> 24, rue Lhomond
> polcher@lmd.ens.fr
> 75231 PARIS cedex 05, FRANCE
> http://www.lmd.ens.fr/~polcher/

--
Andrew F. Loughe afl@cdc.noaa.gov
University of Colorado, CIRES http://cdc.noaa.gov/~afl
Campus Box 449 phn:(303)492-0707
fax:(303)497-7013
Boulder, CO 80309-0449 "He who laughs last thinks slowest!"
Re: Problems writing netCDF files [message #7034 is a reply to message #7029] Wed, 11 September 1996 00:00 Go to previous message
POLCHER Jan is currently offline  POLCHER Jan
Messages: 2
Registered: September 1996
Junior Member
Sorry for causing all this noise on the Internet !!

Found the answer to this stupid question myself !

netCDF only supports characters. Thus it should be like this, and it is
rather s
urprising that ncdump produces strings for some files.

In IDL the solution is to read the attribute into a the variable and
then do a s
tring on it. Like this :

res=ncdf_attinq(fid, var_id, "title")
title=string(xx_tmp)

Perhaps it answers the question for somebody else !!

Best regards



POLCHER Jan wrote:

> I have a small problem when writing STRINGs to netCDF files. This is
> espacially problematic for attributes.
>
> When I do the following :
>
> title="Sea Surface"
> ncdf_attput, cr_id, var_id, 'title', title, /char
>
> I get a strange result in the file. ON a ncdump I get the following
> output :
>
> toto:title = 'S', 'e', 'a', ' ', 'S', 'u', 'r', 'f', 'a', 'c', 'e'
>
> A similar problem exists when I read an attribute from an existing
> netCDF file. The IDL variable contains the ASCII numbers for the single
> characters.
>
> To me it looks as if strings are not supported by the IDL implementation
> of netCDF. Perhaps there is a not documented /string keyword ???

--
Jan Polcher TEL:
-33-1-44322243
Laboratoire de M�t�orologie Dynamique du CNRS FAX:
-33-1-43368392
�cole Normale Sup�rieure
24, rue Lhomond
polcher@lmd.ens.fr
75231 PARIS cedex 05, FRANCE
http://www.lmd.ens.fr/~polcher/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: HELP! How to place a map above a 3d surface????
Next Topic: tested random # generator?

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

Current Time: Sat Oct 11 15:57:35 PDT 2025

Total time taken to generate the page: 0.64168 seconds