oq-engine icon indicating copy to clipboard operation
oq-engine copied to clipboard

Error in the documentation? declustering GruenthalWindow()

Open bjrnlund opened this issue 3 years ago • 1 comments

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.

bjrnlund avatar Apr 28 '22 19:04 bjrnlund

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

mmpagani avatar Apr 30 '22 14:04 mmpagani