-
Notifications
You must be signed in to change notification settings - Fork 23
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
Polarity misfit is not computed in Waveforms+Polarities.py #285
Comments
Very helpful, thanks for pointing this out. Yes, so far the Waveforms+Polarities.py example only calculates predicted polarities. I can't access the full text for Silwal et al. 2018, but I'd agree that the relative weighting between waveforms and polarities is important. I'd imagine some sort of user choice / tuning capability may be helpful? |
before going forward on this, I wonder if anyone might be able to respond to issue #204 ? |
Thank you, @rmodrak , for the prompt response. I agree that adding a user choice could be very helpful. |
Hi @Rinku-274 , The current implementation calls the following method internally to get the first motion polarity input from "data" : def get_observed(self, data):
""" Extracts observed polarities from data
"""
if isinstance(data, mtuq.Dataset):
observed = np.array([_get_polarity(stream) for stream in data])
elif isinstance(data, list):
observed = np.array(data)
elif isinstance(data, np.ndarray):
observed = data
else:
raise TypeError
return observed with As for the total misfit results, thanks for pointing out that we should absolutely include the polarity misfit result here, and that will be an easy fix. However, there is no dedicated implementation of the polarity vs. waveform misfit, as the choice of how to combine misfit is entirely open to the user. This is an example of how it can be done: from mtuq.misfit.waveform import calculate_norm_data
norm_bw = calculate_norm_data(data_bw,
misfit_bw.norm, ['Z', 'R'])
norm_sw = calculate_norm_data(data_sw,
misfit_sw.norm, ['Z', 'R', 'T'])
results = (results_bw/norm_bw + results_sw/norm_sw + results_polarity/len(polarities))/3 This would put all three misfit measures at even weight. Then, you can start experimenting and refine how you want to combine the results (and having this being open-ended is a good way to make sure this is as flexible as possible). @rmodrak I am going to have a look at issue #204. Thanks a lot for the feedback 👍. |
I propose adding a column to the weights.dat file to include the polarity value for each station. The column would use the following conventions:
For reference, I’ve submitted a pull request with a modified version of the code implementing this suggestion. Please take a look and let me know your thoughts. Thank you! |
In the example file Waveforms+Polarities.py, the polarity misfit is missing in the final results
results = results_bw + results_sw
(line number 206). Also, it seems that the weight for polarity and waveform misfit has not been implemented (equation 3, Silwal et al. 2018). This needs to be addressed for consistency.The text was updated successfully, but these errors were encountered: