-
Notifications
You must be signed in to change notification settings - Fork 59
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
Linear interpolation for seasonal bias adjustment leads to non-smooth distribution #2014
Comments
Ok I think I am getting closer to the problem. If I understand it correctly, ind = da.indexes[self.dim]
if self.prop == "week":
i = da[self.dim].copy(data=ind.isocalendar().week).astype(int)
elif self.prop == "season":
i = da[self.dim].copy(data=ind.month % 12 // 3)
else:
i = getattr(ind, self.prop)
if not np.issubdtype(i.dtype, np.integer):
raise ValueError(
f"Index {self.name} is not of type int (rather {i.dtype}), "
f"but {self.__class__.__name__} requires integer indexes."
)
if interp and self.dim == "time" and self.prop == "month":
i = ind.month - 0.5 + ind.day / ind.days_in_month so I think the problem is that at no point are the actual seasonal weights computed. I'll try to work out how this should like and will report back. |
Setup Information
Description
If I change the grouper from the first example of the docs to use
time.season
instead oftime.month
. I get some drastic transitions when the seasons change:I remember we did additions to enable the interpolation for these string columns of seasons but now I am not sure its working correctly. I can see that it changes the coordinates to integers and adds the cyclic bounds so I am not sure why this would be happening?
Steps To Reproduce
Use the example from the tutorial or paste the following
Additional context
No response
Contribution
Code of Conduct
The text was updated successfully, but these errors were encountered: