[gradsusr] Contour levels are not strictly increasing

Jennifer M Adams jadams21 at gmu.edu
Tue Feb 19 20:28:38 EST 2019


Hi, Jim —
The problem is with your format of "%3.1f” which may not be adequate to uniquely represent each level if your delta is small. Your format should have a few extra columns on either side of the decimal, perhaps “%8.4f” would be good enough. 
Try adding the line 
    say levs
after the while loop that calculates the contour levels — that should reveal when the levels are identical and give you a hint as to how to adjust the formatting. 
—Jennifer


> On Feb 19, 2019, at 4:02 PM, Jim Weber <Jim.Weber at FOXTV.COM> wrote:
> 
> Hi,
>  
> I have a script which I have inherited that worked until all the https changes with NOAA.  That forced me to upgrade to a version of grads that could connect to a https server. Once I did this and corrected this problem I developed another issue. When my scripts run I get the following error.
>  
> Warning: Contour levels are not strictly increasing
>          This may lead to errors or undesired results
>  
> I have narrowed it down to these two lines that if I remove them I do not get the error (but also do not get the contours with as many levels)
>  
> 'set ccols 'cols
> 'set clevs 'levs
>  
> Further up in the script it has a while loop to set all the colors and also to set the cols and levs(see below). Does anyone have a suggestion on what is wrong that the above commands generate this error and how I might correct this?
>  
> * set the contour levels
> nlevs=239
> l=1
> levs=''
> val=min
> delta=(max-min)/nlevs
> while(l<=nlevs)
> val=min + l*delta
> fmt="%3.1f"
> fval = math_format(fmt,val)
> levs=levs' 'fval
> l=l+1
> endwhile
>  
> * set the contour colors
> c=255
> cols=''
> while (c>15)
>   cols=cols' 'c
>   c=c-1
> endwhile
>  
> * define the colors
> delta=4
> base=15
> c=16
> blksz=60
> while (c<=255)
>  
> * block 1: Red to Yellow
>   rval=255 
>   bval=base 
>   i=0
>   while (i<blksz)
>     gval=base + (i*delta)
>     'set rgb 'c' 'rval' 'gval' 'bval
>     i=i+1
>     c=c+1
>   endwhile
>  
> * block 2: Yellow to Green
>   gval=255
>   bval=base
>   i=0
>   while (i<blksz)
>     rval=255 - (i*delta)
>     'set rgb 'c' 'rval' 'gval' 'bval
>     i=i+1
>     c=c+1
>   endwhile
>  
> * block 3: Green to Cyan
>   rval=base
>   gval=255
>   i=0
>   while (i<blksz)
>     bval=base + (i*delta)
>     'set rgb 'c' 'rval' 'gval' 'bval
>     i=i+1
>     c=c+1
>   endwhile
>  
> * block 4: Cyan to Blue
>   rval=base
>   bval=220
>   i=0
>   while (i<blksz)
>     gval=255 - (i*delta)
>     'set rgb 'c' 'rval' 'gval' 'bval
>     i=i+1
>     c=c+1
>   endwhile
>  
>  
> Jim Weber
> jim.weber at foxtv.com
>  
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://secure-web.cisco.com/1wooM8iXowtyRVRGgrT-el8jdLFQfdKAJGmD7hKqGE2kMSY5neLlIenY3Tp0VY3qa-JPDE7uLr2UIbb4aW1PnjphQQkvkuodoOqVl17W5RrEc8rTxeHKh79h8ma-o7aMG0kEcc37z6ozLbjeb5-48nTj65HuoZq9hUdETwB5AtgZotCMV1i4mojn9TVftBNaVNyPqeo9gceID-16DQKSVH0iUXd-jxVj_MJS1t4TqI312_41VTyp-6mtPLpE39qGEuTG10KktyYOErbVfW8IT1bABUVN0JgO-G8eow1ObOsMgwxw-RRs5GrkSq8TdzKnszFoBU2xizTtqtSS7sguHcPsVk6PIF62aBBojQGzgp6BpH3WAGjsjSxozd3m4__mA/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