[ncl-talk] Strange stippling behaviour when valid points are few and scattered apart

Adam Phillips asphilli at ucar.edu
Wed Jul 8 09:51:42 MDT 2020


Hi all,
My reply was accidentally not attached in the previous reply, so I have
added it here.
----------------------
Hi all,
Building upon what Rick said (offline), this is obviously a graphics bug of
some kind. I believe this bug exists in other similar situations as well. I
think what is going on is that the valid values all fall between 95 and 100
(which are the set contour levels), and the rest of the values are set to
_FillValue. This leads to a situation where all valid values fall between
two contours, which is a situation that NCL admittingly does not handle
well when filling, and can lead

Another thing to keep in mind is that when stippling, *NCL* *does not apply
stipple at each grid box*. If a minimal number of points are spaced apart
from one another, stippling might not be shown at all. Setting cnFIllMode =
"RasterFIll" does not alter this behavior at all. This is the downside of
using stippling on sparse spatially inhomogeneous data.  The solution to
this issue is to not use any of the gsn_csm_* plotting routines, but to use
gsn_add_polymarker to add a dot (or stipple) at each significant grid box.

I have attached a script that will color fill the significant grid boxes
green (done only to highlight where the boxes are), and then will apply a
polymarker to each valid grid box.

Hope that helps!
Adam

On Tue, Jul 7, 2020 at 6:48 PM Dennis Shea via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

> This was looked at offline.
>
> Likely, there is a "bug of some kind." See Adam's response below. He also
> provided a sample script
> .
>
>
> Adam Phillips provided the attached script.
>
> Stay Healthy
> ==========
>
> On Thu, Jul 2, 2020 at 12:57 PM Buzan, Jonathan via ncl-talk <
> ncl-talk at mailman.ucar.edu> wrote:
>
>> You need to delete _FillValue and set the number to some arbitrary value.
>>
>> -Jonathan
>>
>>
>>
>> On Jul 2, 2020, at 8:55 PM, Rashed Mahmood <rashidcomsis at gmail.com>
>> wrote:
>>
>> I do not think that we should use 0 as missing value, please also see
>> this page:
>>
>> http://www.ncl.ucar.edu/Document/Language/error_messages.shtml#ZeroMissingValue
>> and no, setting _FillValue to some arbitrary number does not work.
>>
>> I am guessing that there may be a workaround for this, which I haven't
>> found yet!
>>
>>
>>
>> On Wed, Jul 1, 2020 at 7:06 PM Buzan, Jonathan <jbuzan at purdue.edu> wrote:
>>
>>> I think it’s interpolating between the data.
>>> Have you tried deleting the _FillValue and set it to 0 (or some
>>> arbitrary number)?
>>>
>>> -Jonathan
>>>
>>>
>>>
>>>
>>>
>>> On Jul 1, 2020, at 6:25 PM, Rashed Mahmood <rashidcomsis at gmail.com>
>>> wrote:
>>>
>>> Jonathan,
>>> Please look at the if statement that was introduced just to play with it
>>> a bit. Please have a look at the plot named *_Original.pdf. This is what
>>> the question is about.
>>>
>>> Rashed
>>>
>>> On Wed, Jul 1, 2020 at 6:03 PM Buzan, Jonathan <jbuzan at purdue.edu>
>>> wrote:
>>>
>>>> Hi Rashed,
>>>>
>>>> Looking at your script, it looks like the stipple is doing exactly what
>>>> you said it to do:
>>>>
>>>>       do n=0,20
>>>>          sig({n},:) = 95.01
>>>>       end do
>>>>
>>>>
>>>> You set  resS at cnLevels             =(/ 95.,100. /)
>>>>
>>>> The {n} in sig({n},:) means to set the latitudes 0-20 to 95.01. And the
>>>> stipple is greater than 95. But lower than 100. So it stippled from 0-20
>>>> latitude.
>>>>
>>>> -Jonathan
>>>>
>>>>
>>>>
>>>>
>>>> > On Jul 1, 2020, at 5:57 PM, Rashed Mahmood via ncl-talk <
>>>> ncl-talk at mailman.ucar.edu> wrote:
>>>> >
>>>> > Hi NCL,
>>>> >
>>>> > I encountered strange stippling behaviour when valid data points are
>>>> very few and are scattered apart from each other. At best I would expect no
>>>> stippling overlaid on a filled map, however, it seems that NCL somehow
>>>> covers the whole map with stippling.
>>>> >
>>>> > To explain this, I created a small example script (attached) which
>>>> reads data from the attached file. To play with it a bit, I just added some
>>>> "fake data" to see what happens. In the script we could set it using
>>>> "add_bogus_data = True".
>>>> > Attached are two plots after using original data and adding some fake
>>>> data. I am not sure what is going on here, anyone? Ignore the file names!!
>>>> >
>>>> > Cheers
>>>> > Rashed
>>>> >
>>>> > <funny_stiple.ncl><tst_diff.nc
>>>> ><Mask_TEST_Original.pdf><Mask_TEST_Bogus.pdf>_______________________________________________
>>>> > ncl-talk mailing list
>>>> > ncl-talk at mailman.ucar.edu
>>>> > List instructions, subscriber options, unsubscribe:
>>>> > https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>>>
>>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at mailman.ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at mailman.ucar.edu
> List instructions, subscriber options, unsubscribe:
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk



-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200708/d2a635be/attachment.html>


More information about the ncl-talk mailing list