你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 04:56:51 +08:00
Testing new compactness fitness function.
这个提交包含在:
@@ -211,17 +211,20 @@ def compactness(filename, args):
|
|||||||
thresholdpeak = 1e-3
|
thresholdpeak = 1e-3
|
||||||
peaks = [peak for peak in peaks if np.abs(outputdata[peak]) > thresholdpeak]
|
peaks = [peak for peak in peaks if np.abs(outputdata[peak]) > thresholdpeak]
|
||||||
|
|
||||||
# Percentage of maximum value to measure compactness of signal
|
# Amplitude ratio of the 1st to 3rd peak - hopefully be a measure of a compact envelope
|
||||||
durationthreshold = 2
|
compactness = np.abs(outputdata[peaks[0]]) / np.abs(outputdata[peaks[2]])
|
||||||
# Check if there is a peak/trough smaller than threshold
|
|
||||||
durationthresholdexist = np.where(np.abs(outputdata[peaks]) < (peak * (durationthreshold / 100)))[0]
|
# # Percentage of maximum value to measure compactness of signal
|
||||||
if durationthresholdexist.size == 0:
|
# durationthreshold = 2
|
||||||
compactness = time[peaks[-1]]
|
# # Check if there is a peak/trough smaller than threshold
|
||||||
else:
|
# durationthresholdexist = np.where(np.abs(outputdata[peaks]) < (peak * (durationthreshold / 100)))[0]
|
||||||
time2threshold = time[peaks[durationthresholdexist[0]]]
|
# if durationthresholdexist.size == 0:
|
||||||
compactness = time2threshold - time[min(peaks)]
|
# compactness = time[peaks[-1]]
|
||||||
|
# else:
|
||||||
|
# time2threshold = time[peaks[durationthresholdexist[0]]]
|
||||||
|
# compactness = time2threshold - time[min(peaks)]
|
||||||
|
|
||||||
return (1 / compactness)
|
return compactness
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
在新工单中引用
屏蔽一个用户