Added para datasource to database, modified calling method of database
这个提交包含在:
+4
-10
@@ -277,22 +277,16 @@ def call_fangwei(freq, sd, rd, bathm, ssp, sed, base, isPlot=False):
|
||||
czdetail.reflectCz = []
|
||||
return Pos.r.range, Pos.r.depth, TL[0, 0, :, :], bathm, Rays, czdetail
|
||||
|
||||
def call_cz(ETOPO1Path, STPath, freq, lat, lon, azi, sourceDepth=10, receiveDepth=10, timeType='Annual', isPlot=False):
|
||||
def call_cz(database, freq, lat, lon, azi, sourceDepth=10, receiveDepth=10, isPlot=False):
|
||||
sd = np.array([sourceDepth]) # Source depth
|
||||
rd = np.linspace(0, receiveDepth, 351) # Receiving depth
|
||||
# 定义时间段
|
||||
timeIndex = timeType
|
||||
# 创建类
|
||||
data = DataBase(ETOPO1Path, STPath)
|
||||
# 设置时间段
|
||||
data.set_timePeriod(timeIndex)
|
||||
|
||||
results = []
|
||||
ranges, depths, TL, bathym, Rays = [], [], [], [], []
|
||||
|
||||
''' 计算单个方向的会聚区 '''
|
||||
if azi != None:
|
||||
[bathm, ssp, sed, base] = GetEnv(data, 25, Coord(lon, lat), R=100, azi=azi)
|
||||
[bathm, ssp, sed, base] = GetEnv(database, 25, Coord(lon, lat), R=100, azi=azi)
|
||||
if np.mean(bathm.d) < 2000:
|
||||
return results
|
||||
else:
|
||||
@@ -302,7 +296,7 @@ def call_cz(ETOPO1Path, STPath, freq, lat, lon, azi, sourceDepth=10, receiveDept
|
||||
return results
|
||||
|
||||
''' 计算8个方向的会聚区 '''
|
||||
[bathm, ssp, sed, base] = GetEnv(data, 25, Coord(lon, lat), R=100, azi=0)
|
||||
[bathm, ssp, sed, base] = GetEnv(database, 25, Coord(lon, lat), R=100, azi=0)
|
||||
if bathm.d[0] < 2000:
|
||||
# file_cz_data.write("各个方位都不会出现会聚区")
|
||||
return results
|
||||
@@ -310,7 +304,7 @@ def call_cz(ETOPO1Path, STPath, freq, lat, lon, azi, sourceDepth=10, receiveDept
|
||||
descripts = ["正北方向", "东北方向", "正东方向", "东南方向", "正南方向", "西南方向", "正西方向", "西北方向"]
|
||||
theta = np.arange(0, 359, 45)
|
||||
for i in range(8):
|
||||
[bathm, ssp, sed, base] = GetEnv(data, 25, Coord(lon, lat), R=100, azi=theta[i])
|
||||
[bathm, ssp, sed, base] = GetEnv(database, 25, Coord(lon, lat), R=100, azi=theta[i])
|
||||
if np.mean(bathm.d) < 2000:
|
||||
# 不会出现会聚区
|
||||
continue
|
||||
|
||||
在新工单中引用
屏蔽一个用户