ZH: lib/rit: normalise P in pow_and_time

This commit is contained in:
Eric Teunis de Boone 2023-03-22 15:36:02 +01:00
parent daccdb4e91
commit e06d3f13d0

View file

@ -58,6 +58,8 @@ def pow_and_time(test_loc,ev,dt=1.0):
a_sum = np.add(a_sum,a_int) a_sum = np.add(a_sum,a_int)
if len(a_sum) != 0: if len(a_sum) != 0:
P = np.sum(np.square(np.absolute(np.fft.fft(a_sum)))) P = np.sum(np.square(np.absolute(np.fft.fft(a_sum))))
# normalise P with the length of the traces
P = P/( t_sum[-1] - t_sum[0])
else: else:
print("ERROR, a_sum lenght = 0", print("ERROR, a_sum lenght = 0",
"tmin ",t_min, "tmin ",t_min,