[gradsusr] smoothed shadings in GRADS
Jennifer M Adams
jadams21 at gmu.edu
Thu Dec 28 07:50:36 EST 2017
Yes, the missing grid points generated by the maskout() function are the issue here.
> 'define sig=maskout(ttest1,ttest1-3.055)’
You can use ‘gxout grfill’ to show all the valid grid box values for the variable ’sig', or you can skip the maskout() call and use ‘gxout shaded’ but omit drawing any contours less than 3.055 by using the color -1 in ’set ccols':
> ‘set clevs 3.055’
> ‘set ccols -1 15’
> ‘d ttest1'
Which would draw a gray shaded contour everywhere that ttest1 is >= 3.055
—Jennifer
> On Dec 28, 2017, at 3:00 AM, Lyndon Mark Olaguera <olagueralyndonmark429 at gmail.com> wrote:
>
> Hi Sir Andrew,
>
> The zero is actually important because this is a difference plot (see attached file). I am only using a single color to shade both negative and positive values.
>
> I'm not sure how to do your suggestion correctly.
>
> I use the const() function and set the missing values to a higher positive value (e.g. 1000) but the significant areas disappear.
> Is this correct?
>
> 'define c=const(ave(b,lat=0,lat=18),1000,-u)'
>
>
> Here's my script:
>
>
> 'sdfopen ../omega_P45P50_1979-1993_filt.nc'
> 'sdfopen ../omega_P45P50_1994-2008_filt.nc'
> 'sdfopen ../../../winds/uwnd/yearly/diff_P45P50_uwnd_9408minus7993.nc'
>
> 'set dfile 2'
> 'define n2=13'
> 'set lev 1000 100'
> 'set t 2'
> 'define x2 = ave(omega,t=2,t=14)'
> 'define s2 = sqrt(ave(pow(omega-x2,2),t=2,t=14)*(n2/(n2-1)))'
>
> 'set dfile 1'
> 'define n1=13'
> 'set lev 1000 100'
> 'set t 2'
> 'define x1 = ave(omega,t=2,t=14)'
> 'define s1 = sqrt(ave(pow(omega-x1,2),t=2,t=14)*(n1/(n1-1)))'
> 'define denom = sqrt((pow(s1,2)/n1)+(pow(s2,2)/n2))'
> 'define num = x2-x1'
> 'define ttest = num/denom'
> 'define ttest1 = abs(ttest)'
>
> 'define sig=maskout(ttest1,ttest1-3.055)'
>
>
> 'set lon 40 180'
> 'define b=maskout(num,sig)'
> 'set lev 1000 100'
> 'set lon 40 180'
> 'define c=ave(b,lat=0,lat=18)'
> 'set lev 1000 100'
> 'set lon 40 180'
> 'define d=ave(num,lat=0,lat=18)'
>
> 'set display color white'
> 'c'
> 'set parea 1.5 10.5 1.5 8'
> 'set lon 40 180'
> 'set grads off'
> 'set grid off'
> 'set xlopts 1 5 0.2'
> 'set ylopts 1 5 0.2'
> 'set xlint 20'
> 'set font 1'
>
> 'set gxout shaded'
> 'set lev 1000 100'
> 'set y 1'
> 'set zlog on'
> 'color -8 8 1 -kind gray->gray'
> 'set csmooth on'
> 'd -c*100'
>
> 'set dfile 3'
> 'set gxout stream'
> 'set strmden 7 0.001 0.1 2'
> 'set cthick 5'
> 'set lon 40 180'
> 'set t 1'
> 'set y 1'
> 'define u=ave(uwnd,lat=0,lat=18)'
> 'd u;-d*100'
>
> 'draw ylab Pressure(mb)'
> 'draw title Difference in Zonal Circulation(EQ-18N)'
> 'printim sig_omega_9408_minus_7993.png'
> 'c'
> 'quit'
>
>
> Many thanks for the help.
>
> Sincerely,
>
>
> Lyndon Mark P. Olaguera
> PhD Student
> Laboratory of Climatology
> Department of Geography
> Faculty of Urban Environmental Science
> Minami-Osawa Campus
> Tokyo Metropolitan University
> Hachioji Tokyo, Japan
>
>
> On Thu, Dec 28, 2017 at 4:12 PM, Andrew Friedman <andfried at gmail.com> wrote:
> This is just a guess, but maybe it is because you can’t smooth across missing values?
> What if you set your missing values to zero? Does that change anything?
>
> > On Dec 27, 2017, at 10:18 PM, Jeff Duda <jeffduda319 at gmail.com> wrote:
> >
> > I'm not sure what to say then. Perhaps the smth9() function only works on horizontal fields (that's all I've ever used it on)?
> >
> > Perhaps something very clever will be needed. Or you might have to perform the smoothing in an alternate data set outside of grads. Or you may be out of luck on this option. I'm not sure. Hopefully someone else can chime in with better advice.
> >
> > Good luck!
> >
> > Jeff
> >
> > On Wed, Dec 27, 2017 at 11:03 PM, Lyndon Mark Olaguera <olagueralyndonmark429 at gmail.com> wrote:
> > Dear Sir Jeff,
> >
> > I also tried your suggestion but the result does not change.
> >
> > 'd smth9(smth9(smth9(smth9(smth9(smth9(smth9(smth9(-c*100))))))))'
> >
> > I am only shading the significant areas via the maskout() function. Maybe, this is the reason why Im not getting a smooth shading?
> >
> > Sincerely,
> >
> > Lyndon Mark P. Olaguera
> > PhD Student
> > Laboratory of Climatology
> > Department of Geography
> > Faculty of Urban Environmental Science
> > Minami-Osawa Campus
> > Tokyo Metropolitan University
> > Hachioji Tokyo, Japan
> >
> >
> > On Thu, Dec 28, 2017 at 2:44 PM, Jeff Duda <jeffduda319 at gmail.com> wrote:
> > use the smth9() function. Nest several iterations of it to increase the smoothing level.
> >
> > Jeff Duda
> >
> > On Wed, Dec 27, 2017 at 9:41 PM, Lyndon Mark Olaguera <olagueralyndonmark429 at gmail.com> wrote:
> > Hi Bill,
> >
> > I tried this but the result is still the same.
> >
> > Sincerely,
> >
> > Lyndon Mark P. Olaguera
> > PhD Student
> > Laboratory of Climatology
> > Department of Geography
> > Faculty of Urban Environmental Science
> > Minami-Osawa Campus
> > Tokyo Metropolitan University
> > Hachioji Tokyo, Japan
> >
> >
> > On Wed, Dec 27, 2017 at 9:16 PM, Bill Reilly <bill_reilly at compuserve.com> wrote:
> > Before displaying the shading use the following:
> >
> > 'set csmooth on'
> > --
> >
> > Bill Reilly
> >
> >
> > (+34) 686-110-748
> >
> >
> >
> > bill at passageweather.com
> > www.passageweather.com
> >
> >
> >
> > bill at brwebworks.com
> > www.brwebworks.com
> >
> >
> >
> > On 27/12/2017 05:48, Lyndon Mark Olaguera wrote:
> >> Dear GrADS experts,
> >>
> >> I am trying to plot a difference plot.In particular, a height-longitude cross section attached in this email. I am shading only the significant areas.
> >>
> >> Is there a way to smoothen the shading in the plot?Currently, the shading appears like "blocks".
> >> Here's a part of my script.
> >>
> >> 'define sig=maskout(ttest1,ttest1-3.055)'
> >> 'set lon 40 180'
> >> 'define b=maskout(num,sig)'
> >> 'set lev 1000 100'
> >> 'set lon 40 180'
> >> 'define c=ave(b,lat=0,lat=18)'
> >>
> >> 'set display color white'
> >> 'c'
> >> 'set parea 1.5 10.5 1.5 8'
> >> 'set lon 40 180'
> >> 'set grads off'
> >> 'set grid off'
> >> 'set xlopts 1 5 0.2'
> >> 'set ylopts 1 5 0.2'
> >> 'set xlint 20'
> >> 'set font 1'
> >>
> >> 'set gxout shaded'
> >> 'set lev 1000 100'
> >> 'set y 1'
> >> 'set zlog on'
> >> 'color -8 8 1 -gxout shaded -kind gray->gray'
> >> 'd -c*100'
> >>
> >> I'll appreciate any help.
> >>
> >> Sincerely,
> >>
> >>
> >> Lyndon Mark P. Olaguera
> >> PhD Student
> >> Laboratory of Climatology
> >> Department of Geography
> >> Faculty of Urban Environmental Science
> >> Minami-Osawa Campus
> >> Tokyo Metropolitan University
> >> Hachioji Tokyo, Japan
> >>
> >>
> >>
> >> ______________________________
> >> _________________
> >> gradsusr mailing list
> >>
> >> gradsusr at gradsusr.org
> >> http://gradsusr.org/mailman/listinfo/gradsusr
> >
> >
> > _______________________________________________
> > gradsusr mailing list
> > gradsusr at gradsusr.org
> > http://gradsusr.org/mailman/listinfo/gradsusr
> >
> >
> >
> > _______________________________________________
> > gradsusr mailing list
> > gradsusr at gradsusr.org
> > http://gradsusr.org/mailman/listinfo/gradsusr
> >
> >
> >
> >
> > --
> > Jeff Duda
> > Post-doctoral research fellow
> > University of Oklahoma School of Meteorology
> >
> > _______________________________________________
> > gradsusr mailing list
> > gradsusr at gradsusr.org
> > http://gradsusr.org/mailman/listinfo/gradsusr
> >
> >
> >
> > _______________________________________________
> > gradsusr mailing list
> > gradsusr at gradsusr.org
> > http://gradsusr.org/mailman/listinfo/gradsusr
> >
> >
> >
> >
> > --
> > Jeff Duda
> > Post-doctoral research fellow
> > University of Oklahoma School of Meteorology
> > _______________________________________________
> > gradsusr mailing list
> > gradsusr at gradsusr.org
> > http://gradsusr.org/mailman/listinfo/gradsusr
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
> <sig_omega_9408_minus_7993.png>_______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://secure-web.cisco.com/16TSWt--HQj5FmzwFVhGfzhNh2nTzXoL_qZNFM0hcdMNyPnRVe7jkDrLmoBOjAy-ah-kdFBkGrtlXj_fVTPYeGaEz8cZsL9B--lXtiaJrMc2xC0DmhUH9cdodpN17SJ_iKfcPq3JDM-qLlKWDoIT6nf5k7lPRjMh3ZF8TeIKFbMDtNjC3pRSzZB8gDnstLQixnJWmowQHj5BGa4PHJsmn2yrxzhYA7Aa4PFUtBRz7HT7iyWqC8Xoz4qKTNSfYw5a4XKMQjQyeMNgQIpf8ze9B0DBXfoZZ3Yv9gsDdXsT1P4MO6uzEJLOFDvBbH35DaHMYJujSLT_TIFPzhkekqwQdsXMPjSPOqATLarj2oW7fVgcqYnhLwZKulCsCwMUlABHEu4uTZ3ULukpYoQ_DIg6ChByynR8WEyvA_znOYmuKa3IrpB5m1iKtJWy_nVyW94JQ/http%3A%2F%2Fgradsusr.org%2Fmailman%2Flistinfo%2Fgradsusr
--
Jennifer Miletta Adams
Center for Ocean-Land-Atmosphere Studies (COLA)
George Mason University
More information about the gradsusr
mailing list