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

Error with masked and weighted average and no-leap data #102

Open
johanmeh opened this issue Oct 21, 2019 · 2 comments
Open

Error with masked and weighted average and no-leap data #102

johanmeh opened this issue Oct 21, 2019 · 2 comments

Comments

@johanmeh
Copy link

johanmeh commented Oct 21, 2019

Hi @annefou

I use the historical CESM2-WACCM. I slice the data so I only have ten years.
Using the masked and weighted average function on GitHub gives this error:

unsupported operand type(s) for *: 'cftime._cftime.DatetimeNoLeap' and 'float'

Maybe the function does not take no-leap time?

Skjermbilde 2019-10-21 kl  13 35 39
Skjermbilde 2019-10-21 kl  13 35 36

@johanmeh
Copy link
Author

@johanmeh
Copy link
Author

johanmeh commented Oct 21, 2019

Thanks to @daliagachc !

If anyone has problems with combining DatetimeNoLeap and xarray, you have to

  1. Go to negi-stuff/negi_stuff/modules
  2. zarray.py contains a function called check_transform_cftime_dim_2_timestamp which solves the problem.

To use the function, you can install the negi_stuff modules

  1. open terminal in home directory
  2. copy: pip install --user -e negi-stuff

To use the function in notebook, import the function using from negi_stuff.module import zarray

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

2 participants