[ncl-talk] unexpected white contours in color filled plot
Mark Branson
mark at atmos.colostate.edu
Fri Aug 19 10:34:41 MDT 2016
Hi Mary.
Here is that. Interestingly, the problem has gone away. So perhaps the coordinate arrays are indeed the source of the problem?
Mark
> On Aug 19, 2016, at 10:26 AM, Mary Haley <haley at ucar.edu> wrote:
>
> Hi Mark,
>
> That is a little odd. You did good work debugging the problem, so missing values and nans are ruled out.
>
> To further debug this, can you try plotting a very basic contour plot, without the pressure /height axes, and without any coordinate information and send the image:
>
> plot = gsn_contour (wks,uwind,res)
>
> The gsn_contour script ignores any coordinate arrays, which I want to make sure are not the source of the problem.
>
> Thanks,
>
> --Mary
>
>
>
> On Fri, Aug 19, 2016 at 10:07 AM, Mark Branson <mark at atmos.colostate.edu <mailto:mark at atmos.colostate.edu>> wrote:
> Hello.
>
> I'm running ncl v6.2.1 and here is what I'm doing in the attached script:
>
> 1) read in a long time series of zonal wind and surface pressure data from CAM output.
> 2) interpolate them to constant pressure levels using vinth2p.
> 3) compute long-term monthly means with clmMonTLLL.
> 4) compute the annual mean of the monthly means.
> 5) subtract off the annual mean from the monthly means.
> 6) select one latitude (the equator), and then take the mean of all longitudes.
> 6) make a color-filled height versus time cross section plot.
>
> I get the plot (see attached), but some of the contours near the top are white. I thought maybe it was because there were some missing or bogus values, so I inserted a check for those with the ismissing and isnan_ieee functions and it seems the data is fine.
>
> Any ideas?
>
> Thanks,
> Mark Branson
>
>
> begin
> a = addfile("/pool/mark/spcam_nlev51/spcam_nlev51.cam.h0.0003-01.nc <http://spcam_nlev51.cam.h0.0003-01.nc/>","r")
> hyam = a->hyam
> hybm = a->hybm
>
> b = addfile("/pool/mark/spcam_nlev51/uandps.nc <http://uandps.nc/>","r")
> u = b->U ;u = [time | 338] x [lev | 53] x [lat | 96] x [lon | 144]
> ps = b->PS ;ps = [time | 338] x [lat | 96] x [lon | 144]
> u at _FillValue = default_fillvalue("float")
>
> if (any(ismissing(u))) then
> print("### original u array contains some missing data ###")
> end if
>
> ; interpolation variables
> plvlM = (/ 30.,50.,70.,100.,150.,200.,250.,300.,350.,400.,450.,500.,550., \
> 600.,650.,700.,750.,800.,850./)
> plvlM at units = "mb"
> nplvlM = dimsizes(plvlM)
>
> p0 = 1000. ; mb required by vinth2p
> interp = 2 ; log interpolation
> extrap = False ; no extrapolation past psfc.
>
> tmp = vinth2p(u,hyam,hybm,plvlM,ps,interp,p0,1,extrap)
> if (typeof(tmp).eq."double") then
> uwind1 = dble2flt(tmp)
> else
> uwind1 = tmp
> end if
>
> ; compute long-term monthly means
> uclm = clmMonTLLL(uwind1) ;uclm = [month | 12] x [lev_p | 33] x [lat | 96] x [lon | 144]
>
> ; annual mean of monthly means
> uann = dim_avg_n_Wrap(uclm,0) ;uann = [lev_p | 33] x [lat | 96] x [lon | 144]
>
> ; subtract off annual mean from monthly means
> do i = 0,11
> uclm(i,:,:,:) = (/ uclm(i,:,:,:) - uann(:,:,:) /)
> end do
>
> uwind2 = uclm(:,:,47,:) ; select the equator for the latitude
> uwind3 = dim_avg_Wrap(uwind2) ; mean of all longitudes
> uwind = uwind3(lev_p|:,month|:) ; swap the array dimensions: month,level --> level,month
>
> printMinMax(uwind,False)
>
> if (any(ismissing(uwind))) then
> print("### uwind array contains some missing data ###")
> end if
> if (any(isnan_ieee(uwind))) then
> print("### uwind array contains some NaNs ###")
> end if
>
> uwind at long_name = "SP-CAM, 51 levels, Monthly Means"
>
> wks = gsn_open_wks ("eps", "test1") ; send graphics to EPS file
> gsn_define_colormap(wks,"BlRe")
>
> res = True
> res at cnFillOn = True
> res at cnLinesOn = True
> res at lbLabelBarOn = True
> res at cnInfoLabelOn = False
>
> ; change labels for monthly mean plot
> res at tmXBMode = "Explicit"
> res at tmXBLabelFontHeightF = 0.015
> res at tmXBLabels=(/"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep", \
> "Oct","Nov","Dec","Jan"/)
> res at tmXBValues = ispan(0,12,1)
>
> plot = gsn_csm_pres_hgt (wks,uwind,res)
> end
>
> ** OUTPUT FROM THE SCRIPT **
>
> /Users/mark/mmf/SPCAM5/stratosphere_gwdrag/spcam_nlev51> ncl hvstime.ncl
> Copyright (C) 1995-2014 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 6.2.1
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ <http://www.ncl.ucar.edu/> for more details.
> (0) min=-9.835 max=6.77056
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu>
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
>
>
> _______________________________________________
> 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/20160819/b8147b11/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test2.eps
Type: application/postscript
Size: 152907 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160819/b8147b11/attachment.eps
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160819/b8147b11/attachment-0001.html
More information about the ncl-talk
mailing list