<html><head><style type=text/css><!--
.email-body P { margin-top: 0px; margin-bottom: 0px; }
--></style></head><body><div><span style="font-family: "Courier New", monospace; font-size: 10pt;">set defval command wants I and J, not LON and LAT</span></div><div><span style="font-family: "Courier New", monospace; font-size: 10pt;">... just this ...</span></div><div><span style="font-family: "Courier New", monospace; font-size: 10pt;">Bye</span></div><div><span style="font-family: "Courier New", monospace; font-size: 10pt;">Davide<br></span></div><br><br><div><strong>
From:
</strong>
"Perry, Aaron" <Aaron.Perry@lsc.vsc.edu>
<br>
<strong>
To:
</strong>
GrADS Usr <gradsusr@gradsusr.org>
<br>
<strong>
Sent:
</strong>
19/10/2018 4:17 PM
<br>
<strong>
Subject:
</strong>
[gradsusr] Manually Editing Grid Cell Using CSV
<br><br><blockquote class="mcnt mori" style="margin:0 0 0 .8ex;border-left:1px solid #CCC;padding-left:1ex;"><div class="email-body">
<div id="mcntdivtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;">
<p style="margin-top:0;margin-bottom:0">Hello All,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I am trying to manually edit specific grid cells using values from a CSV file.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I have written a function to try to accomplish this but, I am having some troubles actually changing the grid cell values.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">The variable that I am trying to edit has been defined as "temp"...</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">i.e. 'define temp = TMAX2m.1'</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"><b>CSV File Sample:</b></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"></p>
<div>82.9 31.04250 -86.31167</div>
<div>69.0 30.21889 -96.37417</div>
<div>50.0 41.00928 -74.73628</div>
<div>62.0 36.61056 -83.73722</div>
<div>66.9 34.28028 -87.60028</div>
<p></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"><b>GrADS Function:</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; font-size: 10pt;">istat = 0</span></div>
<div><br>
</div>
<div><span style="font-family: "Courier New", monospace; font-size: 10pt;">while (istat != 2)</span></div>
<div><br>
</div>
<div><span style="font-family: "Courier New", monospace; font-size: 10pt;">data = read("/home/weather/values")</span></div>
<div><span style="font-family: "Courier New", monospace; font-size: 10pt;">istat = sublin(data,1)</span></div>
<div><br>
</div>
<div><span style="font-family: "Courier New", monospace; font-size: 10pt;">if (istat = 2)</span></div>
<div><span style="font-family: "Courier New", monospace; font-size: 10pt;">break</span></div>
<div><br>
</div>
<div><span style="font-family: "Courier New", monospace; font-size: 10pt;">endif</span></div>
<div><br>
</div>
<div><span style="font-family: "Courier New", monospace; font-size: 10pt;">linez = sublin(data,2)</span></div>
<div><br>
</div>
<div><span style="font-family: "Courier New", monospace; font-size: 10pt;">newval = subwrd(linez,1)</span></div>
<div><span style="font-family: "Courier New", monospace; font-size: 10pt;">lat = subwrd(linez,2)</span></div>
<div><span style="font-family: "Courier New", monospace; font-size: 10pt;">lon = subwrd(linez,3)</span></div>
<div><br>
</div>
<div><span style="font-family: "Courier New", monospace; font-size: 10pt;">'q defval temp 'lon' 'lat</span></div>
<div><span style="font-family: "Courier New", monospace; font-size: 10pt;">oldval = subwrd(result,2)</span></div>
<div><span style="font-family: "Courier New", monospace; font-size: 10pt;">say 'Old: ('lat','lon') :'oldval</span></div>
<div><br>
</div>
<div><span style="font-family: "Courier New", monospace; font-size: 10pt;">'set defval temp 'lon' 'lat' 'newval</span></div>
<div><span style="font-family: "Courier New", monospace; font-size: 10pt;">say 'New: ('lat','lon') :'newval</span></div>
<div><br>
</div>
<div><span style="font-family: "Courier New", monospace; font-size: 10pt;">endwhile</span></div>
<div><br>
</div>
<div><span style="font-family: "Courier New", monospace; font-size: 10pt;">rc = close("/home/weather/values")</span></div>
<br>
<p></p>
<p style="margin-top:0;margin-bottom:0">What am I doing wrong?</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<div id="mcntSignature">
<div id="mcntdivtagdefaultwrapper" 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 size="2" face="Calibri,Arial,Helvetica,sans-serif" 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 style="" size="2" face="Calibri,Arial,Helvetica,sans-serif" color="#006FC9"><span style="font-size:11pt"><b><span style="font-size:12pt">Aaron
Perry</span></b></span></font><font size="2" face="Calibri,Arial,Helvetica,sans-serif" color="#006FC9"><span style="font-size:12pt"><br>
</span></font><font size="2" face="Calibri,Arial,Helvetica,sans-serif" color="#006FC9"><span style="font-size:12pt">Class of 2016</span></font><font size="2" face="Calibri,Arial,Helvetica,sans-serif" color="#006FC9"><span style="font-size:12pt"><br>
</span></font><font size="2" face="Calibri,Arial,Helvetica,sans-serif" color="#006FC9"><span style="font-size:12pt">Lyndon State College</span></font><font size="2" face="Calibri,Arial,Helvetica,sans-serif" 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:
<a href="https://twitter.com/AaronPerryWx" class="mcntOWAAutoLink" id="mcntLPNoLP" target="_blank">@AaronPerryWx</a></span></font><font size="2"><span style="font-size:11pt"><span style="font-size:12pt"><a href="https://twitter.com/arnpry" target="_blank" id="mcntLPNoLP"></a><a href="https://twitter.com/AaronPerryWx" class="mcntOWAAutoLink" id="mcntLPNoLP" target="_blank"></a></span></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" face="Calibri,Arial,Helvetica,sans-serif" color="#006FC9"><span style="font-size:12pt">Email: </span></font><a href="http://Aaron.Perry@lyndonstate.edu/" target="_blank" id="mcntLPNoLP"><font size="2" face="Calibri,Arial,Helvetica,sans-serif"><span style="font-size:12pt">Aaron.Perry@lyndonstate.edu</span></font></a></font></div>
</div>
</div>
</div>
</div><br><br>_______________________________________________
<br>gradsusr mailing list
<br>gradsusr@gradsusr.org
<br>http://gradsusr.org/mailman/listinfo/gradsusr
<br></blockquote></div></body></html>