更改了声线计算方式,合理分配了角度和声线进行并行运算。
这个提交包含在:
+20
-12
@@ -1,12 +1,12 @@
|
||||
import numpy as np
|
||||
from AcousticPara import GetEnv, Coord
|
||||
from DataBase import DataBase
|
||||
from bellhop import call_Bellhop
|
||||
from krakenc import call_krakenc
|
||||
from ram import call_ram
|
||||
from pyat.AcousticPara import GetEnv, Coord
|
||||
from pyat.DataBase import DataBase
|
||||
from pyat.bellhop import call_Bellhop
|
||||
from pyat.krakenc import call_krakenc
|
||||
from pyat.ram import call_ram
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
def call_tl(database, freq, sourceDepth, sourceLat, sourceLon, receiveDepth,
|
||||
def call_tl(database, freq, sourceDepth, sourceLat, sourceLon,
|
||||
receiveLat=None, receiveLon=None, range=None, azi=None, modelType='kraken', isPlot=False):
|
||||
""" Input:
|
||||
freq - float, Frequency
|
||||
@@ -40,8 +40,7 @@ def call_tl(database, freq, sourceDepth, sourceLat, sourceLon, receiveDepth,
|
||||
return [], [], [], bathym
|
||||
if modelType == 'bellhop':
|
||||
sd = np.array([sourceDepth]) # Source depth
|
||||
rd = np.linspace(0, receiveDepth, int(receiveDepth/10)) # Receiving depth
|
||||
[Pos, TL] = call_Bellhop(freq, sd, rd, bathym, ssp, sed, base)
|
||||
[Pos, TL] = call_Bellhop(freq, sd, bathym, ssp, sed, base)
|
||||
# Plot
|
||||
if isPlot:
|
||||
plt.pcolor(Pos.r.range, Pos.r.depth, TL[0,0,:,:], vmin=40, vmax=130, cmap='jet_r', shading='auto')
|
||||
@@ -53,8 +52,7 @@ def call_tl(database, freq, sourceDepth, sourceLat, sourceLon, receiveDepth,
|
||||
return Pos.r.range, Pos.r.depth, TL[0,0,:,:], bathym
|
||||
elif modelType == 'kraken':
|
||||
sd = np.array([sourceDepth]) # Source depth
|
||||
rd = np.linspace(0, receiveDepth, int(receiveDepth/10)) # Receiving depth
|
||||
[Pos, TL] = call_krakenc(freq, sd, rd, bathym, ssp, sed, base)
|
||||
[Pos, TL] = call_krakenc(freq, sd, bathym, ssp, sed, base)
|
||||
# Plot
|
||||
if isPlot:
|
||||
plt.pcolor(Pos.r.range, Pos.r.depth, TL[0,0,:,:], vmin=40, vmax=130, cmap='jet_r', shading='auto')
|
||||
@@ -66,7 +64,7 @@ def call_tl(database, freq, sourceDepth, sourceLat, sourceLon, receiveDepth,
|
||||
return Pos.r.range, Pos.r.depth, TL[0,0,:,:], bathym
|
||||
elif modelType == 'ram':
|
||||
# 调用ram模块
|
||||
[rd, rr, TL] = call_ram(freq, sourceDepth, receiveDepth, bathym, ssp, sed)
|
||||
[rd, rr, TL] = call_ram(freq, sourceDepth, bathym, ssp, sed)
|
||||
# Plot
|
||||
if isPlot:
|
||||
plt.pcolormesh(rr, rd, TL, vmin=60, vmax=130, cmap='jet_r', shading='auto')
|
||||
@@ -78,4 +76,14 @@ def call_tl(database, freq, sourceDepth, sourceLat, sourceLon, receiveDepth,
|
||||
return rr, rd, TL, bathym
|
||||
else:
|
||||
return [], [], [], bathym
|
||||
|
||||
|
||||
|
||||
|
||||
# # 创建类
|
||||
# database = DataBase()
|
||||
# # 设置时间段
|
||||
# database.set_timePeriod('06')
|
||||
# # 设置时间段
|
||||
# #database.set_timePeriod(timeIndex)
|
||||
# range, depth, tl, bathym = call_tl(database=database,freq=200, sourceDepth=60, sourceLat=19, sourceLon=127,
|
||||
# receiveLat=17.5, receiveLon=127.1, modelType='ram', isPlot=True)
|
||||
|
||||
在新工单中引用
屏蔽一个用户