Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This function computes the average value of each a field . Each grid point value is weighted by the cosine of its latitude :

Image Removed

...

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 :

...