你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-08 07:24:19 +08:00
Updated with ruff formatter
这个提交包含在:
@@ -60,9 +60,13 @@ def diff_output_files(filename1, filename2):
|
||||
|
||||
# Arrays for storing time
|
||||
time1 = np.zeros((file1.attrs["Iterations"]), dtype=floattype1)
|
||||
time1 = np.linspace(0, (file1.attrs["Iterations"] - 1), num=file1.attrs["Iterations"])
|
||||
time1 = np.linspace(
|
||||
0, (file1.attrs["Iterations"] - 1), num=file1.attrs["Iterations"]
|
||||
)
|
||||
time2 = np.zeros((file2.attrs["Iterations"]), dtype=floattype2)
|
||||
time2 = np.linspace(0, (file2.attrs["Iterations"] - 1), num=file2.attrs["Iterations"])
|
||||
time2 = np.linspace(
|
||||
0, (file2.attrs["Iterations"] - 1), num=file2.attrs["Iterations"]
|
||||
)
|
||||
|
||||
# Arrays for storing field data
|
||||
data1 = np.zeros((file1.attrs["Iterations"], len(outputs1)), dtype=floattype1)
|
||||
@@ -82,7 +86,10 @@ def diff_output_files(filename1, filename2):
|
||||
for i in range(len(outputs2)):
|
||||
maxi = np.amax(np.abs(data1[:, i]))
|
||||
datadiffs[:, i] = np.divide(
|
||||
np.abs(data2[:, i] - data1[:, i]), maxi, out=np.zeros_like(data1[:, i]), where=maxi != 0
|
||||
np.abs(data2[:, i] - data1[:, i]),
|
||||
maxi,
|
||||
out=np.zeros_like(data1[:, i]),
|
||||
where=maxi != 0,
|
||||
) # Replace any division by zero with zero
|
||||
|
||||
# Calculate power (ignore warning from taking a log of any zero values)
|
||||
|
在新工单中引用
屏蔽一个用户