<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000'>Hi,<div>agreed, with exception that it should be:</div><div>size=sizeA1+sizeA2+sizeA3</div><div><br></div><div>since that A1, A2 and A3 are the weights.</div><div>Regards,</div><div>Ricardo<br><br><hr id="zwchr"><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>De: </b>"Bonan Antonino" <abonan@arpa.veneto.it><br><b>Para: </b>"GrADS Users Forum" <gradsusr@gradsusr.org><br><b>Enviadas: </b>Quinta-feira, 19 de Setembro de 2013 5:52:40<br><b>Assunto: </b>Re: [gradsusr] Averaging over multiple dimension ranges<br><br>
<style></style>
<div><font size="2" face="Arial">Maybe the correct formula is</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial"><font size="3" face="Times New Roman">total average =
((averageA1*sizeA1)+(averageA2*sizeA2)+(averageA3*sizeA3))/(3*size)</font><br></font></div>
<div><font size="2" face="Arial">where</font></div>
<div><font size="2" face="Arial"></font> </div>
<div><font size="2" face="Arial">size = <font size="3" face="Times New Roman">sizeA2 +
sizeA2 + sizeA2</font></font></div>
<div><font size="2" face="Arial"><font size="3" face="Times New Roman"></font></font> </div>
<div><font size="2" face="Arial"><font size="3" face="Times New Roman">?</font></font></div>
<div><font size="2" face="Arial"></font><br>Dr. Antonino Claudio Bonan<br>-----
Original Message ----- </div>
<blockquote style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<div style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><b>From:</b>
<a title="ivtoman@inet.hr" href="mailto:ivtoman@inet.hr" target="_blank">Ivan Toman</a> </div>
<div style="FONT: 10pt arial"><b>To:</b> <a title="gradsusr@gradsusr.org" href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a> </div>
<div style="FONT: 10pt arial"><b>Sent:</b> Tuesday, September 17, 2013 9:04
PM</div>
<div style="FONT: 10pt arial"><b>Subject:</b> Re: [gradsusr] Averaging over
multiple dimension ranges</div>
<div><br></div>
<div class="moz-cite-prefix">Hello,<br><br>Jeff's idea was to find area sizes
with atot function (or asum like I tried). When I know area sizes, I can
weight them in total average from three rectangular areas:<br><br>total
average =
((averageA1*sizeA1)+(averageA2*sizeA2)+(averageA3*sizeA3))/3<br><br>It looks
to me that logic is valid.<br><br>Ivan<br><br><br><br>On 09/17/2013 08:43 PM,
Kishore Ragi wrote:<br></div>
<blockquote cite="mid:CAN4rXbQ+dK4QGavgaYLv88p5avPRrABBMB8xvTwvLj0aMdxViA@mail.gmail.com">
<div dir="ltr">Ivan,
<div><br></div>
<div>How can you find the area average with asum? If you can do with asum,
the same is with aave()/ave() ... </div>
<div><br></div>
<div>Anyway, I don't understand what you wanted to
calculate. <br></div>
<div><br></div>
<div>Regards,</div>
<div><br></div>
<div>Kishore</div>
<div><br></div>
<div><br></div></div>
<div class="gmail_extra"><br><br>
<div class="gmail_quote">On Tue, Sep 17, 2013 at 11:59 PM, Ivan Toman <span dir="ltr"><<a href="mailto:ivtoman@inet.hr" target="_blank">ivtoman@inet.hr</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div>
<div>Jeff,<br><br>Option (2) seems to be a logical approach and very nice
idea. It looks to me that asum() also works OK for "measuring" area sizes,
it is probably accurate enough.<br><br>Best regards,<br>Ivan
<div>
<div class="h5"><br><br><br>On 09/17/2013 06:57 PM, Jeff Duda
wrote:<br></div></div></div>
<div>
<div class="h5">
<blockquote>
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>You could either...<br><br></div>(1) Knowing the geometry of earth,
set up a math problem and solve for the areas of a sphere bounded by
such latitudinal/longitudinal coordinates to find the areas of those
three regions (I would use spherical
coordinates)<br><br></div>OR<br><br></div>(2) -Create a flat field of
ones (e.g., 'define ones =
tmp2m/tmp2m')<br></div> -Use the atot function
(grads 2.0.2+ only) to compute the sum of the ones field over your area,
which I think should give you the area of each region<br><br>Then weight
each areal average by the area and compute the final weighted
average.<br><br></div>I've never tried this, so I'm not 100% sure it
will work and be accurate. I would play around with the atot
function first to see if it really does give you the areas of the
regions.<br>
<div><br>Jeff Duda<br></div></div>
<div class="gmail_extra"><br><br>
<div class="gmail_quote">On Tue, Sep 17, 2013 at 11:45 AM, Ivan Toman
<span dir="ltr"><<a href="mailto:ivtoman@inet.hr" target="_blank">ivtoman@inet.hr</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Hello,<br><br>If I want to find average value over a
lat/lon range, I would
do:<br><br>ave(variable,lat=20,lat=21),lon=70,lon=71)<br><br><br>However,
if I want to do average over multiple areas, for example:<br><br>Area
1: lat=20,lat=21 ; lon=60,lon=61<br>Area 2: lat=30,lat=31 ;
lon=70,lon=71<br>Area 3: lat=40,lat=41 ; lon=80,lon=81<br><br>how can
I solve this problem? I can't simply find three area averages,<br>sum
them together and divide by three, because areas are not the same
sizes.<br><br>Thanks for any hint.<br><br>Regards,<br>Ivan
Toman<br>_______________________________________________<br>gradsusr
mailing list<br><a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br><a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br></blockquote></div><br><br clear="all"><br>-- <br>Jeff Duda<br>Graduate research
assistant<br>University of Oklahoma School of Meteorology<br>Center for
Analysis and Prediction of Storms<br></div><br>
<fieldset></fieldset> <br><pre>_______________________________________________
gradsusr mailing list
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a>
</pre></blockquote><br></div></div></div><br>_______________________________________________<br>gradsusr
mailing list<br><a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br><a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br><br></blockquote></div><br></div><br>
<fieldset class="mimeAttachmentHeader"></fieldset> <br><pre>_______________________________________________
gradsusr mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a>
<a class="moz-txt-link-freetext" href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a>
</pre></blockquote><br>
<p>
</p><hr>
<p></p>_______________________________________________<br>gradsusr mailing
list<br>gradsusr@gradsusr.org<br>http://gradsusr.org/mailman/listinfo/gradsusr<br></blockquote>
<br>_______________________________________________<br>gradsusr mailing list<br>gradsusr@gradsusr.org<br>http://gradsusr.org/mailman/listinfo/gradsusr<br></blockquote><br></div></div></body></html>