-
Notifications
You must be signed in to change notification settings - Fork 86
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
Relative-magnitude: weight_by_correlation, min_cc & normalization are a bit confusing #455
Comments
This is a little confusing, agreed. The paper referenced (Schaff and Richards 2014) does not use the same procedure. I would be tempted to remove the
|
Ok, good that we're on the same page then! The other PR is more urged, so I'll fix the remaining things there until doing anything related to this here.
|
So what is implemented is supposed to be similar to equation 4 in the paper, but how you go from that to the full magnitude isn't necessarily obvious.
Normalizing by the mean of the correlations isn't likely to be the intended use. I will have to reread the paper to work out how it should work, but I won't have time soon, so I will just remove the functionality if it is confusing and it can be added later in a more robust way if/ when someone wants it.
CJ Chamberlain, out of office
…________________________________
From: FelixHa ***@***.***>
Sent: Friday, April 16, 2021 7:26:53 PM
To: eqcorrscan/EQcorrscan ***@***.***>
Cc: Calum Chamberlain ***@***.***>; Comment ***@***.***>
Subject: Re: [eqcorrscan/EQcorrscan] Relative-magnitude: weight_by_correlation, min_cc & normalization are a bit confusing (#455)
Ok, good that we're on the same page then! The other PR is more urged, so I'll fix the remaining things there until doing anything related to this here.
* The confusing part for me was less that the function returns the delta-magnitude (and one hence has to add the original magnitude), but rather that each delta-magnitude is needs to be divided by CC again for that addition.
* The code that is commented out in Family.relative_magnitude did not contain that division by CC, and it computed the average relative magnitude basically with np.sum(delta_mag_values) / len(delta_mag_values), instead of np.sum(delta_mag_values) / np.sum(cc_values) as it would make sense to me. That would have given results that were not too far off with high values for min_cc, but would have caused larger deviations with small values for min_cc.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feqcorrscan%2FEQcorrscan%2Fissues%2F455%23issuecomment-820976154&data=04%7C01%7Ccalum.chamberlain%40vuw.ac.nz%7C79bd686359964bd538b508d900a9034a%7Ccfe63e236951427e8683bb84dcf1d20c%7C0%7C0%7C637541548292332436%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Dn2UPTtQrXgLSLdT4qlBr1%2F3VEUnJ707iPZNdxMfCN4%3D&reserved=0>, or unsubscribe<https://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACTIM44DF3VXNJHNAZV7FZTTI7RD3ANCNFSM4275OAAA&data=04%7C01%7Ccalum.chamberlain%40vuw.ac.nz%7C79bd686359964bd538b508d900a9034a%7Ccfe63e236951427e8683bb84dcf1d20c%7C0%7C0%7C637541548292342430%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=itg1%2BPDK0L%2FZfpA9RjvW%2BtcTidw4MfNXEcW9xDr642w%3D&reserved=0>.
|
Ok, I see where this comes from now - I'll have to do the same in terms of reading the paper in more detail! I should be able to tackle this as I also now have a small dataset that could be useful for testing the bias / scaling between the relative magnitudes and standard local magnitudes. Will getback to that later... |
This is now addressed in #461 . |
I was trying to calculate some relative magnitudes and was a bit confused by what
weight_by_correlation
andmin_cc
are supposed to do (or whether they are doing what they were intended to do).Main issue
Running
relative_magnitude
withweight_by_correlation=True
returns delta-magnitudes that are each multiplied by the CC of the trace. So to calculate the actual magnitude, the user always has to do something like:Now I know that
family.relative_magnitude
is not working anyways right now, but looking into the code the normalization for the CC-values did not happen there as far as I can see. So it seems to merelative_magnitude
wasn't intended to work like shown in the snippet above. Is that true?Other behavior I expected to work differently:
StationMagnitude
for each observation, they first have to convert withstation_mag = original_mag + delta_mag / cc
weight_by_correlation=False
, thenmin_cc
has no effect, i.e., delta-mags are returned for all traces, even those that don't correlate wellCode + Example
Here is the code on how the CC-weighting works right now.
Here a minimal example based on the EQcorrscan-tests (this may not show the effect strongly, because the magnitude difference between event1 and event2 is rather small):
(Click to expand minimal example!)
The text was updated successfully, but these errors were encountered: