[ncl-talk] myterious contours not from the input data

Ning Li ning.li at auckland.ac.nz
Sun Jun 21 20:33:58 MDT 2015


Dear NCL users,
I have encountered a problem relating to the plotting of contour lines.
The data to be plotted is an 8 by 8 matrix that looks like this.

-0.084  -0.066  -0.04   0.021   0.031   -0.026  -0.065  -0.075
-0.028  0.005   0.053   0.177   0.224   0.136   0.028   -0.003
-0.009  0.038   0.111   0.266   0.327   0.333   0.221   0.101
-0.049  -0.024  0.08    0.184   0.275   0.352   0.29    0.152
-0.046  -0.029  0.022   0.082   0.164   0.195   0.147   0.127
0.002   0.007   -0.005  -0.017  -0.02   0.006   0.05    0.059
0.03    0.022   -0.034  -0.095  -0.105  -0.069  -0.033  -0.016
0.043   0.035   0.011   -0.022  -0.053  -0.063  -0.045  -0.03

While the script is working fine with the 'cnFillOn' resource set to True, erroneous contour lines
are present when 'cnFillOn' resource is set to False (please see the attached images).

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"

diri = "/home/nli045/Desktop/sharedJ/Documents/data/"
fili = systemfunc("ls " + diri + "x*csv")

in = asciiread(fili(0),(/8,8/),"float")                    ; read the matrix from the directory

wks = gsn_open_wks("png","test")
colors = read_colormap_file("BlWhRe")

res                              = True
res at cnFillOn             = False                  ; CONTOURS WRONG!
res at cnLinesOn          = True
res at gsnAddCyclic     = False                 ; the plot is not global

res at cnLevelSelectionMode    = "ManualLevels"    ; manual contour levels
res at cnMinLevelValF                = -0.1
res at cnMaxLevelValF              =  0.5
res at cnLevelSpacingF             =  0.1

plot = gsn_csm_contour(wks,in,res)

I used R to make the plot and there is no problem.
I have also used a different dataset in NCL, the errorneous contours are also present (see the circled contours in 'datasetB.png').

I am using version 6.2.0. The system is 86-64 GNU/Linux.

I wonder if anyone experienced the same problem in the past and how should it be resolved?

Any help would be great! Thank you very much!

Ning LI

PhD candidate
School of Environment
The University of Auckland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150622/f0e797c9/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.NoFill.png
Type: image/png
Size: 60845 bytes
Desc: test.NoFill.png
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150622/f0e797c9/attachment.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.Filled.png
Type: image/png
Size: 60855 bytes
Desc: test.Filled.png
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150622/f0e797c9/attachment-0001.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: datasetB.png
Type: image/png
Size: 145981 bytes
Desc: datasetB.png
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150622/f0e797c9/attachment-0002.png 


More information about the ncl-talk mailing list