Problem in read_colormap_file

From: Kyungna Kim <knakim_at_nyahnyahspammersnyahnyah>
Date: Fri Nov 16 2012 - 02:09:42 MST

Dear,

I tried to use the function "read_colormap_file", which is new function in
version 6.1.0, and there is some problem.
It seems to work depending on the colormap. Some colormaps work well but
others don't work at all.
I tried to look in "gsn_code.ncl" and it seperates rgb numbers by space.
I think the problem is mainly from the different formats of the colormap
scripts.
For example, default.rgb is seperated by "," and wgne15.rgp is seperate by
" ".
Therefore, I think gsn_code.ncl between line 12592 and 12597 must be
modified or colormap scripts must be the same format.

-- default.rgb -------------------------
/* this is the default hlu colormap */

        -1.0,0.0,0.0 /* white/black */
        -1.0,0.0,0.0 /* white/black */
        1.0,0.0,0.0 /* red */
        0.0,1.0,0.0 /* green */
        0.0,0.0,1.0 /* blue */
        1.0,1.0,0.0 /* yellow */
        0.0,1.0,1.0 /* cyan */
        1.0,0.0,1.0 /* magenta */
        0.5,0.0,0.0
        0.5,1.0,1.0
        0.0,0.0,0.5
--------------------------------------------------

-- wgne15.rgb -------------------------
ncolors= 15
# r g b
160 32 240
0 0 180
60 100 230
120 155 242
176 224 230
46 139 87
100 225 0
210 255 47
245 230 190
222 184 135
255 225 0
255 165 0
255 69 0
150 34 34
255 105 180
--------------------------------------------------

-- gsn_code.ncl -------------------------
12592 do while (i.lt.dimsizes(lines) .and. numColors.lt.MAXCOLORS)
12593 if (strlen(lines(i)).eq.0) then
12594 lines(i) = "#" ; zero-lengthed lines cause us grief...
12595 end if
12596 tokens = str_split(lines(i), " ")
12597 if (dimsizes(tokens).ge.3) then
--------------------------------------------------

-- Submitting a bug report -------------------------
To report an NCL bug, email ncl-talk@ucar.edu and provide:
1.The version of NCL you are running (ncl -V).

6.1.0

2.The shortest NCL script possible that illustrates the bug.

rc_map = read_colormap_file("default")
printVarSummary(rc_map)

3.Any data files needed to run your script.
4.A graphic (PostScript file, PDF file, NCGM file, etc.) that illustrates
the problem.

5.The exact error message (if any).

fatal:New: a zero or negative value has been passed in in the dimension
size parameter
fatal:["Execute.c":7743]:Execute: Error occurred at or near line 12644 in
file ./gsn_code.ncl

6.The type of system you're on (usually "uname -a" is enough).

Linux nari0 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64
x86_64 x86_64 GNU/Linux

Sincerely,

Kyungna

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Nov 16 02:09:54 2012

This archive was generated by hypermail 2.1.8 : Wed Nov 21 2012 - 11:16:05 MST