-
Notifications
You must be signed in to change notification settings - Fork 13
Autoset Mw inversion limits #22
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
Comments
Claudio, |
Sure, no rush! |
I also changed the clipping detection algorithm, see d1dbb0f. |
I compared the new approach for autosetting the Mw limits with the previous one using the
However, I'm not sure this example is representative. I should do more testing, but unfortunately I'm still struggling to check the instrument responses for our older data. The change you made looks simple, but there are 2 fundamental differences with the previous approach:
Below I include the plots and logs obtained with the 2 approaches. Fitted spectra (old approach): Fitted spectra (new approach): Log (old approach): Log (new approach): |
Concerning the frequency weighting, in another program I use inverse frequency weighting. This is something I read in a paper by Kaneko & Shearer (2014) (https://academic.oup.com/gji/article/197/2/1002/617325): We weight the fit inversely with frequency so that all parts of the spectrum seen in a log–log plot contribute equally (this generally improves the fit to the low-frequency part of the spectrum, which is defined by relatively few points). If you don't have this paper, I can send it to you. I was thinking of implementing this in sourcespec as well, but this will thus also require a strategy to determine the initial part of the spectrum ( But first I will try to test the new clipping detection! |
I tested the new clipping detection with some clipped data, but it doesn't seem to be working. RCHB may be more difficult to detect, but the other stations are quite obviously clipped. What I do like about the new implementation is that the detection is limited to the wave type, which makes it possible to determine Mw from the P-phase when clipping is limited to the S-phase. However, for this to work properly, I think line 87 should be removed, as it redefines the end of the checked interval:
I also implemented clip detection in my code, but it tends to overdetect. Robust clip detection is not so easy as it would seem... |
Hi Kris, thanks for your testing.
bounds.Mw_min = Mw_0 - config.Mw_0_variability
bounds.Mw_max = Mw_0 + config.Mw_0_variability While the new one is: bounds.Mw_min = np.nanmin(ydata[idx0: idx1]) * 0.9
bounds.Mw_max = np.nanmax(ydata[idx0: idx1]) * 1.1 This new code should provide larger bounds, which make it possible to find a better solution. It is particularly evident when using grid search and looking at misfit plots, as in the attached plots. Concerning the inversion, it is made in logarithmic frequency spacing (see here) and this should mitigate the problem raised by Kaneko & Shearer. But, of course, any improvement to the weighting strategy is welcome! |
Concerning the clipping detection: I guess there is a problem when the histogram peaks are at the edges of the histogram. I had to smooth the histogram (orange curve) to avoid secondary peaks, but it obviously doesn't work in your case. Your third case is hard because the clipping is just on one oscillation, but the other two should work. |
Sorry about the confusion regarding linear/log space. I forgot that you convert the spectra to seismic moment, whereas I was reasoning in amplitude... |
I will export the clipped records to miniseed and send them to you. |
Here are the miniseed files: |
Thanks, I'm fine with miniSEED, since clipping is evaluated on uncorrected data. |
I moved the discussion on clipping detection to #23. Let me know if you want to iterate more on Mw limits, or if you think that it is fine. |
I think it is fine as the new code indeed provides larger bounds. |
The misfit plots are generated when using "grid search" ( I'm using more and more grid search (even if slower) because misfit plots give a clear view of parameter interdependence. And, yes, old code on top plot. |
Great, I didn't know that. I will try it too! |
I think we can considered this as tested. Closing |
Hi @krisvanneste,
I just pushed a commit (a15d171) with a new approach for autosetting Mw limits, between 90% of the minimum
of the spectral plateau and 110% of its maximum.
In my tests, this works very well and removes the need for the
Mw_0_variability
parameter.However, I just tested it with noise weighting. I would be very glad if you could test it in your case, with frequency weighting.
Thanks!
The text was updated successfully, but these errors were encountered: