更新微波终验代码

dev
tian jiax 2025-02-14 15:29:22 +08:00
parent 40750669cd
commit f9d5391f47
9 changed files with 51 additions and 30 deletions

View File

@ -320,7 +320,6 @@ class OrthoMain:
BlockProcess.unzip_dem(file_path, dem_path)
# tif_name = os.path.basename(file_path)
# shutil.copy(file_path, os.path.join(dem_path, tif_name))
para_path = os.path.join(self.__workspace_origin_path,para['ParaName'])
processing_paras.update({name: dem_path})
elif para['ParaType'] == 'Value':
if para['DataType'] == 'float':
@ -1008,3 +1007,5 @@ if __name__ == '__main__':
end = datetime.datetime.now()
logger.info('running use time: %s ' % (end - start))

View File

@ -49,7 +49,7 @@
<MinValue>DEFAULT</MinValue>
<MaxValue>DEFAULT</MaxValue>
<ParaValue>
F:\MicroWorkspace\20240826Ortho\GF3B_MH1_UFS_012705_E116.4_N44.2_20240422_L1A_DH_L10000343416.tar.gz</ParaValue>
D:\micro\test\slcData\GF3B_MYC_QPSI_008114_E121.6_N40.9_20230608_L1A_AHV_L10000196489.tar.gz</ParaValue>
<EnModification>True</EnModification>
<EnMultipleChoice>False</EnMultipleChoice>
<Control>File</Control>
@ -62,12 +62,12 @@
<ParaChsName>DEM数字高程影像</ParaChsName>
<Description>30m分辨率DEM数字高程影像tif</Description>
<ParaType>File</ParaType>
<DataType>File</DataType>
<DataType>zip</DataType>
<OptionValue>DEFAULT</OptionValue>
<MinValue>DEFAULT</MinValue>
<MaxValue>DEFAULT</MaxValue>
<ParaSource>Cal</ParaSource>
<ParaValue>F:\MicroWorkspace\20240826Ortho\dem</ParaValue>
<ParaValue>D:\micro\test\auxData\115E39N_COP30.zip;D:\micro\test\auxData\121E39N_COP30.zip</ParaValue>
<EnModification>True</EnModification>
<EnMultipleChoice>True</EnMultipleChoice>
<Control>File</Control>
@ -80,13 +80,13 @@
<ParaChsName>哨兵底图数据</ParaChsName>
<Description>同地区哨兵地图用于影像配准</Description>
<ParaType>File</ParaType>
<DataType>File</DataType>
<DataType>zip</DataType>
<ParaSource>Cal</ParaSource>
<OptionValue>DEFAULT</OptionValue>
<MinValue>DEFAULT</MinValue>
<MaxValue>DEFAULT</MaxValue>
<ParaValue>
F:\MicroWorkspace\20240826Ortho\S1GBM</ParaValue>
D:\micro\test\auxData\B0104_AS010M_E066N044T1_S1GBM.zip;D:\micro\test\auxData\B0104_AS010M_E066N045T1_S1GBM.zip</ParaValue>
<EnModification>True</EnModification>
<EnMultipleChoice>False</EnMultipleChoice>
<Control>File</Control>
@ -99,7 +99,7 @@
<ParaChsName>选择校正方法</ParaChsName>
<Description>2.RD</Description>
<ParaType>int</ParaType>
<DataType>int</DataType>
<DataType>float</DataType>
<OptionValue>DEFAULT</OptionValue>
<MinValue>DEFAULT</MinValue>
<MaxValue>DEFAULT</MaxValue>
@ -121,7 +121,7 @@
<ParaType>File</ParaType>
<DataType>tar.gz</DataType>
<ParaSource>Cal</ParaSource>
<ParaValue>D:\micro\WorkSpace\ortho\Output\GF3B_MH1_UFS_012705_E116.4_N44.2_20240422_L1A_DH_L10000343416-ortho.tar.gz</ParaValue>
<ParaValue>D:\micro\WorkSpace\ortho\Output\GF3B_MYC_QPSI_008114_E121.6_N40.9_20230608_L1A_AHV_L10000196489-ortho.tar.gz</ParaValue>
<OptionValue>DEFAULT</OptionValue>
<MinValue>DEFAULT</MinValue>
<MaxValue>DEFAULT</MaxValue>

View File

@ -1032,9 +1032,9 @@ class DEMProcess(object):
del in_ds, out_band, out_ds
@staticmethod
def unzip_file(zip_file_path, out_path):
def unzip_file(zip_file_path, out_path, dirName):
# 获取压缩文件所在的目录
out_path_merg = os.path.join(out_path, 'dem')
out_path_merg = os.path.join(out_path, dirName)
os.mkdir(out_path_merg)
para_value_list = zip_file_path.split(";")

View File

@ -127,15 +127,14 @@ class ScatteringMain:
processing_paras.update(tar_gz_dic)
elif para['DataType'] == 'zip':
# temp_para = para['ParaValue'].split(".")[0]
para_value_list = para['ParaValue'].split(";")
if len(para_value_list) == 1:
para_path = para['ParaValue']
if para_path != 'empty' and para_path != '':
file_path = BlockProcess.unzip_file(para_path, out_path)
processing_paras.update({name: os.path.dirname(file_path)})
else:
file_path = DEMProcess.unzip_file(para['ParaValue'], out_path)
processing_paras.update({name: file_path})
para_path_list = para['ParaValue'].split(";")
if len(para_path_list) != 0:
dem_path = os.path.join(self.__workspace_origin_path, para['ParaName'])
if os.path.exists(dem_path) is False:
os.mkdir(dem_path)
for file_path in para_path_list:
BlockProcess.unzip_dem(file_path, dem_path)
processing_paras.update({name: dem_path})
elif para['DataType'] == 'tif' or para['DataType'] == 'tiff': # 新增修改dem数据为文件绝对路径
if para['ParaValue'] != 'empty' and para['ParaValue'] != 'Empty' and para['ParaValue'] != '':
para_path_list = para['ParaValue'].split(";")
@ -579,7 +578,8 @@ if __name__ == '__main__':
start = datetime.datetime.now()
try:
if len(sys.argv) < 2:
xml_path = 'BackScattering_C_SAR_V3.xml'
# xml_path = 'BackScattering_C_SAR_V3.xml'
xml_path = 'CAL.xml'
else:
xml_path = sys.argv[1]
ScatteringMain = ScatteringMain(xml_path)

View File

@ -36,7 +36,7 @@
<ParaChsName>主影像时间</ParaChsName>
<Description>CSAR 主影像成像时间</Description>
<ParaType>Value</ParaType>
<DataType>string</DataType>
<DataType>float</DataType>
<OptionValue>DEFAULT</OptionValue>
<MinValue>DEFAULT</MinValue>
<MaxValue>DEFAULT</MaxValue>
@ -111,7 +111,7 @@
<Description>'Coherence threshold for estimating azimuth misregistration using enhanced
spectral diversity </Description>
<ParaType>Value</ParaType>
<DataType>string</DataType>
<DataType>float</DataType>
<OptionValue>DEFAULT</OptionValue>
<MinValue>DEFAULT</MinValue>
<MaxValue>DEFAULT</MaxValue>

View File

@ -36,7 +36,7 @@
<ParaChsName>主影像时间</ParaChsName>
<Description>CSAR 主影像成像时间</Description>
<ParaType>Value</ParaType>
<DataType>string</DataType>
<DataType>float</DataType>
<OptionValue>DEFAULT</OptionValue>
<MinValue>DEFAULT</MinValue>
<MaxValue>DEFAULT</MaxValue>
@ -111,7 +111,7 @@
<Description>'Coherence threshold for estimating azimuth misregistration using enhanced
spectral diversity </Description>
<ParaType>Value</ParaType>
<DataType>string</DataType>
<DataType>float</DataType>
<OptionValue>DEFAULT</OptionValue>
<MinValue>DEFAULT</MinValue>
<MaxValue>DEFAULT</MaxValue>

View File

@ -133,7 +133,7 @@ def geoCoding(tree,X_min,X_max,Y_min,Y_max,block_size,value_data,target_arr):
X_ids=XY_query[idx,0] # x
Y_ids=XY_query[idx,1] # y
XY_query=np.concatenate([X_ids.reshape(-1,1),Y_ids.reshape(-1,1)],axis=1)
dist_mask=dist[:,3]<=1 ####################################################################################
dist_mask=dist[:,3]<=10 ####################################################################################
idx=np.where(dist_mask==1)
ind=ind[idx,:][0,:,:]
dist=dist[idx,:][0,:,:]

View File

@ -89,10 +89,7 @@
<Parameter>
<ParaName>FeatureCombination</ParaName>
<ParaChsName>极化特征组合</ParaChsName>
<Description>可选极化特征组合一、共14种特征编号依次为0-13
Freeman表面散射p_s(0)、偶次散射p_d(1)、体散射p_v(2);
Yamaguchi表面散射f_s(3)、二次散射f_d(4)、体散射f_v(5)、螺旋体散射f_h(6);
Cloude-Pottier分解散射熵H(7)、反熵A(8)、平均散射角α(9)</Description>
<Description>可选极化特征组合一、共14种特征</Description>
<ParaType>Value</ParaType>
<DataType>string</DataType>
<OptionValue>DEFAULT</OptionValue>

View File

@ -1,6 +1,29 @@
# -*- mode: python ; coding: utf-8 -*-
import sys
from shutil import copy
import os
cwdpath = os.getcwd()
toolDir = os.path.join(cwdpath, 'tool')
if os.path.exists(toolDir):
os.remove(toolDir)
os.mkdir(toolDir)
source_folder = '../tool'
def copy_file(path_read, path_write):
names = os.listdir(path_read)
for name in names:
path_read_new = os.path.join(path_read, name)
path_write_new = os.path.join(path_write, name)
if os.path.isdir(path_read_new):
if not os.path.exists(path_write_new):
os.mkdir(path_write_new)
copy_file(path_read_new, path_write_new)
else:
copy(path_read_new, path_write_new)
copy_file(source_folder, toolDir)
block_cipher = None