-
Notifications
You must be signed in to change notification settings - Fork 86
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
custom process-function options #273
Comments
Hey @calum-chamberlain, This looks interesting. I love the idea of simply doing the thing most people will want by default, but allowing users to modify the default behaviour when needed. A few thoughts/questions:
from eqcorrscan.pre_processing import HandleGaps
with HandleGaps(tr) as trr:
custom_processing(trr)
|
Thanks for those @d-chambers (also thanks for the book recommendation, I'm chewing my way through it, and almost every page has something of great interest!). At the moment, the function
|
No problem, that book is incredible, I learned a ton from it. There are still parts of it, especially the async stuff, that I am struggling to wrap my head around. Ok so |
Ah, no,
I was imagining having step 1 as |
So the context manager is specifically to enforce |
Yup, that's it - I'm hoping that it would be simple for people to use as well - its the only bit of the processing functions that I would say is really required for the correlation functions. Everything else could/should be personal preference. |
Playing around more with this, I don't think the context manager fits and I'm just going to expose the (previously "private") gap handling functions. |
Working on adding custom processing functions here |
Is your feature request related to a problem? Please describe.
Gaps in seismic data cause most of the issues with normalisation of correlations. EQcorrscan's
pre_processing
functions take care of gaps pretty well now, but it would be good to expose users to how gaps are handled so that they can easily write their own custom process functions (e.g. adding processing steps, or using a different type of filtering, decimating rather than resampling...) that also handle gaps in the way the correlation functions expect.It would also be useful if the
match_filter
objects allowed a custom process-function to be specified (in a similar way that users can specify any correlation function they want). This would allow more people to use those objects.Describe the solution you'd like
process_func
.Both would require docs and tutorials to make it clear how they should be used - in general the docs are in real need of a tidy.
pre_processing._fill_gaps
andpre_processing._zero_pad_gaps
would be repurposed as__enter__
and__exit__
functions on aHandleGaps
context manager. The API would end up looking something like this:The text was updated successfully, but these errors were encountered: