-
Notifications
You must be signed in to change notification settings - Fork 12
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
[Feature]: Retain bounds and compute time point for group averaging operations #565
Comments
To be clear about what the bounds should be on the mean, consider a daily mean computed from four 6-hourly mean samples centered at 3Z, 9Z, 15Z, and 21Z. If the 6-hour means have bounds 0-6Z, 6-12Z, 12-18Z, and 18-24Z, then we want the daily mean to extend from the beginning of the interval represented by the first sample (i.e., from 0Z) to the end of the last sample (i.e., to 24Z, or 0Z of the next day). So for a daily mean for the first month of this year, the bounds would be 2024-01-01 0:00:00 and 2024-01-02 0:00:00, while the coordinate value would be 2024-01-01 12:00:00. |
Also, in the above example, one could simply average the four 6- hour time means because they were fully contained within a single day (and fully covered all the hours of the day). If the 6-hourly time-mean samples were centered instead on 0Z, 6Z, 12Z, and 18Z, then to form a daily mean extending from 0-24Z, you would need to compute the mean as (.5x0 + x1 + x2 + x3 + .5*x4)/4. That is each sample should be weighted by the time interval overlapping the daily time-interval of interest. |
@pochedls Can you update with edge cases from meeting. |
In my comment on @tomvothecoder's PR, I said I thought we could take the upper and lower bound for each group. Say you wanted a JJA average and the bounds for each month were at the start and the end of the month (e.g., June had bounds of
Then you would simply take the June lower bound ( This won't work if each month's bounds do not line up with the group averaging frequency. For example, if you had pentad data of 5-day intervals:
In this case, pentad An algorithm to do this is not immediately obvious to me. |
When you compute the monthly (or seasonal) mean from data representing 5-day means, you would need to:
|
Although @taylor13's comment is seemingly off-topic (this issue is on generating bounds), he is probably right that the averaging functionality may need to be refactored as a related issue. I think @taylor13's points are documented in this issue. |
Is your feature request related to a problem?
Time bounds are dropped when computing group averages and the time point is set to the beginning of the averaging period.
Note that time values exist in the initial dataset:
But the bounds disappear for the group average values:
And the time point for each group average is at the beginning of the period:
Describe the solution you'd like
Ideally we could return
time_bnds
with group averaging calculations. I think the returned bounds could be the lower most and upper most bound for the averaged data.The returned time points could then be the mean of these returned time bounds, which would be more representative than a time point in the beginning of the averaged period.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: