[ncl-talk] Missing color fill with fixed contour levels

Dave Allured - NOAA Affiliate dave.allured at noaa.gov
Thu Dec 31 13:30:43 MST 2015


Rick,

Thanks for narrowing down the problem.  I don't think I need a binary of
the development version.  Now that I understand the issue better, I think I
have a simple workaround until the next NCL release.

--Dave


On Thu, Dec 31, 2015 at 9:51 AM, Rick Brownrigg <brownrig at ucar.edu> wrote:

> Hi Dave,
>
> I get the same blank map running your script using 6.3.0 on yellowstone.
> However, running your script unmodified using a current development
> snapshot of the code, I get a correctly filled, mono-colored map
> (attached).  So the issue appears to have cropped up before and has been
> fixed -- I don't know the details.
>
> Do you need a binary of the development branch -- its usually quite stable?
>
> Rick
>
>
> On Wed, Dec 30, 2015 at 6:25 PM, Dave Allured - NOAA Affiliate <
> dave.allured at noaa.gov> wrote:
>
>> 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/20151231/19646d9c/attachment.html 


More information about the ncl-talk mailing list