[ncl-talk] Missing color fill with fixed contour levels
Dave Allured - NOAA Affiliate
dave.allured at noaa.gov
Wed Dec 30 18:25:00 MST 2015
NCL team,
I am making ordinary color filled contour maps of gridded data, with fixed
contour levels. When all data values lie between two adjacent contour
levels, all one color is expected. However, NCL 6.3.0 fails to color fill
in these cases. The result is all white maps that interrupt presentation
sequences.
Attached plot #1 shows color fill forced by adding an intermediate contour
level. Plot #2 shows the problem, a blank plot when fewer contour levels
are selected, and all one color expected.
Here is the script for plot #2, the non-filled map. Plot #1 results by
changing cnLevelSpacingF to 6 instead of 12. The input file is in the
third attachment:
begin
f = addfile ("data.no-color.nc", "r")
dat = f->dat
print ("Data range of full grid = " + min (dat) + ", " + max (dat))
wks = gsn_open_wks ("x11", "plot.test")
res = True
res at cnFillOn = True
res at cnConstFEnableFill = True
res at cnLevelSelectionMode = "ManualLevels"
res at cnMinLevelValF = 0
res at cnMaxLevelValF = 24
res at cnLevelSpacingF = 12 ; smaller generates color fill
res at mpMinLonF = 234 ; any boundary outside data limits
res at mpMaxLonF = 260 ; generates color fill
res at mpMinLatF = 31
res at mpMaxLatF = 50
res at mpCenterLonF = (res at mpMinLonF + res at mpMaxLonF) / 2.0
res at gsnAddCyclic = False
res at mpFillOn = False
res at mpOutlineBoundarySets = "AllBoundaries"
plot = gsn_csm_contour_map_ce (wks, dat, res)
end
Please note that two different kinds of changes result in correct color
fill, just not all one color which is what I need. You can decrease
cnLevelSpacingF to some value such as 6, which generates more than one
color. You can also change any of the map border resources (mpMinLonF
etc.) to extend outside the data limits, resulting in missing values along
the edges showing as blank (white) areas.
Both of these changes have something in common. They all result in at
least one color variation inside the plot frame. The failure occurs when
the entire plot frame should be one solid color with no breaks for missing
values or contour lines.
Is this a bug in NCL? Is there an existing solution? Can you please
either change NCL to prevent this kind of blanking, or else add a resource
similar to cnConstFEnableFill, to allow users to control the blanking in
such cases? Thanks for your consideration.
--Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151230/c8d220bc/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plot.test1.png
Type: image/png
Size: 39734 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151230/c8d220bc/attachment.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plot.test2.png
Type: image/png
Size: 28704 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151230/c8d220bc/attachment-0001.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: data.no-color.zip
Type: application/zip
Size: 5366 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151230/c8d220bc/attachment.zip
More information about the ncl-talk
mailing list