修改python模块引用方式

这个提交包含在:
2023-04-07 10:14:32 +08:00
父节点 6845ee0834
当前提交 86b7cad3ea
共修改 25 个文件,包含 443 行新增和 56 行删除
+13 -14
查看文件
@@ -2,13 +2,13 @@
from multiprocessing import Process
from os import system
import numpy as np
from pyat.AcousticPara import GetEnv, Coord
from AcousticPara import GetEnv, Coord
from scipy.signal import savgol_filter, medfilt
from pyat.DataBase import DataBase
from pyat.readwrite import write_env, write_bathy, read_shd, get_rays
from pyat.env import Pos, Source, Dom, cInt, SSPraw, SSP, HS, BotBndry, TopBndry, Bndry, Box, Beam
from DataBase import DataBase
from readwrite import write_env, write_bathy, read_shd, get_rays
from env import Pos, Source, Dom, cInt, SSPraw, SSP, HS, BotBndry, TopBndry, Bndry, Box, Beam
import matplotlib.pyplot as plt
from pyat.config import AtBinPath
from config import AtBinPath
file_cz_data = open('cz_data.txt', 'w')
@@ -47,7 +47,7 @@ def calZmax(ssp, sed):
return Zmax, ssp_idx
def call_Bellhop(freq, sd, rd, bathm, ssp, sed, base,azi):
def call_Bellhop(freq, sd, bathm, ssp, sed, base,azi):
# Source and receiving position
filename = 'cz'+str(azi)
Rmax = bathm.r[-1] # unit: km
@@ -117,7 +117,7 @@ def call_Bellhop(freq, sd, rd, bathm, ssp, sed, base,azi):
return Pos1, TL
def call_Bellhop_Rays(freq, sd, rd, bathm, ssp, sed, base,azi):
def call_Bellhop_Rays(freq, sd, bathm, ssp, sed, base,azi):
# Source and receiving position
filename = 'cz_ray'+str(azi)
Rmax = bathm.r[-1] # unit: km
@@ -265,7 +265,7 @@ def call_hjq(r, TL):
return czrangewidth_list
def call_fangwei(freq, sd, rd, bathm, ssp, sed, base, azi, isPlot=False):
def call_fangwei(freq, sd, bathm, ssp, sed, base, azi, isPlot=False):
czdetail = CzDetail("", [], [])
last = len(ssp[0].c) - 1
# if ssp[0].c[0] > ssp[0].c[last]:
@@ -274,9 +274,9 @@ def call_fangwei(freq, sd, rd, bathm, ssp, sed, base, azi, isPlot=False):
# else:
# file_cz_data.write('\n'"直达会聚区:")
sed = None
rays_total = call_Bellhop_Rays(freq, sd, rd, bathm, ssp, sed, base, azi)
rays_total = call_Bellhop_Rays(freq, sd, bathm, ssp, sed, base, azi)
Rays = find_cvgcRays(rays_total)
[Pos, TL] = call_Bellhop(freq, sd, rd, bathm, ssp, sed, base, azi)
[Pos, TL] = call_Bellhop(freq, sd, bathm, ssp, sed, base, azi)
[x, x, x, x, Pos, pressure] = read_shd('cz'+str(azi)+'.shd')
TL = -10 * np.log10(np.square(np.abs(pressure))) # Transmission Loss
# Plot
@@ -297,9 +297,8 @@ def call_fangwei(freq, sd, rd, bathm, ssp, sed, base, azi, isPlot=False):
return Pos.r.range, Pos.r.depth, TL[0, 0, :, :], bathm, Rays, czdetail
def call_cz(database, freq, lat, lon, azi, sourceDepth=10, receiveDepth=10, isPlot=False):
def call_cz(database, freq, lat, lon, azi, sourceDepth=10, isPlot=False):
sd = np.array([sourceDepth]) # Source depth
rd = np.linspace(0, receiveDepth, 351) # Receiving depth
results = []
ranges, depths, TL, bathym, Rays = [], [], [], [], []
@@ -311,7 +310,7 @@ def call_cz(database, freq, lat, lon, azi, sourceDepth=10, receiveDepth=10, isPl
# 不会出现会聚区
ddd=[]
else:
ranges, depths, TL, bathym, Rays, czdetail = call_fangwei(freq, sd, rd, bathm, ssp, sed, base, azi=theta[i],isPlot=True)
ranges, depths, TL, bathym, Rays, czdetail = call_fangwei(freq, sd, bathm, ssp, sed, base, azi=theta[i],isPlot=isPlot)
czdetail.descript = descripts[i]
results.append(CzData(theta[i], ranges, depths, TL, bathym, Rays, czdetail))
return results
@@ -325,7 +324,7 @@ def call_cz(database, freq, lat, lon, azi, sourceDepth=10, receiveDepth=10, isPl
if np.mean(bathm.d) < 2000:
return results
else:
ranges, depths, TL, bathym, Rays, czdetail = call_fangwei(freq, sd, rd, bathm, ssp, sed, base,
ranges, depths, TL, bathym, Rays, czdetail = call_fangwei(freq, sd, bathm, ssp, sed, base,azi,
isPlot=isPlot)
czdetail.descript = "{:.1f}°方向".format(azi)
results.append(CzData(0, ranges, depths, TL, bathym, Rays, czdetail))