Do we have any utility like lowpass, highpass and bandpass filter in xCDAT? #431
Replies: 7 comments 3 replies
-
Hi @JiveshDixit – I agree that filtering is really useful. Unfortunately, xCDAT doesn't have any filtering capabilities at this time. A good place to discuss the potential for this kind of functionality is this thread: #271. In general, xCDAT tries to ensure feature are maintainable and aren't already implemented in another package. Thanks for pointing out xrscipy! @lee1043 - may also have comments (not sure if PMP uses any temporal filtering). |
Beta Was this translation helpful? Give feedback.
-
Thanks for the discussion! NCL has the filter functions which has been really helpful. It would be really nice to have a python implementation of these libraries, I'm not sure if there is a tool/package that covers these functions exist... |
Beta Was this translation helpful? Give feedback.
-
Thank you for the discussion, @JiveshDixit. I ditto what @pochedls said. Few metrics of PMP use some features like filtering, e.g., in its monsoon and precipitation variability metric (@msahn please correct me if I am wrong). I agree filtering would be useful but not sure if we would want to have it in xcdat if xr-scipy can well handle it (Thank you @JiveshDixit for bringing xr-scipy to our attention). |
Beta Was this translation helpful? Give feedback.
-
You could use os.sys to just make a call to the previously mentioned NCL routines through some intermediate files too.
Michael
… On Mar 10, 2023, at 1:30 PM, Jiwoo Lee ***@***.***> wrote:
Thank you for the discussion, @JiveshDixit <https://github.com/JiveshDixit>. I ditto what @pochedls <https://github.com/pochedls> said. Few metrics of PMP use some features like filtering, e.g., in its monsoon and precipitation variability metric ***@***.*** <https://github.com/msahn> please correct me if I am wrong). I agree filtering would be useful but not sure if we would want to have it in xcdat if xr-scipy can well handle it (Thank you @JiveshDixit <https://github.com/JiveshDixit> for bringing xr-scipy to our attention).
—
Reply to this email directly, view it on GitHub <#431 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACSKCHDRFUOTZAA2CQELYILW3OMPFANCNFSM6AAAAAAVV6IIS4>.
You are receiving this because you are subscribed to this thread.
|
Beta Was this translation helpful? Give feedback.
-
What I would do is write out a netcdf file in the python first.
Then
import os
os.system(’ncl ‘+ncl_script_name+’ ‘+arguments)
Where ncl_script_name is your script and arguments are whatever input is required).
Then reopen the ncl output netcdf file and reading back in the results you need.
A bit clumsy because you are transferring information indirectly via files, but it works :)
Michael
… On Mar 10, 2023, at 2:59 PM, Jill Chengzhu Zhang ***@***.***> wrote:
Thank you @mfwehner <https://github.com/mfwehner> for pointing out this workaround. I can't seem to find a tutorial for calling the NCL routines from Python. Having some examples would be really great.
—
Reply to this email directly, view it on GitHub <#431 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACSKCHDVWVCLLN2UKIG6HFLW3OW5DANCNFSM6AAAAAAVV6IIS4>.
You are receiving this because you were mentioned.
|
Beta Was this translation helpful? Give feedback.
-
Jill
One argument for using ncl routines in general, is that there is a large climate & weather analyst user base and this library is well vetted. I don’t know about xr-scipy. It may be larger. Or not, if it is newer.
Michael
… On Mar 10, 2023, at 4:17 PM, Jill Chengzhu Zhang ***@***.***> wrote:
Thank you @mfwehner <https://github.com/mfwehner>!
If we were going to provide the filters (i.g., Lanczos and Butterworth filters, as those supported by NCL) though xcdat, what you proposed is a good way to test and compare with NCL results.
Personally, I think the implementation won't be too bad, but could be popular. Alternatively, it might make more sense to contribute to xr-scipy for filters that are important but not already included (admittedly I need to learn more about those different filter types..).
—
Reply to this email directly, view it on GitHub <#431 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ACSKCHDBHHPR2225GH4M6GDW3PABHANCNFSM6AAAAAAVV6IIS4>.
You are receiving this because you were mentioned.
|
Beta Was this translation helpful? Give feedback.
-
Just an FYI, geocat-comp (a similar analysis package) has these filtering features: https://geocat-comp.readthedocs.io/en/latest/user_api/index.html#fourier-filters |
Beta Was this translation helpful? Give feedback.
-
These filters could be a really useful in many applications in climate analysis. I was wondering as xCDAT being a climate data analysis tool, does it have utility to perform the same? If not, is there any plan to add that in future? Seems we have a xarray based package "xrscipy" that does the same.
Beta Was this translation helpful? Give feedback.
All reactions