Add temporal bounds and center times for group_average() API#717
Add temporal bounds and center times for group_average() API#717tomvothecoder wants to merge 3 commits intomainfrom
group_average() API#717Conversation
12afd27 to
3bf227c
Compare
|
@pochedls and @oliviermarti this PR should address this GH issue (same as this comment from @oliviermarti). If you can check this branch out and try it that'd be great. import numpy as np
import pandas as pd
import xcdat as xc
# Create a dummy xarray dataset
time = pd.date_range("2000-01-01", "2001-12-31", freq="D")
data = np.random.rand(len(time))
dummy_ds = xr.Dataset({"dummy_var": (["time"], data)}, coords={"time": time})
dummy_ds["time"].encoding["calendar"] = "standard"
dummy_ds = dummy_ds.bounds.add_missing_bounds(axes=["T"])
ds_avg = dummy_ds.temporal.group_average("dummy_var", freq="month")Before -- no
|
|
@tomvothecoder – this is great – thanks for pushing this forward so quickly. I think I think we'll need to collect the bounds for each group, (e.g., |
This makes sense to me. I'll think of an algorithm. |
Description
Checklist
If applicable: