去掉了接收深度接口,

更改了间隔dr。
这个提交包含在:
2023-04-07 16:11:16 +08:00
父节点 888a80e69c
当前提交 3ed8fe0dea
共修改 7 个文件,包含 175 行新增和 130 行删除
+16 -7
查看文件
@@ -52,7 +52,7 @@ def call_Bellhop(freq, sd, bathm, ssp, sed, base,azi):
# Source and receiving position
filename = 'cz'+str(azi)
Rmax = bathm.r[-1] # unit: km
dr = (1500 / freq) / 1000 # wavelength / 10, unit: km
dr = 0.1 # wavelength / 10, unit: km
ran = np.linspace(0, Rmax, round(Rmax / dr)) # Receiving range (unit: km)
Zmax, ssp_idx = calZmax(ssp, sed)
"""RD 已修改 8.26"""
@@ -100,7 +100,7 @@ def call_Bellhop(freq, sd, bathm, ssp, sed, base,azi):
bdy = Bndry(top, bottom)
# Beam params
run_type = 'I' # incoherently sum beams, see AT docs for more info
nbeams = 3000
nbeams = 1000
alpha = np.linspace(-90, 90, 2) # min and max launch angle -20 degrees to 20 degrees
box = Box(Zmax, 100) # bound the region you let the beams go, depth in meters and range in km
deltas = 0 # length step of ray trace, 0 means automatically choose
@@ -122,7 +122,7 @@ 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
dr = (1500 / freq) / 1000 # wavelength / 10, unit: km
dr = 0.1 # wavelength / 10, unit: km
ran = np.linspace(0, Rmax, round(Rmax / dr)) # Receiving range (unit: km)
Zmax, ssp_idx = calZmax(ssp, sed)
"""RD 已修改 8.26"""
@@ -297,7 +297,7 @@ def call_fangwei(freq, sd, bathm, ssp, sed, base, azi, isPlot=False):
czdetail.reflectCz = []
return Pos.r.range, Pos.r.depth, TL[0, 0, :, :], bathm, Rays, czdetail
def child(database, freq, lat, lon, sd, rd, i):
def child(database, freq, lat, lon, sd, isPlot, i):
descripts = ["正北方向", "东北方向", "正东方向", "东南方向", "正南方向", "西南方向", "正西方向", "西北方向"]
theta = np.arange(0, 359, 45)
[bathm, ssp, sed, base] = GetEnv(database, 25, Coord(lon, lat), R=100, azi=theta[i])
@@ -306,7 +306,7 @@ def child(database, freq, lat, lon, sd, rd, i):
ddd=[]
return None
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]
return CzData(theta[i], ranges, depths, TL, bathym, Rays, czdetail)
@@ -325,7 +325,7 @@ def call_cz(database, freq, lat, lon, azi, sourceDepth=10, isPlot=False):
if np.mean(bathm.d) < 2000:
return None
else:
ranges, depths, TL, bathym, Rays, czdetail = call_fangwei(freq, sd, rd, bathm, ssp, sed, base, azi,
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))
@@ -340,7 +340,7 @@ def call_cz(database, freq, lat, lon, azi, sourceDepth=10, isPlot=False):
pool = Pool(processes=8)
applyResults = []
for pi in range(8):
applyResults.append(pool.apply_async(partial(child, database, freq, lat, lon, sd, rd), (pi,)))
applyResults.append(pool.apply_async(partial(child, database, freq, lat, lon, sd, isPlot), (pi,)))
# pi=Process(target=child_0,args=(pi,))
# pi.start()
pool.close()
@@ -348,3 +348,12 @@ def call_cz(database, freq, lat, lon, azi, sourceDepth=10, isPlot=False):
for applyResult in applyResults:
results.append(applyResult.get())
return results
# timeIndex = '20190101'
# # 设置时间段
#
# STPath = '/home/gan/下载/code'
# ETOPO1Path = '/home/gan/下载/code/20220920/ETOPO1'
# database = DataBase(ETOPO1Path, STPath)
# database.set_timePeriod(timeIndex)
# res = call_cz(database, 300, 13, 115, 0, 60, True)
# a = 1