coutanto / axitra

numerical modelling of seismic wave propagation in 3D with flat layer models
GNU General Public License v3.0
43 stars 16 forks source link

notebook fix and additional documentation improvements #11

Open Thomas-Ulrich opened 4 months ago

Thomas-Ulrich commented 4 months ago

1) Arrays are inverted in notebook MOMENT_DISP_F90_OPENMP/EXAMPLE/check_amplitude. It should be:

pt.loglog(f, np.abs(np.fft.fft(sy_0[0,:]))/norm, f, np.abs(np.fft.fft(sy_2[0,:]))/norm,
          f, np.abs(np.fft.fft(sy_4[0,:]))/norm,f, np.abs(np.fft.fft(sy_5[0,:]))/norm,
          f, np.abs(np.fft.fft(sy_7[0,:]))/norm, f, np.abs(np.fft.fft(sy_8[0,:]))/norm,
          f, f*0.+LowFreq_asympt)
pt.legend(['dirac integrated','smooth acausal step','integrated triangle step',
           'linear ramp','Heaviside','integrated trapezoid','Far-field Low Freq. asymptote']);

(to match the legend)

All in all, I would use the following code:

nfreq = t.size
freq= np.fft.fftfreq(nfreq, t[1])
ids = np.where(freq>0)
f = freq[ids]
pt.loglog(f, np.abs(np.fft.fft(sy_0[0,:]))[ids]/nfreq, label = 'dirac integrated')
pt.loglog(f, np.abs(np.fft.fft(sy_2[0,:]))[ids]/nfreq, label = 'smooth acausal step')
pt.loglog(f, np.abs(np.fft.fft(sy_4[0,:]))[ids]/nfreq, label = 'integrated triangle step')
pt.loglog(f, np.abs(np.fft.fft(sy_5[0,:]))[ids]/nfreq, label = 'linear ramp')
pt.loglog(f, np.abs(np.fft.fft(sy_7[0,:]))[ids]/nfreq, label = 'Heaviside')
pt.loglog(f, np.abs(np.fft.fft(sy_8[0,:]))[ids]/nfreq, label = 'integrated trapezoid')
pt.loglog(f, f*0+LowFreq_asympt, label = 'Far-field Low Freq. asymptote')
pt.legend()

2) unit=0 is an undocumented feature in moment.conv:

t, sx_0, sy_0, sz_0 = moment.conv(ap,hist,source_type=0,t0=t0,unit=0)

(only 1,2 and 3 are documented in help(moment.conv).

3) I would precise in the readme that the convention for the rake angle is to assume a positive rake angle refers to left-lateral strike slip. E.g. something inspired from Slipnear (Bertrand Delouis) statement:

"rake" (degrees) is the slip angle (Aki's convention, e.g. rake=+45 means left-lateral-reverse movement).

(sorry for the list, but I'm just adding everything that I think could help other users using properly the code as I discover it).