Re: remove escorc values over ocean

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Wed Jan 12 2011 - 13:14:50 MST

Hi Ibo,
Missing value locations, as long as the _FillValue attribute is being
set correctly within the array to be plotted, should never be shaded. So
I am a bit confused as to your question.

Can you send an image showing the issue, and again explain what you are
after?

Just in case this solves your issue, you can use the where function to
set to missing (=_FillValue) all those points less than or equal to 89:

arr = where(arr.le.89,arr@_FillValue,arr)

Adam

On 01/12/2011 06:31 AM, Ibo Ze wrote:
> Thanks Adam. It worked just fine.
> But even with _FillValue defined, missing value locations over land got
> included in significance map with 89 value .
> Is there any way to remove missing value locations from it?
>
> Thanks, Ibo.
>
> ------------------------------------------------------------------------
> *From:* Adam Phillips <asphilli@ucar.edu>
> *To:* ncl-talk@ucar.edu
> *Sent:* Mon, January 10, 2011 12:56:36 PM
> *Subject:* Re: [ncl-talk] remove escorc values over ocean
>
> Hi Ibo,
> That warning message simply means that one or more data points had
> timeseries that were most likely constant. For observational data or
> data that has areas that are missing, there is little cause of concern
> upon seeing that error message.
>
> First, you need to make sure that you have the _FillValue attribute set
> for your x1, x2, c, sig, and sig1 arrays. (To set a _FillValue attribute
> for the c array: c@_FillValue = 1.e20)
>
> Second, you are not setting the contour levels for your res1 resource
> list. Thus, I am not sure where the shading is occurring, as
> ShadeGtContour will pattern fill all areas greater than the _first
> contour greater than the given value_. This is an important aspect of
> ShadeGtContour. It will not color fill all areas greater than the given
> value. Thus, if your contour levels are 70,85,95,99, and your input
> argument is set to 89, then all areas greater than _95_ are pattern filled.
>
> I would highly recommend setting res1@cnLevelSelectionMode =
> "ExplicitLevels" and then setting res1@cnLevels = 89. You would then
> want to set
> shade = ShadeGtContour(shade,88.,0)
>
> On a side note, it is highly recommended that you use
> gsn_contour_shade, as ShadeGtContour has been deprecated.
>
> Finally, if you simply want to mask out the ocean, you could use the
> landsea_mask function:
> http://www.ncl.ucar.edu/Document/Functions/Shea_util/landsea_mask.shtml
>
> Good luck,
> Adam
>
> On 01/09/2011 07:56 AM, Ibo Ze wrote:
> > Hi,
> >
> > I ran escorc and rtest and set 89 as siglv to shade. But it shaded ocean
> > area alongwith it. Probably escorc correlated with ocean missing values
> > and that showed up in shaded area as well because of following error:
> > warning:escorc: Non-fatal conditions encountered in series or xstd
> > equals zero.
> > Possibly, all values of a series are constant.
> > warning:escorc: Most likely, one or more series consisted of all
> > constant values
> >
> > Is there any workaround to avoid getting missing values greater than 89
> > over ocean area in plot?
> >
> > Thanks,
> > Ibo
> >
> > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> > load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> >
> > begin
> >
> > f1 = addfile("a1.nc <http://a1.nc>","r")
> > x1 = f1->pre
> > Nr = dimsizes(x1)
> > f2 = addfile("a2.nc <http://a2.nc>","r")
> > x2 = f2->pre(lat|:,lon|:,time|:)
> > x2!0 = "lat"
> > x2!1 = "lon"
> > x2&lat@units = "degrees_north"
> > x2&lon@units = "degrees_east"
> > c = escorc(x1,x2)
> > copy_VarCoords(x2,c)
> > sig = 100.*(1. - rtest(c,Nr,0))
> > printVarSummary(sig)
> > sig1 = doubletoint(sig)
> > wks = gsn_open_wks("x11","test.sig") ; ps or x11 to save or visualize
> > gsn_define_colormap(wks,"BlueDarkRed18")
> >
> > res = True ; No plot options set.
> > res@gsnDraw = False
> > res@gsnFrame= False
> > res@cnFillOn= True
> > res@cnInfoLabelOn = False
> > res@cnLevelSelectionMode = "ExplicitLevels" ; manually set cn levels
> > res@cnMinLevelValF = -1 ; min level
> > res@cnMaxLevelValF = 1 ; max level
> > res@cnLevels =
> > (/"-1.0","-0.9","-0.8","-0.7","-0.6","-0.5","-0.4","-0.3","-0.2",\
> > "0.0","0.2","0.3","0.4","0.5","0.6","0.7","0.8","0.9","1.0"/)
> >
> > res@gsnAddCyclic= False
> > res@gsnSpreadColors = True
> > res@cnLinesOn = False
> > res@cnLineLabelsOn = False
> >
> > res1= True
> > res1@gsnFrame = False
> > res1@gsnDraw = False
> > res1@cnLinesOn = False
> > res1@cnInfoLabelOn = False
> > res1@cnLineColor = "black"
> > res1@cnLineThicknessF = 1.5
> > res1@cnLineLabelsOn = False
> > plot = gsn_csm_contour_map_ce(wks,c(:,:),res)
> > shade = gsn_csm_contour(wks,sig1,res1)
> > shade = ShadeGtContour(shade,89.,0)
> >
> > overlay(plot,shade)
> > draw(plot)
> > frame(wks)
> >
> > end
> >
> >
> >
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> --
> __________________________________________________
> Adam Phillips
> asphilli@ucar.edu <mailto:asphilli@ucar.edu>
> National Center for Atmospheric Research tel: (303) 497-1726
> Climate and Global Dynamics Division fax: (303) 497-1333
> P.O. Box 3000
> Boulder, CO 80307-3000 http://www.cgd.ucar.edu/cas/asphilli
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
__________________________________________________
Adam Phillips 
asphilli@ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
Climate and Global Dynamics Division         fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jan 12 13:15:02 2011

This archive was generated by hypermail 2.1.8 : Thu Jan 13 2011 - 09:24:20 MST