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
- Refactor gap handling as a context manager;
- Provide a new keyword arg for match-filter objects of
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 and pre_processing._zero_pad_gaps would be repurposed as __enter__ and __exit__ functions on a HandleGaps context manager. The API would end up looking something like this:
from eqcorrscan.pre_processing import HandleGaps
with HandleGaps(tr):
custom_processing(tr)
- Would be fairly simple, add an extra argument, and check when calling the processing functions if it had been set, otherwise, use the inbuilt processing functions.
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_processingfunctions 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_filterobjects 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_gapsandpre_processing._zero_pad_gapswould be repurposed as__enter__and__exit__functions on aHandleGapscontext manager. The API would end up looking something like this: