<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Thank you for that clarification Davide!</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I am assuming that "i" and "j" are referring to X and Y? In that case, I should be using w2gr() (world coordinates to grid coordinates), right?</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<div id="Signature">
<div id="divtagdefaultwrapper" 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" style=""><span style="font-size:11pt"><b><span style="font-size:12pt">Aaron
 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:
<a href="https://twitter.com/AaronPerryWx" class="OWAAutoLink" id="LPNoLP">@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="LPNoLP"></a><a href="https://twitter.com/AaronPerryWx" class="OWAAutoLink" id="LPNoLP"></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 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/" target="_blank" id="LPNoLP"><font face="Calibri,Arial,Helvetica,sans-serif" size="2"><span style="font-size:12pt">Aaron.Perry@lyndonstate.edu</span></font></a></font></div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> gradsusr <gradsusr-bounces@gradsusr.org> on behalf of Davide Sacchetti <davide.sacchetti@arpal.gov.it><br>
<b>Sent:</b> Monday, October 22, 2018 3:54:32 AM<br>
<b>To:</b> GrADS Users Forum<br>
<b>Subject:</b> Re: [gradsusr] Manually Editing Grid Cell Using CSV</font>
<div> </div>
</div>
<meta content="text/html; charset=utf-8">
<style type="text/css">
<!--
.x_email-body p
        {margin-top:0px;
        margin-bottom:0px}
-->
</style>
<div><font color="red"><b>This message is from an external sender. Please be careful when clicking on links and attachments.
</b></font><br>
<br>
<div>
<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="x_mcnt x_mori" style="margin:0 0 0 .8ex; border-left:1px solid #CCC; padding-left:1ex">
<div class="x_email-body">
<div id="x_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="x_mcntSignature">
<div id="x_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 size="2" face="Calibri,Arial,Helvetica,sans-serif" color="#006FC9" style=""><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="x_mcntOWAAutoLink" id="x_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="x_mcntLPNoLP"></a><a href="https://twitter.com/AaronPerryWx" class="x_mcntOWAAutoLink" id="x_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="x_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>
</div>
</div>
</body>
</html>