An array containing the latitude weighted data with same dimensions as
parameter 'data'.
Arguments
data
A numeric array with named dimensions, representing the data to be
applied the weights. It should have at least the latitude dimension and it
can have more other dimensions.
lat
A numeric vector or array with one dimension containing the
latitudes (in degrees).
lat_dim
A character string indicating the name of the latitudinal
dimension. The default value is 'lat'.
method
A character string indicating the type of weighting applied:
'cos' (cosine of the latitude) or 'sqrtcos' (square-root of the
cosine of the latitude). The default value is 'cos'.
ncores
An integer indicating the number of cores to use for parallel
computation. The default value is NULL.