<br><font size=2 face="sans-serif">Patrick,</font><br><font size=2 face="sans-serif">What if an undefined point has more
than one "nearest neighbor" and are of different values? Do
you want to assign an average of these, the highest, lowest, etc.? I'm
assuming each gridpoint has up to eight nearest neighbors in complex coastal
areas. For example, you could get the max nearest neighbor using
something like this:</font><br><br><font size=2 face="sans-serif">'define newvar= max(max(var,x=-152,x=-150),y=262,y=264)'</font><br><br><font size=2 face="sans-serif">Then assign result to point (in this
case, x=-151, y=263) using the 'set defval var...' command.</font><br><br><font size=2 face="sans-serif">Similarly, you could use 'define var=
min(min...' to get min value of nearest 8-neighbor or the "aave"
command to get average of nearest neighbor.</font><br><br><font size=2 face="sans-serif">Hope this helps....</font><br><font size=2 face="sans-serif">Stephen McMillan</font><br><br><br><br><table width=100%><tr valign=top><td width=40%><font size=1 face="sans-serif"><b>Patrick Reuter <preuter@LABRI.FR></b></font><br><font size=1 face="sans-serif">Sent by: GRADSUSR@LIST.CINECA.IT</font><p><font size=1 face="sans-serif">01/06/2009 07:39 AM</font><table border><tr valign=top><td bgcolor=white><div align=center><font size=1 face="sans-serif">Please respond to<br>GRADSUSR@LIST.CINECA.IT</font></div></table><br><td width=59%><table width=100%><tr valign=top><td><div align=right><font size=1 face="sans-serif">To</font></div><td><font size=1 face="sans-serif">GRADSUSR@LIST.CINECA.IT</font><tr valign=top><td><div align=right><font size=1 face="sans-serif">cc</font></div><td><tr valign=top><td><div align=right><font size=1 face="sans-serif">Subject</font></div><td><font size=1 face="sans-serif">2nd try : Nearest defined neighbor function</font></table><br><table><tr valign=top><td><td></table><br></table><br><br><tt><font size=2>Sorry for multiples, message was somehow rejected
..<br></font></tt><br><tt><font size=2>Dear all,<br></font></tt><br><tt><font size=2>I have a variable which is only defined over the sea,
elsewhere there<br>are undefined values. Is there a function in Grads that can draw me a<br>map where at locations of undefined values, instead of leaving it<br>blank, draws me the value of the nearest defined value of the<br>8-neighborhood ? I know about the existence of 'smth9', but it does<br>not exactly what I want, since it smoothes out, and 'const', since you<br>have to specify a default value which I don't know since it should to<br>be determined from the nearest neighbor !<br></font></tt><br><tt><font size=2>Can anybody help?<br></font></tt><br><tt><font size=2>Thanks in advance<br></font></tt><br><tt><font size=2>Patrick</font></tt><br><br><BR>
<BR>
***************************************************<BR>
The information contained in this e-mail message is intended only for the use of the recipient(s) named above and may contain information that is privileged, confidential, and/or proprietary. If you are not the intended recipient, you may not review, copy or distribute this message. If you have received this communication in error, please notify the sender immediately by e-mail, and delete the original message.<BR>
***************************************************<BR>