Skip to content
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

Error in the documentation? declustering GruenthalWindow() #7765

Open
OsoBjorn opened this issue Apr 28, 2022 · 1 comment
Open

Error in the documentation? declustering GruenthalWindow() #7765

OsoBjorn opened this issue Apr 28, 2022 · 1 comment
Assignees

Comments

@OsoBjorn
Copy link

A bit of confusion here. Comparing the declustering window code in seismicity.declusterer.distance_time_windows.GruenthalWindow():

sw_space = np.exp(1.77 + np.sqrt(0.037 + 1.02 * magnitude))
sw_time = np.abs( (np.exp(-3.95 + np.sqrt(0.62 + 17.32 * magnitude))) / DAYS)

with the documentation in hmtk_tutorial.pdf (page 22), and the paper by Stiphout et al. (2012) referred to in the tutorial, which I looked at, there are squares instead of square roots in the docs:

sw_space = np.exp(1.77 + (0.037 + 1.02 * magnitude)**2)
sw_time = np.abs( (np.exp(-3.95 + (0.62 + 17.32 * magnitude)**2)) / DAYS)

Obviously a mismatch. Unfortunately the Matlab code referenced in Stiphout et al. (2012) is not available. However, the code above gives reasonable results, which the documentation does not, unless the units are something much smaller than km and days. Except, as in my case, if you have negative magnitudes below a certain size, then the sqrt() argument becomes negative.

In addition, the hmtk_tutorial.pdf on page 22 says that the unit of time is decimal years, for all three Window()s. It is in days, as in Stiphout et al. (2012), which the code corrects for.

@mmpagani
Copy link
Member

Many thanks for signalling this. We will fix this problem in the manual (which requires a major update)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants