ncdf string array dimension [message #63573] |
Fri, 14 November 2008 15:21  |
mccreigh
Messages: 13 Registered: January 2008
|
Junior Member |
|
|
(I solved this, but there were no obvious hits on this group, so i
thought I'd post it for others scratching their heads in the future.)
When you want to write a string array to a netcdf file, you may find
you are getting an error that the dimensions of your variable dont
match what is declared (in ncdf_vardef). You have to declare the
maximum length of your strings as the first dimension of the string
array variable, else it could be ragged. (Which is how you feel after
combing the IDL documentation for clues).
here's the example that saved the day:
http://www.astro.virginia.edu/class/oconnell/astr511/idl_5.1 _html/idl2d7.htm
|
|
|
Re: ncdf string array dimension [message #63667 is a reply to message #63573] |
Sat, 15 November 2008 00:19  |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
changuito schrieb:
> (I solved this, but there were no obvious hits on this group, so i
> thought I'd post it for others scratching their heads in the future.)
> When you want to write a string array to a netcdf file, you may find
> you are getting an error that the dimensions of your variable dont
> match what is declared (in ncdf_vardef). You have to declare the
> maximum length of your strings as the first dimension of the string
> array variable, else it could be ragged. (Which is how you feel after
> combing the IDL documentation for clues).
>
> here's the example that saved the day:
>
> http://www.astro.virginia.edu/class/oconnell/astr511/idl_5.1 _html/idl2d7.htm
thanks, but you should have asked before. No questions - no answers - no
hits.
The reason for this behaviour is that the data is internally stored as
byte array. That makes 2 dimensions.
cheers
Reimar
|
|
|