[ncl-talk] Do not show significance level in a correlation map

Adam Phillips asphilli at ucar.edu
Wed Jan 24 10:12:46 MST 2024


Hi Jalal,
I am guessing the reason why my code didn't work with the NOAA/PSL data is
because that data's time coordinate variable did not match that of the
HadISST dataset. (In the script I sent you I used coordinate subscripting
of the time dimension to select the time needed.) Also, the NOAA/PSL SST
dataset you pointed me to only runs from 1981-2012, and your script was set
to analyze years 1980-2021.

I will write to you offline with how to download the HadISST data file.
Best,
Adam



On Wed, Jan 24, 2024 at 1:53 AM Md. Jalal Uddin <dmjalal90 at gmail.com> wrote:

>  Dear Sir,
>
> Could I have this dataset hadisst.187001-202212.nc?
>
> On Fri, 19 Jan 2024 at 19:42, Md. Jalal Uddin <dmjalal90 at gmail.com> wrote:
>
>> Thank you, sir, for your kind efforts. Your code works for
>> hadisst.187001-202212.nc data. However, when I use my sst data from NOAA
>> (sst.mnmean.nc), the code does not work. I do not know the reason for
>> this. Sorry to bother you.
>>
>> NOAA sst data:
>> https://psl.noaa.gov/repository/entry/show?entryid=cac1c2a6-a864-4409-bb77-1fdead8eeb6e
>>
>> On Fri, 19 Jan 2024 at 15:32, Md. Jalal Uddin <dmjalal90 at gmail.com>
>> wrote:
>>
>>> This is great, thank you so much!
>>>
>>> On Wed, 17 Jan 2024 at 05:09, Adam Phillips <asphilli at ucar.edu> wrote:
>>>
>>>> Hi Jalal,
>>>> I was able to plug in a monthly SST dataset that I have here, so I was
>>>> able to run your script. So I think what is happening is that the stippling
>>>> is so small/faint/sparse that it is hard to see it. I made two changes to
>>>> your script:
>>>> 1 - I was getting stippling over land as the rtest function was
>>>> seemingly not recognizing the _FillValue of the input array. (I find this
>>>> strange, but have not used rtest before.) To fix this, I put in a where
>>>> statement and added the _FillValue attribute to your p array:
>>>>   p = rtest(r_sst,42,0)
>>>> *  p at _FillValue = 1.e20*
>>>>   copy_VarCoords(r_sst, p)
>>>> *  p = where(ismissing(r_sst),p at _FillValue,p)*
>>>>
>>>> 2 - I modified/added the following gsn_contour_shade options to make
>>>> the stippling more visible:
>>>>
>>>> *  opt at gsnShadeFillScaleF   = 0.25         ; add extra density
>>>> opt at gsnShadeFillDotSizeF = 0.0015*
>>>>
>>>> I have attached the modified script, along with the plot that I am
>>>> getting.
>>>> Hope that helps!
>>>> Best,
>>>> Adam
>>>>
>>>>
>>>> On Mon, Jan 15, 2024 at 8:58 PM Md. Jalal Uddin <dmjalal90 at gmail.com>
>>>> wrote:
>>>>
>>>>>   Thank you very much, sir. I used the following resources:
>>>>>
>>>>>  opt                                       = True
>>>>>   opt at gsnShadeFillType      = "pattern"
>>>>>   opt at gsnShadeLow            = 17          ; stipple
>>>>>   opt at gsnShadeFillScaleF   = 0.5         ; add extra density
>>>>>
>>>>>   plot = gsn_csm_contour_map(wks,r_sst, res)  ; create plot
>>>>>   plot2 = gsn_csm_contour(wks,p, res2)
>>>>>   plot2 = gsn_contour_shade(plot2,0.05,999.,opt)\
>>>>>
>>>>>   overlay (plot, plot2)
>>>>>
>>>>>  draw(plot)
>>>>>  frame(wks)
>>>>>
>>>>> However, I did not get output as stipple areas where p value is less
>>>>> than 0.05. I added the full code including Nino data in the attachment.
>>>>> Should I send the SST data (sst.mon.mean.nc) via ftp?
>>>>>
>>>>> On Sat, 13 Jan 2024 at 06:55, Adam Phillips <asphilli at ucar.edu> wrote:
>>>>>
>>>>>> Hi Jalal,
>>>>>> As you are pattern filling, and the default is color filling, you
>>>>>> need to set:
>>>>>> opt at gsnShadeFillType = "pattern"
>>>>>> I am also unclear what you mean by this statement:
>>>>>> "...to show the significance level as a shaded pattern where p value
>>>>>> is less than 0.05 and 0.01"
>>>>>>
>>>>>> Do you want to stipple areas less than .05? If so the following code
>>>>>> should do that:
>>>>>>   opt                      = True
>>>>>>   opt at gsnShade*Low*         = 17          ; stipple
>>>>>>   opt at gsnShadeFillScaleF   = 0.5         ; add extra density
>>>>>>   plot2 = gsn_contour_shade(plot2,0.05,999.,opt)
>>>>>>
>>>>>> If instead you want to stipple areas less than .01, you will need to
>>>>>> modify the contour levels in your res2 resource list to have a contour at
>>>>>> .01:
>>>>>>   res2 at cnMinLevelValF      = 0.00        ; set min contour level
>>>>>>   res2 at cnMaxLevelValF      = .10        ; set max contour level
>>>>>>   res2 at cnLevelSpacingF     = 0.01        ; set contour spacing
>>>>>>
>>>>>>   opt                      = True
>>>>>>   opt at gsnShade*Low*         = 17          ; stipple
>>>>>>   opt at gsnShadeFillScaleF   = 0.5         ; add extra density
>>>>>>   plot2 = gsn_contour_shade(plot2,0.01,999.,opt)\
>>>>>>
>>>>>> Hope that answers your question. As always please respond to the
>>>>>> ncl-talk email list with further questions.
>>>>>> Best,
>>>>>> Adam
>>>>>>
>>>>>> On Fri, Jan 5, 2024 at 6:15 AM Md. Jalal Uddin via ncl-talk <
>>>>>> ncl-talk at mailman.ucar.edu> wrote:
>>>>>>
>>>>>>> Dear all,
>>>>>>>
>>>>>>> I have tried to use the gsn_contour_shade function to show the
>>>>>>> significance level as a shaded pattern where p value is less than 0.05 and
>>>>>>> 0.01. However, the output map does not show the shaded areas (please see
>>>>>>> the attached map).
>>>>>>>
>>>>>>> Here are some codes:
>>>>>>> r_sst  = escorc(ano_nino,ano_sstSON(lat|:,lon|:,time|:))        ;
>>>>>>> ccr(lat,lon)
>>>>>>> copy_VarCoords(ano_sstSON(0,:,:), r_sst)
>>>>>>> r_sst at long_name = "Correlation: r_sst"
>>>>>>>
>>>>>>>   p = rtest(r_sst,42,0)
>>>>>>>   copy_VarCoords(r_sst, p)
>>>>>>>
>>>>>>> opt                      = True
>>>>>>> opt at gsnShadeHigh         = 17          ; stipple
>>>>>>> opt at gsnShadeFillScaleF   = 0.5         ; add extra density
>>>>>>> opt at gsnShadeFillDotSizeF = 0.002      ; make dots larger
>>>>>>>
>>>>>>>   plot = gsn_csm_contour_map(wks,r_sst, res)  ; create plot
>>>>>>>
>>>>>>>   plot2 = gsn_csm_contour(wks,p, res2)
>>>>>>>   plot2 = gsn_contour_shade(plot2,0.01,0.05,opt)
>>>>>>>
>>>>>>>   overlay (plot, plot2)
>>>>>>>
>>>>>>>  draw(plot)
>>>>>>>  frame(wks)
>>>>>>>
>>>>>>> Please find the full code in the attached file.
>>>>>>>
>>>>>>> Any suggestions would be appreciated.
>>>>>>>
>>>>>>> --
>>>>>>>
>>>>>>> *Regards,*
>>>>>>>
>>>>>>> Dr. Jalal
>>>>>>>
>>>>>>> *Postdoctoral Researcher,* Typhoon Research Center, Jeju National
>>>>>>> University, South Korea
>>>>>>>
>>>>>>> *PhD* in Atmospheric Physics and Atmospheric Environment, NUIST,
>>>>>>> China
>>>>>>>
>>>>>>> *M.Sc.* in Applied Meteorology, NUIST, China
>>>>>>>
>>>>>>> *B.Sc.* in Disaster Management, PSTU, Bangladesh
>>>>>>>
>>>>>>> *Founder and Director* of Research Society
>>>>>>>
>>>>>>> *Website*: https://researchsociety20.org/founder-and-director/
>>>>>>>
>>>>>>> *E-mails*: founder-and-director at researchsociety20.org
>>>>>>>
>>>>>>>               jalal at jejunu.ac.kr
>>>>>>>
>>>>>>>               20205103002 at nuist.edu.cn
>>>>>>> _______________________________________________
>>>>>>> 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 IV, Climate Analysis Section
>>>>>> Climate and Global Dynamics Laboratory
>>>>>> National Center for Atmospheric Research
>>>>>> www.cgd.ucar.edu/staff/asphilli/
>>>>>>
>>>>>> <http://www.cgd.ucar.edu/staff/asphilli>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> *Regards,*
>>>>>
>>>>> Dr. Jalal
>>>>>
>>>>> *Postdoctoral Researcher,* Typhoon Research Center, Jeju National
>>>>> University, South Korea
>>>>>
>>>>> *PhD* in Atmospheric Physics and Atmospheric Environment, NUIST, China
>>>>>
>>>>> *M.Sc.* in Applied Meteorology, NUIST, China
>>>>>
>>>>> *B.Sc.* in Disaster Management, PSTU, Bangladesh
>>>>>
>>>>> *Founder and Director* of Research Society
>>>>>
>>>>> *Website*: https://researchsociety20.org/founder-and-director/
>>>>>
>>>>> *E-mails*: founder-and-director at researchsociety20.org
>>>>>
>>>>>               jalal at jejunu.ac.kr
>>>>>
>>>>>               20205103002 at nuist.edu.cn
>>>>>
>>>>
>>>>
>>>> --
>>>> Adam Phillips
>>>> Associate Scientist IV, Climate Analysis Section
>>>> Climate and Global Dynamics Laboratory
>>>> National Center for Atmospheric Research
>>>> www.cgd.ucar.edu/staff/asphilli/
>>>>
>>>> <http://www.cgd.ucar.edu/staff/asphilli>
>>>>
>>>
>>>
>>> --
>>>
>>> *Regards,*
>>>
>>> Dr. Jalal
>>>
>>> *Postdoctoral Researcher,* Typhoon Research Center, Jeju National
>>> University, South Korea
>>>
>>> *PhD* in Atmospheric Physics and Atmospheric Environment, NUIST, China
>>>
>>> *M.Sc.* in Applied Meteorology, NUIST, China
>>>
>>> *B.Sc.* in Disaster Management, PSTU, Bangladesh
>>>
>>> *Founder and Director* of Research Society
>>>
>>> *Website*: https://researchsociety20.org/founder-and-director/
>>>
>>> *E-mails*: founder-and-director at researchsociety20.org
>>>
>>>               jalal at jejunu.ac.kr
>>>
>>>               20205103002 at nuist.edu.cn
>>>
>>
>>
>> --
>>
>> *Regards,*
>>
>> Dr. Jalal
>>
>> *Postdoctoral Researcher,* Typhoon Research Center, Jeju National
>> University, South Korea
>>
>> *PhD* in Atmospheric Physics and Atmospheric Environment, NUIST, China
>>
>> *M.Sc.* in Applied Meteorology, NUIST, China
>>
>> *B.Sc.* in Disaster Management, PSTU, Bangladesh
>>
>> *Founder and Director* of Research Society
>>
>> *Website*: https://researchsociety20.org/founder-and-director/
>>
>> *E-mails*: founder-and-director at researchsociety20.org
>>
>>               jalal at jejunu.ac.kr
>>
>>               20205103002 at nuist.edu.cn
>>
>
>
> --
>
> *Regards,*
>
> Dr. Jalal
>
> *Postdoctoral Researcher,* Typhoon Research Center, Jeju National
> University, South Korea
>
> *PhD* in Atmospheric Physics and Atmospheric Environment, NUIST, China
>
> *M.Sc.* in Applied Meteorology, NUIST, China
>
> *B.Sc.* in Disaster Management, PSTU, Bangladesh
>
> *Founder and Director* of Research Society
>
> *Website*: https://researchsociety20.org/founder-and-director/
>
> *E-mails*: founder-and-director at researchsociety20.org
>
>               jalal at jejunu.ac.kr
>
>               20205103002 at nuist.edu.cn
>


-- 
Adam Phillips
Associate Scientist IV, Climate Analysis Section
Climate and Global Dynamics Laboratory
National Center for Atmospheric Research
www.cgd.ucar.edu/staff/asphilli/

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20240124/2889a2cf/attachment.htm>


More information about the ncl-talk mailing list