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
Allow to specify filter freqs as args, Add different filter types #3294
Conversation
I like the idea of allowing positional parameters once the filter type is specified, and the increased flexibility could be nice, provided backwards compatibility is maintained. One comment on the API though; I have always found the |
To be honest, I like that there is only a single filter method. I see your point with the different kwargs depending on the plugin used. Similar to the read function one needs to read the documentation of the functions linked in the doc of Trace.filter. I guess introducing more filter functions would lead to more confusion. Edit: Another possible simplification of the code could be to dispatch the four filter functions to a single function in the signal module. That would de-duplicate docs and some code. |
Sorry about the late reply.. Re: more methodsI kind of agree with Tom that it might be good to keep the "one filter" method we have right now. Mainly because it it very clear for people where to look for filtering and have all documentation in one spot and you can see a nice overview of all the available filtering methods. And secondly because Re: usage with positional argsHmm.. I can see where you are coming from, it is slightly annoying to have to look up what the expected kwargs are named sometimes. On the other hand it's much safer and it was my impression that python is kind of steering a bit into the direction of preventing excessive/unsafe args usage with the invention of keyword-only arguments. |
Rebased to resolve conflicts |
What does this PR do?
Here I suggest two enhancements to ObsPy's filter functions:
stream.filter('lowpass', 1)
can be used as a replacement forstream.filter('lowpass', freq=1)
iirfilter
design function, i.e.'butter', 'cheby1', 'cheby2', 'ellip', 'bessel'
, not only the default Butterwoth filter.Documentation still missing; first I want to get some feedback.
Why was it initiated? Any relevant Issues?
Enhancement.
PR Checklist
master
for new features,maintenance_...
for bug fixesno_ci
label can be added to skip CI buildsJust add the
build_docs
tag to this PR.Docs will be served at docs.obspy.org/pr/{branch_name} (do not use master branch).
Please post a link to the relevant piece of documentation.
clients.fdsn
) should be tested for the PR,just add the
test_network
tag to this PR.CHANGELOG.txt
.CONTRIBUTORS.txt
.from all the CI builds look correct. Add the "upload_plots" tag so that plotting
outputs are attached as artifacts.
CODEOWNERS
with your github handleready for review
label when you are ready for the PR to be reviewed.