Bill,
Thank you for your post! Please find below a description of what I am doing, with illustrations (corresponding to the letters) in the attached file. I took a rough resolution so it is easier to see.
A. I have a vector field of wind velocity, whose components in U(lon) and V(lat) directions are given on a regular (angular-) grid of points.
B. This field is given every 6 hours over a year. I am interested in the yearly average flow at each location per direction and per sense, so I separate positive and negative components, and generate yearly average components per sense: U+, U-, V+, V-, that are somehow 4 scalar fields, but that can be seen as well as 4 vector fields of components along Lon, Lat +/-axes.
C. I want to compute flows between cells of a multi-scale grid, that doesn�??t match �?? for obvious reasons - the aforementioned locations. I have to determine average orthogonal wind speed along each edge, to be in an Arakawa C-type situation to some extent.
D. So my first idea, and this is what is implemented at this point, was to interpolate each component and to obtain �??averages per edge�?�. I am using Kriging for the interpolation (because is make sense to me to converge towards a mean value when we are far from locations were the wind field is given)..
E. If I want the output flow for a grid cell, I need to know average values of: U+ for the Eastern edge, U- for the Western edge, V+ for the Northern edge, and V- for the Southern edge. I don�??t know how to obtain an average value along an edge, so I thought that it makes sense to create a rectangular buffer around each edge (here the widths have been exaggerated) and to perform a zonal stat of each component on each corresponding edge.
F. To avoid overlaps that would be problematic when converting buffers to a raster for the zonal stat, I actually do it in two steps: one with horizontal rectangular buffers and one with vertical rectangular buffers.
I think that I cannot use Green�??s theorem or the divergence theorem for this purpose (am I right?), because my surfaces are indeed in the z direction (orthogonal to U+,U-,V+,V-) and I assume the wind speed profile to be constant over each step of my z-discretization (sigma surfaces). I was really excited by your idea however, because it could be very relevant for computing flows in the z direction, through cells bottoms and tops.
I have no experience with focal statistics. To some extent it seems that I am somehow emulating it by creating buffers and performing a zonal statistics, but I don�??t know at this point how to perform a focal statistics around objects of different lengths (the edges) in one or two operations. Is it obvious for you that I should use a focal statistics?
Thank you again for your post and for the discussion!
Cedric