On Sat, Feb 25, 2012 at 12:05 AM, Rodrigo de Souza Barreto Mathias <span dir="ltr"><<a href="mailto:rodrigowind@yahoo.com.br">rodrigowind@yahoo.com.br</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="color:#000;background-color:#fff;font-family:times new roman,new york,times,serif;font-size:12pt"><div><div>Good morning!</div><div>I wanna calculate a meteorological field in a circular area with radius R starting at a point (lat, lon). For example: average temperature in a circular area with 200 km of radius from a point 20N/020W. I don't know a specific function in Grads to do what I want. Could you help me with some function or a script using a mask?</div>
<div><br></div></div></div></div></blockquote><div><br></div><div>The attached script computes a circular mask with distance R from a reference (lon,lat). For your point (20W,20N) and R=200 do this:</div><div><br></div><div>
ga-> circ_mask -20 20 200</div><div><br></div><div>This will define a variable called "mask" with "1' inside the circle, undef elsewhere. To get the average temperature inside the circle:</div><div><br>
</div><div>ga-> d aave(mask*temperature,global)</div><div><br></div><div> Good Luck,</div><div><br></div><div> Arlindo </div></div><div><br></div><div><br></div>-- <br>Arlindo da Silva<br><a href="mailto:dasilva@alum.mit.edu">dasilva@alum.mit.edu</a><br>