<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Ron, I would like to have that script that lets you step forward and backward.<div><br></div><div>Thanks,</div><div>Clay</div><div><br><div><div>On Mar 23, 2011, at 12:19 PM, Goodson,Ron [Edm] wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"> <div style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space"> <div dir="ltr" align="left"><span class="534041216-23032011"><font face="Arial" color="#0000ff" size="2">Hi Clay</font></span></div> <div dir="ltr" align="left"><span class="534041216-23032011"><font face="Arial" color="#0000ff" size="2"></font></span> </div> <div dir="ltr" align="left"><span class="534041216-23032011"><font face="Arial" color="#0000ff" size="2">(I was typing when I saw Jeffrey's note .. so modified my answer but ...)</font></span></div> <div dir="ltr" align="left"><span class="534041216-23032011"><font face="Arial" color="#0000ff" size="2"></font></span> </div> <div dir="ltr" align="left"><span class="534041216-23032011"><font face="Arial" color="#0000ff" size="2">Its like he said - you don't need the "set rbrange" for what you want.</font></span></div> <div dir="ltr" align="left"><span class="534041216-23032011"><font face="Arial" color="#0000ff" size="2"></font></span> </div> <div dir="ltr" align="left"><span class="534041216-23032011"><font face="Arial" color="#0000ff" size="2">The only reason I use my make_clevs.gs script is because I often want to programatically determine the clevs based upon "whatever" .. rather than hard-code it. And .. even if I was hardcoding - I don't like having to type in a huge</font></span></div> <div dir="ltr" align="left"><span class="534041216-23032011"><font face="Arial" color="#0000ff" size="2">number of entries.</font></span></div> <div dir="ltr" align="left"><span class="534041216-23032011"><font face="Arial" color="#0000ff" size="2"></font></span> </div> <div dir="ltr" align="left"><span class="534041216-23032011"><font face="Arial" color="#0000ff" size="2">I almost never use ccols because I define my own colours and do a 'set rbcols' at the beginning so I have my own rainbow colours.</font></span></div> <div dir="ltr" align="left"><span class="534041216-23032011"><font face="Arial" color="#0000ff" size="2"></font></span> </div> <div dir="ltr" align="left"><span class="534041216-23032011"><font face="Arial" color="#0000ff" size="2">I do what Jeffrey has when I have clevs that are not equally spaced (such as for precipitation amounts) and when the colours don't vary smoothly (so I have to pick-and-choose discrete numbers from my defined colours rather than letting GrADS default to the rainbow colours).</font></span></div> <div dir="ltr" align="left"><span class="534041216-23032011"><font face="Arial" color="#0000ff" size="2"></font></span> </div> <div dir="ltr" align="left"><span class="534041216-23032011"><font face="Arial" color="#0000ff" size="2">I've attached my "setup.gs" script which does the 'set rbcols' and a slightly fiddled version of the grads-script-library "colors.gs" (fiddled only to give the colours I want). I execute this script just once .. before any other scripts that use my "standard" colour table. If I want to change colour tables .. I have other files that assign the rgb values and do the rbcols in a similar fashion (like when I need grey-scale imagery).</font></span></div> <div dir="ltr" align="left"><span class="534041216-23032011"><font face="Arial" color="#0000ff" size="2"></font></span><span class="534041216-23032011"><font face="Arial" color="#0000ff" size="2"></font></span> </div> <div dir="ltr" align="left"><span class="534041216-23032011"></span><font face="Arial" color="#0000ff" size="2"><span class="534041216-23032011">For animation -- I have a couple of scripts that are similar to the standard xanim.gs - but use widgets instead of the keyboard to control the animation (eg .. step forward or back). I can send you those if you want .. but it might only confuse you more.</span></font></div> <div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span class="534041216-23032011"></span></font> </div> <div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span class="534041216-23032011"></span></font> </div> <div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span class="534041216-23032011">ron</span></font></div> <div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span class="534041216-23032011"></span></font> </div> <div class="OutlookMessageHeader" lang="en-us" dir="ltr" align="left"> <hr tabindex="-1"> <font face="Tahoma" size="2"><b>From:</b> gradsusr-bounces@gradsusr.org [<a href="mailto:gradsusr-bounces@gradsusr.org">mailto:gradsusr-bounces@gradsusr.org</a>] <b>On Behalf Of </b>Clay Blankenship<br><b>Sent:</b> March 23, 2011 9:43 AM<br><b>To:</b> GrADS Users Forum<br><b>Subject:</b> Re: [gradsusr] Setting color bar for animation<br></font><br></div> <div></div>OK, from the command line I can use make_clevs to specify any range of levels and plot and get the color bar. But both of my scripts dd.gs (a script to plot, specify a range, and make a color bar) and ani.gs (animation) do not plot the full color bar when I specify the range with script arguments. I can't figure out what's going on... <div><br></div> <div>Also, I am still looking for a way to display the current ccols and clevs. Do you have to use 'q shades'?</div> <div><br></div> <div>One more thing, this animation script regulates its speed by redrawing the plot a certain number of times; is there a better way to do that?</div> <div><br></div> <div>Thanks,</div> <div>Clay</div> <div><br></div> <div>****dd.gs***********</div> <div> <div>function dd (args)</div> <div>*Plot a variable and its color scale.</div> <div>* dd variable [ -cmin minimum value ]</div> <div>* [ -cmax maximum value ]</div> <div>* [ -cint color scale ]</div> <div><br></div> <div>variable=subwrd(args,1)</div> <div><br></div> <div>ccint=''</div> <div>ccmin=''</div> <div>ccmax=''</div> <div>string=''</div> <div>space=' '</div> <div>n=2</div> <div><br></div> <div>while(n<9)</div> <div>idx=subwrd(args,n)</div> <div>opt=subwrd(args,n+1)</div> <div>if(idx='');break;endif</div> <div>if(idx='-cint');ccint=opt;endif</div> <div>if(idx='-cmin');ccmin=opt;endif</div> <div>if(idx='-cmax');ccmax=opt;endif</div> <div>if(idx='-string');string=opt;endif</div> <div>n=n+2</div> <div>endwhile</div> <div><br></div> <div>'c'</div> <div>'set gxout shaded'</div> <div>if(ccint!=''); 'set cint 'ccint;endif</div> <div>if(ccmin!=''); 'set cmin 'ccmin;endif</div> <div>if(ccmax!=''); 'set cmax 'ccmax;endif</div> <div>if(ccmin!=''); if(ccmax!=''); 'set rbrange 'ccmin ' 'ccmax; endif;endif</div> <div><br></div> <div>*CBB 3/22/11 set the levels</div> <div>'make_clevs ' cmin cmax cint</div> <div> <div>'d 'variable</div> <div><br></div> <div>*Add date and user-input string</div> <div>'q time'</div> <div>say result</div> <div>cctime=subwrd(result,3)</div> <div>coln=substr(cctime,3,1)</div> <div>if coln = ':'</div> <div>dmy =substr(cctime,7,9)</div> <div>else</div> <div>dmy =substr(cctime,1,12)</div> <div>day =substr(cctime,1,3)</div> <div>my =substr(cctime,4,9)</div> <div><br></div> <div>*dmy =substr(cctime,4,9) *cbb changed </div> <div>endif</div> <div><br></div> <div>* 'draw title 'dmy space string</div> <div> 'draw title 'day space my space string</div> <div><br></div> <div>'q shades' </div> <div><br></div> <div>'cbar2' </div> <div><br></div></div> <div>****END***********</div> <div><br></div> <div>***ani.gs************</div> <div><br></div> <div> <div>* Display animation </div> <div>* ga> run ani variable [ -I slowness (default=10) ]</div> <div>* [ -cint, -ci contour interval ]</div> <div>* [ -cmin, -mn minimum contour level ]</div> <div>* [ -cmax, -mx maximum contour level ]</div> <div>* ex. ga> run ani t-t.2 -ci 0.1 -mn -0.5 -I 5 -cmax 0.3</div> <div>* >>>> plot (t-t.2) with slowness=5, contour_interval=0.1</div> <div>* minimum contour level=-0.5, maximum contour level=0.3</div> <div>*</div> <div>* Nov. 9, 1999 Masami Nonaka</div> <div>*</div> <div>function ani (args)</div> <div><br></div> <div>variable=subwrd(args,1)</div> <div><br></div> <div>slow=''</div> <div>ccint=''</div> <div>ccmin=''</div> <div>ccmax=''</div> <div>cbar=''</div> <div>n=2</div> <div><br></div> <div>while(n<10000)</div> <div>idx=subwrd(args,n)</div> <div>opt=subwrd(args,n+1)</div> <div>if(idx='');break;endif</div> <div>if(idx='-I');slow=opt;endif</div> <div>if(idx='-Int');slow=opt;endif</div> <div>if(idx='-cint');ccint=opt;endif</div> <div>if(idx='-cmin');ccmin=opt;endif</div> <div>if(idx='-cmax');ccmax=opt;endif</div> <div>if(idx='-ci');ccint=opt;endif</div> <div>if(idx='-mn');ccmin=opt;endif</div> <div>if(idx='-mx');ccmax=opt;endif</div> <div>n=n+2</div> <div>endwhile</div> <div><br></div> <div>defaultslow=10</div> <div>if(slow=''); slow=defaultslow;endif</div> <div><br></div> <div>'q dims'</div></div> <div> <div> <div> <div> say result</div> <div>aline=sublin(result,5)</div> <div>cctime1=subwrd(aline,11)</div> <div>cctime2=subwrd(aline,13)</div> <div>tmin=substr(cctime1,1,9)</div> <div>tmax=substr(cctime2,1,9)</div> <div>it=tmin</div> <div>'set dbuff on'</div> <div>while (it <=tmax)</div> <div> 'set t 'it</div> <div>i=0</div> <div>while (i <slow)</div> <div>if(ccint!=''); 'set cint 'ccint;endif</div> <div>if(ccmin!=''); 'set cmin 'ccmin;endif</div> <div>if(ccmax!=''); 'set cmax 'ccmax;endif</div> <div>if(ccmin!=''); if(ccmax!=''); 'set rbrange 'ccmin ' 'ccmax; endif;endif</div> <div><br></div> <div>*CBB 3/22/11 setting max min clevs</div> <div>'make_clevs ' cmin cmax cint</div> <div><br></div> <div> 'display 'variable</div> <div><br></div> <div> 'run date.gs'</div> <div><br></div> <div><br></div> <div><br></div> <div> 'query shades'</div> <div>shdinfo = result</div> <div>if(subwrd(shdinfo,1)!='None');'run fcbar.gs';endif</div> <div><br></div> <div>'swap'</div> <div>i=i+1</div> <div>endwhile</div> <div> it=it+1</div> <div>endwhile</div> <div> 'set t ' tmin ' ' tmax</div></div></div></div> <div><br></div> <div><br></div> <div> <div>****END***********</div></div> <div><br></div> <div><br></div> <div><br></div></div> <div> <div><br></div> <div><br></div> <div><br> <div> <div>On Mar 22, 2011, at 5:23 PM, Goodson,Ron [Edm] wrote:</div><br class="Apple-interchange-newline"> <blockquote type="cite"> <div style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space"> <div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span class="015501622-22032011">I see in my original note I mislead you .. when I said I do my make_clevs.gs before cbar. As was noted by Jeffrey . the settings of clevs, ccols (all that stuff) must happen before the display of the variable. So swap those two lines of "display" and "make_clevs".</span></font></div> <div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span class="015501622-22032011"></span></font> </div> <div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span class="015501622-22032011"></span></font> </div> <div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span class="015501622-22032011"></span></font> </div> <div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span class="015501622-22032011">The other thing I usually do right at the start of my programs (and only has to be done once .. unlike settings clevs, ccols which must be done before each display) is to setup some custom colours through "set rgb" (one entrie per colour) and rbcols (to set the order of the colours). You don't need to do this if you are using the GrADS standard scheme of 16 colours.</span></font></div> <div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span class="015501622-22032011"></span></font> </div> <div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span class="015501622-22032011"></span></font> </div> <div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span class="015501622-22032011">ron</span></font></div><br> <div class="OutlookMessageHeader" lang="en-us" dir="ltr" align="left"> <hr tabindex="-1"> <font face="Tahoma" size="2"><b>From:</b> <a href="mailto:gradsusr-bounces@gradsusr.org">gradsusr-bounces@gradsusr.org</a> [<a href="mailto:gradsusr-bounces@gradsusr.org">mailto:gradsusr-bounces@gradsusr.org</a>] <b>On Behalf Of </b>Clay Blankenship<br><b>Sent:</b> March 22, 2011 4:05 PM<br><b>To:</b> GrADS Users Forum<br><b>Subject:</b> Re: [gradsusr] Setting color bar for animation<br></font><br></div> <div></div>OK, that make_clevs works for me when I do a simple 'd' on my variable, but when I try to use a little fancier script (not even an animation, just trying to pass the range on the command line), I lose the min and max values. <div><br></div> <div>If I do:</div> <div><br></div> <div>c</div> <div>make_clevs 0 2 0.2</div> <div>d soilwat5</div> <div>cbar</div> <div><br></div> <div>I get a colorbar from 0 to 2 in steps of .2, even though the variable range is 0 to 1 (so far, so good).</div> <div><br></div> <div>If I do:</div> <div> </div> <div>dd soilwat5 -cmin 0 -cmax 2 -cint 0.2</div> <div><br></div> <div>I get a colorbar from 0 to 1 in steps of 0.2. The colors are the same for the different ranges, it just doesn't show the ones above 1. Is this because clevs are set and ccols are not? I was hoping ccols would get set automatically like it does when you don't specify levels.</div> <div><br></div> <div>This happens whether or not I use the make_clevs line in the following script.</div> <div><br></div> <div>BTW, this seems really basic, but I can't figure out how to see the current values of ccols and clevs.</div> <div>cbar is getting its ccols and clevs from 'q shades', but it doesn't react to ccols and clevs until a plot has been made.</div> <div><br></div> <div>Script follows.</div> <div><br></div> <div>Thanks for the help,</div> <div>Clay</div> <div><br></div></div><br></blockquote></div><br> <div apple-content-edited="true"><span class="Apple-style-span" style="WORD-SPACING: 0px; FONT: medium Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"> <div style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space"><span class="Apple-style-span" style="WORD-SPACING: 0px; FONT: medium Helvetica; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"> <div style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space"><span class="Apple-style-span" style="WORD-SPACING: 0px; FONT: 12px Monaco; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"> <div style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space"><span class="Apple-style-span" style="WORD-SPACING: 0px; FONT: 12px Monaco; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); TEXT-INDENT: 0px; WHITE-SPACE: normal; LETTER-SPACING: normal; BORDER-COLLAPSE: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"> <div style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space"> <div> <div> <div> <div>-- </div> <div>Clay Blankenship * USRA Research Scientist</div></div> <div> <div> <div> <div><a href="mailto:clay.b.blankenship@nasa.gov">clay.b.blankenship@nasa.gov</a> * 256-961-7638</div></div></div></div> <div>320 Sparkman Drive * Huntsville, AL 35805 USA</div></div></div> <div>National Space Science and Technology Center at NASA-MSFC/UAH</div><br></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div><br></div></div></div> <span><setup.gs></span><span><colors.gs></span><span><ATT00001.txt></span></blockquote></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Monaco; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Monaco; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><div><div>-- </div><div>Clay Blankenship * USRA Research Scientist</div></div><div><div><div><div><a href="mailto:clay.b.blankenship@nasa.gov">clay.b.blankenship@nasa.gov</a> * 256-961-7638</div></div></div></div><div>320 Sparkman Drive * Huntsville, AL 35805 USA</div></div></div><div>National Space Science and Technology Center at NASA-MSFC/UAH</div><br></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"> </div><br></div></body></html>