[gradsusr] Averaging over multiple dimension ranges

Jeff Duda jeffduda319 at gmail.com
Tue Sep 17 12:57:43 EDT 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130917/efd314e7/attachment-0003.html 


More information about the gradsusr mailing list