# [ncl-talk] Computing winds in an annulus

Alan Brammer abrammer at albany.edu
Tue Jan 30 12:40:07 MST 2018

```to follow up with an important detail here.

Average:
(a) 0-6    and multiply by the area
(b) 0-4,   and multiply by the area
(c) subtract: (a) -(b)  then divide by ( area a - area b )
e.g. ignoring the fact that the earth is a sphere

outer =  dim_avg_n( masked0_6_array, (/0,1/) ) * (pi*6^2)      ; some array
where we've already masked the data we want, or subset the area we want
inner =  dim_avg_n( masked0_4_array, (/0,1/) ) * (pi*4^2)
annulus = ( outer - inner  ) /  (  (pi*6^2) - (pi*4^2) )

You can cancel all the pi's above for simplicity if desired. .

==============================

To do this with circles rather than squares however you could also use the
layout from the Katrina circle script on the below page and add an extra
gc_inout() to mask the inner 0 to x km circle.
Then you don't need to worry about areas so much.  (Should probably still
weight by the latitude though)
https://www.ncl.ucar.edu/Applications/latlon_subset.shtml

On Mon, Jan 29, 2018 at 10:31 PM, Dennis Shea via ncl-talk <
ncl-talk at ucar.edu> wrote:

> Average:
> (a) 0-6
> (b) 0-4,
> (c) subtract: (a)-(b)
>
> On Mon, Jan 29, 2018 at 11:23 AM, Prashanth Bhalachandran via ncl-talk <
> ncl-talk at ucar.edu> wrote:
>
>> Dear NCL’ers,
>>
>> I have a question regarding the computation of winds in an annulus.
>>
>>
>>
>> That is, say I have a center lat and lon : cenlat, cenlon
>>
>> limit    = 2 ; In degrees
>>
>>   b1 = cenlat-limit
>>
>>   b2 = cenlat+limit
>>
>>   b3 = cenlon-limit
>>
>>   b4 = cenlon+limit
>>
>>
>>
>> This is what I use if want to average the winds in a box that *is 2
>> degrees on either side of the center* (4 degree x 4degree n total).
>>
>> uav = dim_avg_n(dim_avg_n(uu(tcount,:,{b1:b2},{b3:b4}),2),1)
>>
>>
>>
>> However, what I am now interested in is averaging around an *annulus*
>> (say between 4 degrees to 6 degrees from the center of the hurricane). What
>> is the best way to do that?
>>
>>
>>
>> Thank you,
>>
>> Prashanth
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180130/08d9cabe/attachment.html>
```