I'm loading an annual dataset with xarray. I'd like to create 35-year means of the data (not a rolling average, just chunked into 35 year means). Right now I do the following:
filename = '/glade/scratch/mberdahl/127kaH11/MOC/MOC_only_127kaH11_AnnMeans.nc' # read 127ka H11 run, 1-1749 years only
ds = xr.open_dataset(filename)
ds
Which shows
Dimensions:
d2: 2lat_aux_grid: 395 moc_comp: 3 moc_z: 61 time: 1750 transport_reg: 2
With 1750 annual time entries, I should be able to calculate 50 means, each accounting for 35 years of time. However, when I do the following:
MOC_35yr = ds.resample(time="35A").mean()
MOC_35yr
I get 51 times:
Dimensions:
lat_aux_grid: 395 moc_z: 61 time: 51
As a sanity check, I've also calculated the 35 year means with nco commands, and the results are identical to the xarray.resample.mean method for only the 0th time entry. After that the results are different.
Can anyone see what I'm doing wrong?
Thanks, Mira