-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
win_type for rolling() ? #1142
Comments
There are no immediate plans that I know of, but I think we are certainly open to adding this functionality if someone wants to look into it. |
Think it would be useful generally. @jhamman will have a better view of how difficult it is to implement. Our use cases are fine with simple windows, although an One API choice is to what extent we want |
Certainly open to adding this functionality. Bottleneck isn't going to help so the code will all live in xarray. I think it makes sense to have a bit of a design discussion here prior to getting started. Questions: 1. What window types are you interested in adding? Pandas includes:
2. Can we maintain compatibility with pandas and bottleneck.We have tried to maintain compatibility with both pandas and bottleneck in our rolling implementation. This is proving somewhat difficult (e.g. #1046) but is a design consideration that we should keep in mind. Also, our current implementation falls back to operating on individual slices of the DataArray when bottleneck cannot be utilized. We should think a bit about the applicability of other windows when using other window types. Presumably, each 3. What about nd windows?Our current implementation left open the possibility of n-dimensional windows (see #819). While we haven't implemented it yet, the utility of the rolling object for a 2+ dimensional smoother would be quite a nice feature. That said, I'd be hesitant to implement anything on the rolling object that would not allow us to make this addition in the future. |
Sorry for not replying sooner. So far it works fine for me when I switch to
pandas, use their gaussian rolling window, and then switch back to xarray.
As I'm in a hurry with something else now, I will get back to this
discussion a bit later.
|
Hi, I have taken another approach for using nd window over several dimensions of xarray objects to perform filtering and tapering, based on For the moment, I have something that works like this :
where Then the filtering can be perform using the I also want to add a tapering method 'w.taper()' which would be useful for spectral analysis. For multi-tapering, it should also generate an object with an additional dimension corresponding to the number of windows. To do that, I first need to handle the window building using dask. Let me know if you are interesting in this approach. For the moment, I have planned to upload a github project for signal processing tools in the framework of pangeo-data. It sould be online by the end of December and I will happy to have feedback on it. I am not sure it falls into the xarray framework and it may need a dedicated project, but I might be wrong. |
In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity |
Hi, is there any plan to include support for various win_types such as "gaussian" to the xarray's rolling() methods like in pandas rolling()? I started using something like DataArray.to_pandas().rolling(...).. .to_xarray(), but in this way it's tricky to adhere to the xarray's flexibility when it comes to N-dimensionality..
The text was updated successfully, but these errors were encountered: