<div dir="ltr">Oh...in that case use a while loop to build a text string adding each contour level. Here's a simplified example from one of my own scripts:<div><br></div><div><div> c_levs = '' </div><div>
c_cols = '' </div><div> value = min_deg </div><div> init_color_value = 16</div><div> i = 0 </div><div> while (value <= max_deg)</div><div> color_value = math_int(init_color_value + i*skips)</div>
<div> i = i + 1 </div><div> c_levs = c_levs' 'value</div><div> c_cols = c_cols' 'color_value</div><div> value = value + diff </div><div> endwhile </div><div>* These two lines are required since set ccols requires one more value than set clevs</div>
<div>* at this point, i should be equal to n_levs</div><div> color_value = math_int(init_color_value + i*skips)</div><div> if (color_value > 69)</div><div> color_value = 69 </div><div> endif </div>
<div> c_cols = c_cols' 'color_value</div><div><br></div><div> 'set clevs 'c_levs</div><div> 'set ccols 'c_cols</div></div><div><br></div><div style>Jeff</div></div><div class="gmail_extra"><br><br>
<div class="gmail_quote">On Tue, May 21, 2013 at 8:49 PM, Sam Wilson <span dir="ltr"><<a href="mailto:sam@surfline.com" target="_blank">sam@surfline.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="auto">
<div>Hi Jeff,</div>
<div><br>
</div>
<div>Thanks for the response. I have the RGB values and the 'set ccols' command covered I think. Those will remain static no matter what the high/low temps are. I'm looking for how to work the 'set clevs' command, which I need to be variable from data file
to data file, given that the temperature ranges will change. So, I'm wondering if I can create an array of clevs, and pass that to the 'set clevs' command.</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Sam<br>
<br>
<br>
</div><div><div class="h5">
<div><br>
On May 21, 2013, at 6:32 PM, "Jeff Duda" <<a href="mailto:jeffduda319@gmail.com" target="_blank">jeffduda319@gmail.com</a>> wrote:<br>
<br>
</div>
<blockquote type="cite">
<div>
<div dir="ltr">You need to also set the contour colors. This means you will need to use the 'set rgb R G B' commands to define color numbers up to 255 (the highest allowable in Grads) and set the color values using the 'set ccols (list#)'.
<div><br>
</div>
<div>Jeff Duda</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Tue, May 21, 2013 at 6:41 PM, Sam Wilson <span dir="ltr">
<<a href="mailto:sam@surfline.com" target="_blank">sam@surfline.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="font-size:14px;font-family:Calibri,sans-serif;word-wrap:break-word">
<div>
<div>
<div>Hi all,</div>
<div><br>
</div>
<div>I have a grads script that reads satellite data and figures out a temperature range based on the data over an area:</div>
<div><br>
</div>
<div>sstrange = maxtemp – mintemp</div>
<div><br>
</div>
<div>I would like to have 254 levels (colors) between that high and low temp, so I calculate an interval like so:</div>
<div><br>
</div>
<div>interval = sstrange/254</div>
<div><br>
</div>
<div>I have all the colors I need for the set ccols option, however I'm wondering if there is a way to dynamically set clevs based on the high and low temp and the interval. I tried the below, but I don't think it worked:</div>
<div><br>
</div>
<div>
<div style="font-family:Consolas;font-size:medium"><span style="font-family:Calibri">i = 1</span></div>
<div style="font-family:Consolas;font-size:medium"><span style="font-family:Calibri">while (i < 254)</span></div>
<div style="font-family:Consolas;font-size:medium"><span style="font-family:Calibri">clev.i = mintemp+(interval*i)</span></div>
<div style="font-family:Consolas;font-size:medium"><span style="font-family:Calibri">'set clevs 'clev.i</span></div>
<div style="font-family:Consolas;font-size:medium"><span style="font-family:Calibri">i = i + 1</span></div>
<div style="font-family:Consolas;font-size:medium"><span style="font-family:Calibri">endwhile</span></div>
</div>
<div><br>
</div>
<div>I also tried the following:</div>
<div><br>
</div>
<div>
<div style="font-family:Consolas;font-size:medium"><span style="font-family:Calibri">'set cmin 'finallowt</span></div>
<div style="font-family:Consolas;font-size:medium"><span style="font-family:Calibri">'set cmax 'finalhight</span></div>
<div style="font-family:Consolas;font-size:medium"><span style="font-family:Calibri">'set cint 'interval</span></div>
</div>
<div><br>
</div>
<div>But I get a message saying 'Too many contour levels -- adjusting cint'.</div>
<div><br>
</div>
<div>Any ideas if this is possible or how to solve it?</div>
<div><br>
</div>
<div>Thanks and best regards.</div>
<span><font color="#888888"></font></span></div>
<span><font color="#888888"></font></span></div>
<span><font color="#888888">
<div><br>
</div>
<div>Sam</div>
</font></span></div>
<br>
_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
Jeff Duda<br>
Graduate research assistant<br>
University of Oklahoma School of Meteorology<br>
Center for Analysis and Prediction of Storms<br>
</div>
</div>
</blockquote>
<blockquote type="cite">
<div><span>_______________________________________________</span><br>
<span>gradsusr mailing list</span><br>
<span><a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a></span><br>
<span><a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a></span><br>
</div>
</blockquote>
</div></div></div>
<br>_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Jeff Duda<br>Graduate research assistant<br>University of Oklahoma School of Meteorology<br>Center for Analysis and Prediction of Storms<br>
</div>