[gradsusr] Averaging over multiple dimension ranges

Bonan Antonino abonan at arpa.veneto.it
Thu Sep 19 04:52:40 EDT 2013


Maybe the correct formula is

total average = ((averageA1*sizeA1)+(averageA2*sizeA2)+(averageA3*sizeA3))/(3*size)

where

size = sizeA2 + sizeA2 + sizeA2

?

Dr. Antonino Claudio Bonan
----- Original Message ----- 
  From: Ivan Toman 
  To: gradsusr at gradsusr.org 
  Sent: Tuesday, September 17, 2013 9:04 PM
  Subject: Re: [gradsusr] Averaging over multiple dimension ranges


  Hello,

  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:

  total average = ((averageA1*sizeA1)+(averageA2*sizeA2)+(averageA3*sizeA3))/3

  It looks to me that logic is valid.

  Ivan



  On 09/17/2013 08:43 PM, Kishore Ragi wrote:

    Ivan, 


    How can you find the area average with asum? If you can do with asum, the same is with aave()/ave() ... 


    Anyway, I don't understand what you wanted to calculate. 



    Regards,


    Kishore







    On Tue, Sep 17, 2013 at 11:59 PM, Ivan Toman <ivtoman at inet.hr> wrote:

      Jeff,

      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.

      Best regards,
      Ivan 



      On 09/17/2013 06:57 PM, Jeff Duda wrote:

        You could either...


        (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)


        OR


        (2) -Create a flat field of ones (e.g., 'define ones = tmp2m/tmp2m')

             -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

        Then weight each areal average by the area and compute the final weighted average.


        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.


        Jeff Duda




        On Tue, Sep 17, 2013 at 11:45 AM, Ivan Toman <ivtoman at inet.hr> wrote:

          Hello,

          If I want to find average value over a lat/lon range, I would do:

          ave(variable,lat=20,lat=21),lon=70,lon=71)


          However, if I want to do average over multiple areas, for example:

          Area 1: lat=20,lat=21 ; lon=60,lon=61
          Area 2: lat=30,lat=31 ; lon=70,lon=71
          Area 3: lat=40,lat=41 ; lon=80,lon=81

          how can I solve this problem? I can't simply find three area averages,
          sum them together and divide by three, because areas are not the same sizes.

          Thanks for any hint.

          Regards,
          Ivan Toman
          _______________________________________________
          gradsusr mailing list
          gradsusr at gradsusr.org
          http://gradsusr.org/mailman/listinfo/gradsusr




        -- 
        Jeff Duda
        Graduate research assistant
        University of Oklahoma School of Meteorology
        Center for Analysis and Prediction of Storms


         

_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr



      _______________________________________________
      gradsusr mailing list
      gradsusr at gradsusr.org
      http://gradsusr.org/mailman/listinfo/gradsusr





     

_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr




------------------------------------------------------------------------------


  _______________________________________________
  gradsusr mailing list
  gradsusr at gradsusr.org
  http://gradsusr.org/mailman/listinfo/gradsusr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130919/e9620511/attachment-0003.html 


More information about the gradsusr mailing list