[gradsusr] Contour levels are not strictly increasing
Jim Weber
Jim.Weber at FOXTV.COM
Tue Feb 19 16:02:16 EST 2019
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<mailto:jim.weber at foxtv.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20190219/f6a616e9/attachment.html>
More information about the gradsusr
mailing list