New function WeightCells
Hi @nperez
I open this issue for the new function WeightCells() that we talked about a while ago. @erifarov will be in charge of creating this function but I'd like to confirm some details with you first to see if I understand everything correctly.
-
The function aims to apply weights to the spatial data, and the weights are calculated from latitude. So, the minimum requirements of the inputs are: (1)
data
has lat dimension (2)lat
should be a vector providing the latitude value (3)lat_dim
specifies the lat dim name. -
Is the weight formula
wt <- sqrt(cos(lat * pi/180))
(lat is degree)? This is what used in s2dv::ACC and mentioned in the ref* below. I see that in WeightedMean(), the weight is calculated bydlon * dlat * cosphi
(line133) I'm not quite sure about the physical meaning of these two methods. -
Is it suitable to have one argument
weights
to let users put in a prepared weight array?
*ref: https://www.ncl.ucar.edu/Document/Functions/Built-in/eofcov.shtml: "Most frequently, the square root of the cosine of the latitude is used to compute the area weight." wgt = sqrt(cos(lat))
(lat is radian)
Thanks in advance,
An-Chi