<div dir="ltr">Aaron,<div><br></div><div>You said you were not seeing expected results, but you didn't mention what results you were getting at the suspect grid points. Were they unchanged? Were they changed, but different from expected? If you include a 'say 'obs_val immediately before your 'set defval temp 'xx' 'yy' 'obs_val, what is that value? Is that the same as or different from what you would get with 'q defval temp 'xx' 'yy <u>after</u> you 'set defval... ?</div><div><br></div><div>Also, you said you were reading from a CSV file, which implies there are commas separating the values. Did you take that into account when reading the file? Your sample code suggest you did not.</div><div><br></div><div>Stephen McMillan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 20, 2018 at 6:54 AM, Perry, Aaron <span dir="ltr"><<a href="mailto:Aaron.Perry@lsc.vsc.edu" target="_blank">Aaron.Perry@lsc.vsc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div id="m_2330845458605350843divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Happy Friday All,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I'm trying to replace individual grid cells on a model grid( where ASOS stations are) with certain values from a CSV file.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"><b>Sample from CSV File:</b></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"></p>
<div><span style="font-family:"Courier New",monospace">K0J4 31.04250 -86.31167 84.9</span></div>
<div><span style="font-family:"Courier New",monospace">K11R 30.21889 -96.37417 82.7</span></div>
<div><span style="font-family:"Courier New",monospace">K12N 41.00928 -74.73628 51.0</span></div>
<div><span style="font-family:"Courier New",monospace">K1A5 35.22277 -83.41497 82.5</span></div>
<div><span style="font-family:"Courier New",monospace">K1A6 36.61056 -83.73722 80.0</span></div>
<div><span style="font-family:"Courier New",monospace">K1M4 34.28028 -87.60028 75.9</span></div>
<div><span style="font-family:"Courier New",monospace">K1P1 43.77714 -71.75598 46.5</span></div>
<div><span style="font-family:"Courier New",monospace">K1V4 44.42010 -72.01930 46.0</span></div>
<div><span style="font-family:"Courier New",monospace">K2WX 45.60444 -103.54639 57.9</span></div>
<div><span style="font-family:"Courier New",monospace">K3I2 38.91444 -82.09833 69.0</span></div>
<div><span style="font-family:"Courier New",monospace">K3LF 39.16052 -89.67419 63.8</span></div>
<div><span style="font-family:"Courier New",monospace">K3T5 29.90806 -96.95 82.2</span></div>
<div><span style="font-family:"Courier New",monospace">K40B 46.61667 -69.53333 39.3</span></div>
<p></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"><b>Relevant GrADS Code:</b></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"></p>
<div><span style="font-family:"Courier New",monospace">'define temp = oacres(dummy.1(t=1),TMAX2m.2(<wbr>t=1))'</span></div>
<div><br>
</div>
<div><span style="font-family:"Courier New",monospace">''path1'<a href="http://color.gs" target="_blank">color.gs</a> -30 120 1'</span></div>
<div><br>
</div>
<div><span style="font-family:"Courier New",monospace">'d temp'</span></div>
<p></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"></p>
<div><span style="font-family:"Courier New",monospace">istat = 0</span></div>
<div><br>
</div>
<div><span style="font-family:"Courier New",monospace">while (istat != 2)</span></div>
<div><br>
</div>
<div><span style="font-family:"Courier New",monospace">data = read("/home/weather/file.csv")</span></div>
<div><span style="font-family:"Courier New",monospace">istat = sublin(data,1)</span></div>
<div><br>
</div>
<div><span style="font-family:"Courier New",monospace">if (istat = 2)</span></div>
<div><span style="font-family:"Courier New",monospace">break</span></div>
<div><br>
</div>
<div><span style="font-family:"Courier New",monospace">endif</span></div>
<div><br>
</div>
<div><span style="font-family:"Courier New",monospace">linez = sublin(data,2)</span></div>
<div><br>
</div>
<div><span style="font-family:"Courier New",monospace">site = subwrd(linez,1)</span></div>
<div><span style="font-family:"Courier New",monospace">obs_lat = subwrd(linez,2)</span></div>
<div><span style="font-family:"Courier New",monospace">obs_lon = subwrd(linez,3)</span></div>
<div><span style="font-family:"Courier New",monospace">obs_val = subwrd(linez,4)</span></div>
<div><br>
</div>
<div><span style="font-family:"Courier New",monospace">'q w2gr 'obs_lon' 'obs_lat</span></div>
<div><span style="font-family:"Courier New",monospace">xgrid = subwrd(result,3)</span></div>
<div><span style="font-family:"Courier New",monospace">ygrid = subwrd(result,6)</span></div>
<div><br>
</div>
<div><span style="font-family:"Courier New",monospace">xx = math_nint(xgrid)</span></div>
<div><span style="font-family:"Courier New",monospace">yy = math_nint(ygrid)</span></div>
<div><br>
</div>
<div><span style="font-family:"Courier New",monospace">*Get the value of the defined variable </span></div>
<div><span style="font-family:"Courier New",monospace">'q defval temp 'xx' 'yy</span></div>
<div><span style="font-family:"Courier New",monospace">val = subwrd(result,3)</span></div>
<div><span style="font-family:"Courier New",monospace">say 'The value at grid point ('xx','yy') is --> 'val</span></div>
<div><br>
</div>
<div><span style="font-family:"Courier New",monospace">'set defval temp 'xx' 'yy' 'obs_val</span></div>
<div><br>
</div>
<div><span style="font-family:"Courier New",monospace">endwhile</span></div>
<div><br>
</div>
<div><span style="font-family:"Courier New",monospace">rc = close("/home/weather/file.csv"<wbr>)</span></div>
<div><br>
</div>
<span style="font-family:"Courier New",monospace">'d temp'</span><br>
<p></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I have reviewed the man page for "set defval" (<a href="http://cola.gmu.edu/grads/gadoc/gradcomdsetdefval.html" class="m_2330845458605350843OWAAutoLink" id="m_2330845458605350843LPlnk669401" target="_blank">http://cola.gmu.edu/grads/<wbr>gadoc/gradcomdsetdefval.html</a>)
and it appears that my coding is correct but, I am not seeing the results that I was expecting, i.e. a change in the grid values where the ASOS stations are.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Best,</p>
<div id="m_2330845458605350843Signature">
<div id="m_2330845458605350843divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:Calibri,Arial,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div style="color:rgb(0,0,0);font-family:Tahoma;font-size:13px"><font face="Calibri,Arial,Helvetica,sans-serif"><font face="Calibri,Arial,Helvetica,sans-serif" size="2" color="#006FC9"><span style="font-size:12pt"><br>
</span></font></font></div>
<span style="font-size:12pt"></span>
<div style="color:rgb(0,0,0);font-family:Tahoma;font-size:13px"><font face="Calibri,Arial,Helvetica,sans-serif"><font face="Calibri,Arial,Helvetica,sans-serif" size="2" color="#006FC9"><span style="font-size:11pt"><b><span style="font-size:12pt">Aaron
D. Perry</span></b></span></font><font face="Calibri,Arial,Helvetica,sans-serif" size="2" color="#006FC9"><span style="font-size:12pt"><br>
</span></font><font face="Calibri,Arial,Helvetica,sans-serif" size="2" color="#006FC9"><span style="font-size:12pt">Class of 2016</span></font><font face="Calibri,Arial,Helvetica,sans-serif" size="2" color="#006FC9"><span style="font-size:12pt"><br>
</span></font><font face="Calibri,Arial,Helvetica,sans-serif" size="2" color="#006FC9"><span style="font-size:12pt">Lyndon State College</span></font><font face="Calibri,Arial,Helvetica,sans-serif" size="2" color="#006FC9"><span style="font-size:12pt"><br>
Lyndonville, VT 05851</span></font></font></div>
<div style="color:rgb(0,0,0);font-family:Tahoma;font-size:13px"><font face="Calibri,Arial,Helvetica,sans-serif"><font size="2" color="#006FC9"><span style="font-size:12pt">Twitter: </span></font><font size="2"><span style="font-size:11pt"><a href="https://twitter.com/arnpry" id="m_2330845458605350843LPNoLP" target="_blank"><span style="font-size:12pt">@arnpry</span></a></span></font></font></div>
<div style="color:rgb(0,0,0);font-family:Tahoma;font-size:13px"><font face="Calibri,Arial,Helvetica,sans-serif"><font face="Calibri,Arial,Helvetica,sans-serif" size="2" color="#006FC9"><span style="font-size:12pt">Email: </span></font><a href="http://Aaron.Perry@lyndonstate.edu/" id="m_2330845458605350843LPNoLP" target="_blank"><font face="Calibri,Arial,Helvetica,sans-serif" size="2"><span style="font-size:12pt">Aaron.Perry@<wbr>lyndonstate.edu</span></font></a></font></div>
</div>
</div>
</div>
</div>
<br>______________________________<wbr>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/<wbr>listinfo/gradsusr</a><br>
<br></blockquote></div><br></div>
<br>
<pre style="white-space:pre-wrap;color:rgb(34,34,34);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New";background-color:rgb(255,255,255)">******************************<wbr>*********************</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New";background-color:rgb(255,255,255)">The information contained in this e-mail message </pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New";background-color:rgb(255,255,255)">is intended only for the use of the recipient(s) </pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New";background-color:rgb(255,255,255)">named above and may contain information that is </pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New";background-color:rgb(255,255,255)">privileged, confidential, and/or proprietary. </pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New";background-color:rgb(255,255,255)">If you are not the intended recipient, you may not</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New";background-color:rgb(255,255,255)">review, copy or distribute this message. If you have</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New";background-color:rgb(255,255,255)">received this communication in error, please notify </pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New";background-color:rgb(255,255,255)">the sender immediately by e-mail, and delete the original message.</pre><pre style="white-space:pre-wrap;color:rgb(34,34,34);margin:0in 0in 0.0001pt;font-size:10pt;font-family:"Courier New";background-color:rgb(255,255,255)">******************************<wbr>*********************</pre>