[ncl-talk] How to show P value and Trend on contour fill map?

Rashed Mahmood rashidcomsis at gmail.com
Sat Dec 14 13:09:41 MST 2019


Hi Adam and Atul,
I agree that Adam's suggestion would work for this case. However, I just
want to highlight this issue since the function trend_manken returns "0"
for missing values. That is the reason Atul get's color over missing value
region of variable b, since 0 is a valid number unless specified as
missing. Similar questions have been asked previously and I think this "0"
value return for missing input data is part of the confusion. OR, may be
this is a feature of the function, I do not know!

I wonder if the function trend_manken could return missing if a grid point
has missing values? Below is the simplest test:

print("........................... when no value is missing .......")
 a = 1.*ispan(1,20,1)
 b = trend_manken(a,False,0)
 print(""+b)

print("........................... when all values are missing .......")
 c = a
 c at _FillValue = -999.
 c = c at _FillValue
 d = trend_manken(c,False,0)
 print(""+d)

print("............................ when a subset of values are missing ..")
 e = a
 e at _FillValue = -999.
 e(7)       = e at _FillValue
 f = trend_manken(c,False,0)
 print(""+f)


Cheers,
Rashed







On Sat, Dec 14, 2019 at 6:46 AM Adam Phillips via ncl-talk <
ncl-talk at ucar.edu> wrote:

> Hi Atul,
> I had a missing parentheses in my where statements as evidenced by the
> syntax errors.
> Change this:
> mk1 = where(ismissing(b(0,:,:),mk1 at _FillValue,mk1)
> to this:
> mk1 = where(ismissing(b(0,:,:)),mk1 at _FillValue,mk1)
> Adam
>
> On Dec 14, 2019, at 12:25 AM, Atul Saini <atulsainimail at gmail.com> wrote:
>
> 
> Hi Dr. Adam,
>                     I followed the way suggested by you but it didn't
> worked and given the following syntax error. I have attached the script and
> data file herewith this mail.
>
> *ncl 14>* mk1 = where(ismissing(b(0,:,:),mk1 at _FillValue,mk1)
> fatal:syntax error: function ismissing expects 1 arguments, got 3
> fatal:error at line 14
> *ncl 15>* mk2 = where(ismissing(b(0,:,:),mk2 at _FillValue,mk2)
> fatal:syntax error: function ismissing expects 1 arguments, got 3
> fatal:error at line 15
>
> Regards,
>
>
>
>
>
> On Sat, Dec 14, 2019 at 9:41 AM Atul Saini <atulsainimail at gmail.com>
> wrote:
>
>> Hi Dr. Adam,
>>                     I followed the way suggested by you but it didn't
>> worked. I have attached the script and data file herewith this mail.
>>
>> Regards,
>>
>>
>>
>>
>>
>> On Sat, Dec 14, 2019 at 3:37 AM Adam Phillips <asphilli at ucar.edu> wrote:
>>
>>> Hi Atul,
>>> In general, NCL denotes areas that are missing graphically by coloring
>>> them white unless modified by the user. There are no white
>>> areas on your trend plot, and thus I am guessing that NCL believes that
>>> the plotted grid does not have any missing data. Note that in
>>> the trend_manken documentation that missing values are not allowed to be
>>> input into the function. If you do have missing data
>>> (denoted by the _FillValue attribute) within your b array, and the b
>>> array grid points are consistently missing in time,
>>> I would use the where function to wipe out the results from trend_manken
>>> over those areas that were missing:
>>> mk=trend_manken(b,opt,0)
>>> copy_VarCoords(aveg,mk)
>>> mk1=mk(0,:,:)
>>> mk2=mk(1,:,:)
>>> mk1 = where(ismissing(b(0,:,:),mk1 at _FillValue,mk1)
>>> mk2 = where(ismissing(b(0,:,:),mk2 at _FillValue,mk2)
>>>
>>> The above coding assumes b at _FillValue, mk1 at _FillValue, and mk1 at _FillValue
>>> are properly set, and that b(0,:,:) is representative of the
>>> areas that need to be masked.
>>>
>>> If that advice does not fix the issue reply to the ncl-talk email list.
>>> Adam
>>>
>>>
>>>
>>> On Thu, Dec 12, 2019 at 2:47 AM Atul Saini via ncl-talk <
>>> ncl-talk at ucar.edu> wrote:
>>>
>>>> Hi NCL,
>>>>                I have modified the script and I think I am getting the
>>>> right plot having modified the script.
>>>>                If, I followed the right method to plot 'probability
>>>> level' and 'trend value', please tell me why I am getting the value for the
>>>> region having missing values.
>>>>
>>>> Regards,
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Dec 12, 2019 at 2:56 PM Atul Saini <atulsainimail at gmail.com>
>>>> wrote:
>>>>
>>>>> Hi NCL,
>>>>>               I wrote the code to make map for P value and second for
>>>>> Trend value. But, I can't understand the process of selecting P value at
>>>>> the time of plot and Trend value.
>>>>>
>>>>> Please find the attached data file and script and suggest the way to
>>>>> plot P value and Trend value.
>>>>>
>>>>>
>>>>> Regards,
>>>>>
>>>>>
>>>>>
>>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> ncl-talk at ucar.edu
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://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>
>>>
>> <MK_Test1(2).ncl>
> <WesternAgroClimRegion_MonthlySum_1901_2017Jan.nc>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191214/b95db468/attachment.html>


More information about the ncl-talk mailing list