[ncl-talk] An issue with shaded contours in NCL6.4.0

Saji Hameed saji.nh at gmail.com
Mon Jun 25 19:23:56 MDT 2018


Hi Mary,

Thank you for checking this. I have uploaded two files (saji_rain_jun-sep.nc,
saji_landsea_mask.nc) to ftp.cgd.ucar.edu.
The corresponding NCL script is below (I noted that the issue appears only
when using the option cnSmoothingOn = True

Best,
saji

lt1 = 5
lt2 = 25
ln1 = 60
ln2 = 90

fin = addfile("saji_rain_jun-sep.nc","r")
fmk = addfile("saji_landsea_mask.nc","r")
rain = fin->var(:,{lt1:lt2},{ln1:ln2})
msk = fmk->ls_mask({lt1:lt2},{ln1:ln2})
lmsk =  conform(rain,msk,(/1,2/))

rain_masked = rain
rain_masked = (/where(lmsk.eq.1, rain at _FillValue,rain) /)
rjja_masked = dim_avg_n_Wrap(rain_masked,0)

wks = gsn_open_wks("x11","mask_fig")
gsn_define_colormap(wks,"rainbow")
res = True
opt = True
res at mpMinLatF = lt1
res at mpMaxLatF = lt2
res at mpMinLonF = ln1
res at mpMaxLonF = ln2
res at gsnAddCyclic = False
res at cnFillOn              = True
res at cnLinesOn             = False
res at cnSmoothingOn   = True     ; <--- The problem is with this one
plt = gsn_csm_contour_map(wks,rjja_masked,res)
; ----- the following one also has the strange issue that I reported ---
plt = gsn_csm_contour_map(wks,rain_masked(3,:,:),res) ; only the data for
the last time step



On Tue, Jun 26, 2018 at 12:14 AM, Mary Haley <haley at ucar.edu> wrote:

> Hi Saji,
>
> This is indeed strange.
>
> Would it be possible for you to include a script and your data so we can
> look at the problem here? I especially want to see how the masking is being
> done, and I can test it using our 6.5.0 beta version.
>
> You can use our ftp for this, or put the files on your own site:
>
> http://www.ncl.ucar.edu/ftp_files.shtml
>
> Thanks,
>
> --Mary
>
>
> On Sun, Jun 24, 2018 at 8:02 PM, Saji Hameed <saji.nh at gmail.com> wrote:
>
>> Dear NCL developers,
>>
>> I would like to report a rather strange issue that appears in version
>> 6.4.0 of NCL.
>> The issue is related to shaded contours. For me, the issue happens when
>> using a dataset for which a mask was applied to "undefine" values over a
>> portion of the
>> domain.
>>
>> I have attached four figures to illustrate the issue (two of these were
>> made with
>> NCL version 6.3.0, and the other two with NCL 6.4.0).
>>
>> nomask_ncl6.4.png and nomask_ncl6.3.png are plots of rainfall made using
>> NCL 6.4.0 and NCL 6.3.0 respectively. There are two panels, with the top
>> showing a shaded contour plot, and the bottom a simple contour plot.
>> In the cases shown above, all data in the domain were used. There are no
>> issues with both the above mentioned plots (they are also identical to each
>> other, as expected).
>>
>> In the next set of plots, I have masked the data over land areas. Once I
>> do this, I get
>> unexpected colors (white) for some contour levels (between 10 and 12)
>> only when using NCL6.4.0.
>> There is no issue with NCL6.3.0, which plots the data without any apparent
>> problems.
>>
>> I did note this issue with other plots, but at that time I thought that I
>> was overusing colors on my desktop, and my OS could not allocate enough
>> colors to NCL. But only today, I figured out that this is seemingly related
>> to use of a mask to undefine
>> portions of the data domain.
>>
>> For the time being, I will use NCL6.3.0, and hope that the source of this
>> issue
>> can be found and fixed.
>>
>> Best regards,
>> saji
>>
>> _______________________________________________
>> 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/20180626/a07b3761/attachment.html>


More information about the ncl-talk mailing list