<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hello,<br>
      <br>
      you're correct, I typed in hurry.<br>
      <br>
      Regards all,<br>
      Ivan<br>
      <br>
      <br>
      On 09/19/2013 04:38 PM, Ricardo Hallak wrote:<br>
    </div>
    <blockquote
      cite="mid:1937657686.5167797.1379601517734.JavaMail.root@iag.usp.br"
      type="cite">
      <style type="text/css">p { margin: 0; }</style>
      <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" <a class="moz-txt-link-rfc2396E" href="mailto:abonan@arpa.veneto.it">&lt;abonan@arpa.veneto.it&gt;</a><br>
            <b>Para: </b>"GrADS Users Forum"
            <a class="moz-txt-link-rfc2396E" href="mailto:gradsusr@gradsusr.org">&lt;gradsusr@gradsusr.org&gt;</a><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 face="Arial" size="2">Maybe the correct formula
                is</font></div>
            <div>&nbsp;</div>
            <div><font face="Arial" size="2"><font face="Times New
                  Roman" size="3">total average =
                  ((averageA1*sizeA1)+(averageA2*sizeA2)+(averageA3*sizeA3))/(3*size)</font><br>
              </font></div>
            <div><font face="Arial" size="2">where</font></div>
            <div>&nbsp;</div>
            <div><font face="Arial" size="2">size = <font face="Times
                  New Roman" size="3">sizeA2 + sizeA2 + sizeA2</font></font></div>
            <div>&nbsp;</div>
            <div><font face="Arial" size="2"><font face="Times New
                  Roman" size="3">?</font></font></div>
            <div><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
                  moz-do-not-send="true" title="ivtoman@inet.hr"
                  href="mailto:ivtoman@inet.hr" target="_blank">Ivan
                  Toman</a> </div>
              <div style="FONT: 10pt arial"><b>To:</b> <a
                  moz-do-not-send="true" 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()
                    ...&nbsp;</div>
                  <div><br>
                  </div>
                  <div>Anyway, I don't understand what you wanted to
                    calculate.&nbsp;<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">&lt;<a
                        moz-do-not-send="true"
                        href="mailto:ivtoman@inet.hr" target="_blank">ivtoman@inet.hr</a>&gt;</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>
                                  &nbsp;&nbsp;&nbsp;&nbsp; -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.&nbsp; 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">&lt;<a
                                      moz-do-not-send="true"
                                      href="mailto:ivtoman@inet.hr"
                                      target="_blank">ivtoman@inet.hr</a>&gt;</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 moz-do-not-send="true"
                                      href="mailto:gradsusr@gradsusr.org"
                                      target="_blank">gradsusr@gradsusr.org</a><br>
                                    <a moz-do-not-send="true"
                                      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 moz-do-not-send="true" href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a>
<a moz-do-not-send="true" 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 moz-do-not-send="true"
                        href="mailto:gradsusr@gradsusr.org"
                        target="_blank">gradsusr@gradsusr.org</a><br>
                      <a moz-do-not-send="true"
                        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 moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a>
<a moz-do-not-send="true" 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> _______________________________________________<br>
              gradsusr mailing list<br>
              <a class="moz-txt-link-abbreviated" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
              <a class="moz-txt-link-freetext" href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
            </blockquote>
            <br>
            _______________________________________________<br>
            gradsusr mailing list<br>
            <a class="moz-txt-link-abbreviated" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
            <a class="moz-txt-link-freetext" href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
          </blockquote>
          <br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
gradsusr mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>
<a class="moz-txt-link-freetext" href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>