Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"area: mean where type1 over type2" question #149

Open
taylor13 opened this issue Mar 29, 2022 · 1 comment
Open

"area: mean where type1 over type2" question #149

taylor13 opened this issue Mar 29, 2022 · 1 comment
Labels
question Further information is requested or discussion invited

Comments

@taylor13
Copy link

taylor13 commented Mar 29, 2022

In the conventions document, the explanation of the phrase "mean where type1 over type2" is:

"A cell_methods attribute with a string of the form "mean where type1 over type2" indicates the 
mean is calculated by summing over the type1 portion of the cell and dividing by the area of the 
type2 portion. [...] If "over type2" is omitted, the mean is calculated by summing over the type1 
portion of the cell and dividing by the area of this portion."

I wonder if in the above, "summing" should be replaced by "integrating".

Consider, for example, computing the area mean from multiple grid cells. If the cells are of different size, then most commonly the mean would be computed as:

mean of f = sum-over-cells(f_i * A_i) / sum-over-cells(A_i)

where A_i is the area of each cell and f is the variable that we're averaging. The above represents an area-weighted mean of f.

Note that if the size of the cells goes to zero, this would be represented as

mean of f = integral(f*dA)/integral(dA)

So, I think "summing" should be replaced by "integrating" (or the section needs rewording to indicate that the sums are not simple sums, but area-weighted sums).

@taylor13 taylor13 added the question Further information is requested or discussion invited label Mar 29, 2022
@JonathanGregory
Copy link
Contributor

Yes, I agree that "integrating" is the intended meaning. This could be changed as a defect issue in the conventions repo. Thanks, Karl @taylor13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested or discussion invited
Projects
None yet
Development

No branches or pull requests

2 participants