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

When averaging over time dimension, weight by number of days per month #3

Open
mnlevy1981 opened this issue Nov 30, 2018 · 0 comments

Comments

@mnlevy1981
Copy link
Contributor

Plotting climatologies now produces annual and seasonal means. Currently, each month is weighted evenly:

# set up time dimension for averaging
time_dims = dict()
time_dims['ANN'] = range(0,12)
time_dims['DJF'] = [11, 0, 1]
time_dims['MAM'] = range(2,5)
time_dims['JJA'] = range(5,8)
time_dims['SON'] = range(8,11)
field = ds[var_name].sel(**indexer).isel(time=time_dims[time_period]).mean('time')

These are fine as a placeholder, but I assume the CESM diagnostics package weights by days per month in which case we should do so as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant