SeismicSource / sourcespec

Earthquake source parameters from P- and S-wave displacement spectra
https://sourcespec.seismicsource.org
Other
49 stars 12 forks source link

Inverse-frequency weighting #37

Closed krisvanneste closed 1 year ago

krisvanneste commented 1 year ago

Claudio,

I implemented a third weighting option in sourcespec based on inverse frequency, so that lower frequencies have larger weight in the inversion. If traces contain noise, weights will be set to zero where SNR < 3.

Note that the weights are not strictly 1/f, but 1/(f-f0+0.25)**0.25 (with f0 corresponding to the first valid frequency in the spectrum). This ensures that the weight curves have a similar shape, regardless of the actual frequency range, and also that the few lowest frequencies do not receive extremely large weights with respect to the others.

Here is a plot showing what the spectral weights look like: 1306 sspweight 00

Could you run a test with your data to see how it behaves?

I also fixed a small bug which appears when setting the Qo_min_max configuration parameter. It's a separate commit, so you could also cherry-pick it.

Let me know what you think and if you can think of any improvements, let me know!

Kris

claudiodsf commented 1 year ago

Hi Kris, Thanks for this PR!

I'll look into it during the next few days 👍

krisvanneste commented 1 year ago

Please note there has been an additional commit with a bug fix since the pull request. Let me know if I need to make the pull request again.

claudiodsf commented 1 year ago

Please note there has been an additional commit with a bug fix since the pull request. Let me know if I need to make the pull request again.

Don't need to make the PR again: every new commit is automatically added to the PR.

claudiodsf commented 1 year ago

Rebased on current main and force-pushed. I'm doing some more edits..

claudiodsf commented 1 year ago

Looks fine on my end, after a few edits.

Could you please check that it still works as intended? Thanks!

claudiodsf commented 1 year ago

P.S. You will have to force-pull 😉

krisvanneste commented 1 year ago

Is it OK if I do that tomorrow? I need to go home in a few minutes.

claudiodsf commented 1 year ago

Of course!

krisvanneste commented 1 year ago

It seems to work as before!

claudiodsf commented 1 year ago

Great! Merged 😉