polygon area avg?

Arindam Chakraborty arindam at MET.FSU.EDU
Wed Apr 23 16:14:34 EDT 2008


hi Greg,
please see the attached function that calculates area average over a
quadrilateral of any shape. It uses the same strategy Dr. Hart has
suggested. I did use this function sometime ago and probably the results
were reasonable. As far as I remember, the value lon1 should be <= lon2,
lon2<=lon3, lon4<=lon3, lon1<=lon4 (and similar rules apply for the
latitude points). The points (1,2,3,4) has to be arranged in
anti-clockwise direction (see the illustration inside the file). For
example, for Nevada:

...
lon1=240; lat1=42;
lon2=240; lat2=39;
lon3=246; lat3=34.5;
lon4=246; lat4=42;

'set lev 850'
res = saave(lon1,lat1,lon2,lat2,lon3,lat3,lon4,lat4,u,1)
* u is the variable name
say 'Area average = 'res

You can set box=1 (last argument) and set 'gxout grfill' to see which
all grids are considered for averaging.
Note that, for a rectangular area you may not get same result as of
aave() because unlike in aave(), this function does not take into
account fraction of grids for averaging.
Note again that, this function is just to avoid creating a data set of
1's and 0's to mask out. The basic idea of averaging remains the same
although.

Hope this helps.

arindam

Robert Hart wrote:
> Greg,
>
> How about masking out the area outside the polygon, and then taking the
> aave() of the entire domain?
>
> I believe aave would ignore undefined gridpoints.
>
> Bob
>
> ----- Original Message -----
> From: Greg West <greg.west at UTAH.EDU>
> Date: Wednesday, April 23, 2008 1:22 pm
> Subject: polygon area avg?
> To: GRADSUSR at LIST.CINECA.IT
>
>
>> Grads users,
>>
>> Has anyone come up with a way to take an area avg of the area
>> within a
>> non-rectangle shape? The shape I'm looking for in this case resembles
>> the shape of Nevada. If not I can probably approximate the shape by
>> averaging a bunch of smaller rectangles.
>>
>> Thanks in advance,
>> Greg
>>
>> --
>> ******************************************************
>> Gregory West
>> Graduate Research Assistant
>> University of Utah - Dept of Meteorology
>> Office: INSCC 480-10
>> 135 S 1460 E WBB Rm. 819
>> Salt Lake City, UT 84112-0110
>> 801-585-1410
>> greg.west at utah.edu
>> ******************************************************
>>
>>

--
----------------------------
 ARINDAM CHAKRABORTY
 Department of Meteorology
 Florida State University
 Tallahassee, FL-32306, USA
 Tel: 850-644-3524 (O)
      850-524-0717 (C)
 Fax: 850-644-9642
____________________________

-------------- next part --------------
A non-text attachment was scrubbed...
Name: saave.gsf
Type: application/x-font-type1
Size: 1627 bytes
Desc: not available
Url : http://gradsusr.org/pipermail/gradsusr/attachments/20080423/bd363491/attachment.bin 


More information about the gradsusr mailing list