\name{AA}
\alias{AA}
\title{
Compute Area-Average of Longitude-Latitude Matix}
\description{
Compute the area-average of a 2D (longitude x latitude)
array, 'data', over the spatial domain described by the longitudes 
and latitudes. Only the information of the latitudes is required, as 
the weights for the field-mean (AA) are based on the cosine of the 
latitude at each gridpoint, i.e. all data in a latitudinal circle 
(all longitudes) have the same weight, cosine('lat').
}
\usage{
AA(data, lat, yes = NULL)
}
\arguments{
  \item{data}{
2-Dimensional array (longitude, latitude; in this order).
  }
  \item{lat}{
Vector containing the latitude coordinates.
  }
  \item{yea}{
Vector containing the position of non-NA values, i.e. 'good' values
(in a ns = nlon * nlat, GrADS format).
  }
}
\value{
Value of the area-average.
}
\examples{
AA(t(sampleMap[1, 1, 1, 1, , ]), sampleMap$lat)
}
\author{
History:\cr
0.1  -  2010-12  (J-García Serrano, \email{javier.garcia at bsc.es})  -  Original code\cr
0.2  -  2011-03  (V. Guemas, \email{virginie.guemas at bsc.es})  - Weight = 0 for NA grid point\cr
1.0  -  2015-03  (N. Manubens, \email{nicolau.manubens at bsc.es})  -  Formatting to R CRAN
}
\keyword{datagen}
