eqcorrscan / EQcorrscan

Earthquake detection and analysis in Python.
https://eqcorrscan.readthedocs.io/en/latest/
Other
166 stars 86 forks source link

Make CC-interpolation simpler & more robust #491

Closed flixha closed 2 years ago

flixha commented 2 years ago

What does this PR do?

Replaces the CC-interpolation function that can be used for lag_calc and catalog_to_dd with a function that simply resamples the CC.

Why was it initiated? Any relevant Issues?

PR Checklist

calum-chamberlain commented 2 years ago

This looks nice! Although I think this should go through a deprecation cycle - e.g. with an option to use the resampling method rather than the current method. I think the current method is documented in a couple of spots linking to a paper so we would need to find and change those as well.

flixha commented 2 years ago

@calum-chamberlain Of course, I'll fix this so that the old methods stays as the default with a deprecation message for a while, and users can choose this method. Should have mentioned: I saw that there was a comment in the function that you may have put in because you saw that it doesn't always work optimally - any more thoughts on that that we should consider for the new function?

flixha commented 2 years ago

I made the new function optional with use_new_resamp_method=True which is passed as **kwargs. The warning message is only shown once so that the log isn't completely spammed with this message - because this function is called many times when interpolation is turned on.

flixha commented 2 years ago

Tests now failing during installation, probably related to a breaking change in setuptools 61.0.0: https://github.com/pypa/setuptools/issues/3197 .. checking this now.

flixha commented 2 years ago

Sounds good, thanks for merging!