2nd try : Nearest defined neighbor function

Pablo Romero romero619 at HOTMAIL.COM
Tue Jan 6 11:47:16 EST 2009


check out the const function in the grads documentation.
it allows you to set a specific value/set of values to a constant value, i.e., in your case, set all undefined values to zero.
'd const(htsgwsfc,0,-u)'
 
'htsgwsfc' is ocean wave height.
this would plot the variable 'htsgwsfc', and set all areas where 'htsgwsfc' to zero, near the coast or overland.Note that this fades the value to zero near the coast, so its not extremely accurate, since the values near the coast might actually be higher than shown when using the const function. Example: an area near the coast where the closest-defined value is '3'; the "nearest neighbor" value should also be '3', but the const function fades to zero near the coast, so the value might be plotted as '1', '2', or near '0' instead
 
hope this helps...
> Date: Tue, 6 Jan 2009 14:39:09 +0100> From: preuter at LABRI.FR> Subject: 2nd try : Nearest defined neighbor function> To: GRADSUSR at LIST.CINECA.IT> > Sorry for multiples, message was somehow rejected ..> > Dear all,> > I have a variable which is only defined over the sea, elsewhere there> are undefined values. Is there a function in Grads that can draw me a> map where at locations of undefined values, instead of leaving it> blank, draws me the value of the nearest defined value of the> 8-neighborhood ? I know about the existence of 'smth9', but it does> not exactly what I want, since it smoothes out, and 'const', since you> have to specify a default value which I don't know since it should to> be determined from the nearest neighbor !> > Can anybody help?> > Thanks in advance> > Patrick
_________________________________________________________________
It’s the same Hotmail®. If by “same” you mean up to 70% faster.
http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_broad1_122008
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20090106/15430648/attachment.html 


More information about the gradsusr mailing list