<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">quick response to the first part. </div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:16px"> 92 colors = where(((rf.ge.0.1).and.(<a href="http://rf.lt" target="_blank">rf.lt</a>.</span><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:16px">2.5)),"Blue"," ") ; This is a string variable</span><br style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:16px"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:16px"> 93 colors = where(((rf.ge.2.5).and.(<a href="http://rf.lt" target="_blank">rf.lt</a>.</span><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:16px">7.5)),"Red"," ") ;;; This will undo anything set in the line above. </span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">Quick edit below:</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">colors = new( dimsizes(rf), string)</div><div class="gmail_default" style="font-family:verdana,sans-serif">colors = "" ; not really necessary.</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:16px">colors = where(((rf.ge.0.1).and.(<a href="http://rf.lt" target="_blank">rf.lt</a>.</span><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:16px">2.5)),"Blue",colors)</span><br></div><div class="gmail_default"><span style="font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;color:rgb(0,0,0);font-size:16px">colors = where(((rf.ge.2.5).and.(<a href="http://rf.lt" target="_blank">rf.lt</a>.</span><font color="#000000" face="HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif" size="3">7.5)),"Red",colors) ;;; now anything set on the first line won't be unset on this line. continue as necessary. </font><span style="font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;color:rgb(0,0,0);font-size:16px"><br></span></div><div class="gmail_default"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:16px">colors = where(((rf.ge.7.5).and.(<a href="http://rf.lt" target="_blank">rf.lt</a>.</span><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:16px">15.5)),"Yellow",</span><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:medium"> colors</span><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:16px">)</span><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:16px"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:16px">print(rf+" "+ colors) ;;; look at your data and the output to check it worked. </span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:16px"><br></span></div><div class="gmail_default"><font color="#000000" face="HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif" size="3">;; colorss= stringtoint(colors) ;; This won't work and shouldn't be needed. You'd want something like: </font><span style="font-family:arial,sans-serif"><a href="https://www.ncl.ucar.edu/Document/Graphics/Interfaces/namedcolor2rgb.shtml">https://www.ncl.ucar.edu/Document/Graphics/Interfaces/namedcolor2rgb.shtml</a></span><span style="font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;color:rgb(0,0,0);font-size:16px"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif">Alan. </span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:arial,sans-serif"><br></span></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 19, 2015 at 1:02 PM, Geeta Geeta <span dir="ltr"><<a href="mailto:geetag54@yahoo.com" target="_blank">geetag54@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div style="color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:16px"><div><span></span></div><div dir="ltr"> Hi Mary. <br>I have tried three things for giving a range to the rainfall. Pls see the lines 91 to 110 of my script. <br><br><br><br>1. I tried the following. <br><br>1. print(nrf)<br> 92 colors = where(((rf.ge.0.1).and.(rf.lt.2.5)),"Blue"," ") ; This is a string variable<br> 93 colors = where(((rf.ge.2.5).and.(rf.lt.7.5)),"Red"," ")<br> 94 ; colors = where(((rf.ge.7.5).and.(rf.lt.15.5)),"Yellow"," ")<br> 95 ; colorss= stringtoint(colors)<br> <br>2nd
Method in which I have defined the colors as an array. So there is
error on line 106. Also this will give an individual color to each data.
<br>Variable: colors<br>Type: integer<br>Total Size: 16 bytes<br> 4 values<br>Number of Dimensions: 1<br>Dimensions and sizes: [4]<br>Coordinates: <br>(0) 1<br>(1) 21<br>(2) 41<br>(3) 61<br>fatal:Subscript out of range, error in subscript #0<br>fatal:An error occurred reading colors<br>fatal:["Execute.c":8578]:Execute: Error occurred at or near line 106 in file stn-v3.ncl<br><br><a href="mailto:aditya@agniilap" target="_blank">aditya@agniilap</a>:~/geeta/ncl$ <br><br>can U pls suggest???I also tried combining two statements with where but that did not work. <br> Geeta. <br><span><font color="#888888"><br></font></span></div><span><font color="#888888"><div>Geeta.</div></font></span></div></div><br>_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div></div>