...
This function computes the average value of each a field . Each grid point value is weighted by the cosine of its latitude :
...
in a fieldset over an area. The computations are based on the assumption that all the cells have the same extent in latitude and the individual cell areas can be approximated with
Mathdisplay |
---|
A_{i} = R^{2} cos\phi_{i} \Delta\lambda_{i} cos(\Delta\phi) |
where:
R
is the radius of the Earthφ
i is the latitude of the i-th grid cell
is the size of the grid cells in latitude (constant)Δ
φΔλ
i is the size of the i-th grid cell in longitude.
Using this the average of filed f
over an area can be written as:
Mathdisplay |
---|
average = \frac {$\sum_{i}f_{i} A_{i}$}{\sum_{i}A_{i}} = \frac {\sum_{i}f_{i}cos\phi_{i}\Delta\lambda_{i}}{\sum_{i}cos\phi_{i}} |
If the input fieldset contains only one field, a number is returned. If there is more than one field, a list of numbers is returned. Missing values in the input fieldset are bypassed in this calculation. For each field for which there are no valid values, nil
is returned.
- If the fieldset is the only argument, the integration is done on all grid points.
- If a list is the second argument, it must contain four numbers which are respectively the north, west, south and east boundaries of an area. The integration is done on the grid points contained inside this area :
...