修改大气延迟校正算法数据数据形式,多景填入到一个paramter中并用分号隔开
parent
38e7e75e6c
commit
3a0291ec6c
|
@ -45,7 +45,7 @@
|
||||||
<ParaType>File</ParaType>
|
<ParaType>File</ParaType>
|
||||||
<DataType>tar.gz</DataType>
|
<DataType>tar.gz</DataType>
|
||||||
<ParaSource>Cal</ParaSource>
|
<ParaSource>Cal</ParaSource>
|
||||||
<ParaValue>D:\BaiduNetdiskDownload\xibei\GF3C_KSC_QPSI_008440_E86.0_N44.7_20231113_L1A_AHV_L10000215825.tar.gz</ParaValue>
|
<ParaValue>F:\MicroWorkspace\def_GF3\GF3_KSC_FSII_036108_E120.1_N31.0_20230619_L1A_VHVV_L10006793347.tar.gz</ParaValue>
|
||||||
<EnModification>True</EnModification>
|
<EnModification>True</EnModification>
|
||||||
<EnMultipleChoice>False</EnMultipleChoice>
|
<EnMultipleChoice>False</EnMultipleChoice>
|
||||||
<Control>File</Control>
|
<Control>File</Control>
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
<ParaType>File</ParaType>
|
<ParaType>File</ParaType>
|
||||||
<DataType>File</DataType>
|
<DataType>File</DataType>
|
||||||
<ParaSource>Cal</ParaSource>
|
<ParaSource>Cal</ParaSource>
|
||||||
<ParaValue>D:\BaiduNetdiskDownload\dem_xb</ParaValue>
|
<ParaValue>F:\MicroWorkspace\原老师新增干涉数据20240413\copDem</ParaValue>
|
||||||
<EnModification>True</EnModification>
|
<EnModification>True</EnModification>
|
||||||
<EnMultipleChoice>True</EnMultipleChoice>
|
<EnMultipleChoice>True</EnMultipleChoice>
|
||||||
<Control>File</Control>
|
<Control>File</Control>
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
<ParaType>File</ParaType>
|
<ParaType>File</ParaType>
|
||||||
<DataType>tar.gz</DataType>
|
<DataType>tar.gz</DataType>
|
||||||
<ParaSource>Cal</ParaSource>
|
<ParaSource>Cal</ParaSource>
|
||||||
<ParaValue>D:\micro\WorkSpace\ortho\Output\GF3C_KSC_QPSI_008440_E86.0_N44.7_20231113_L1A_AHV_L10000215825-ortho.tar.gz</ParaValue>
|
<ParaValue>D:\micro\WorkSpace\ortho\Output\GF3_KSC_FSII_036108_E120.1_N31.0_20230619_L1A_VHVV_L10006793347-ortho.tar.gz</ParaValue>
|
||||||
<MaxValue>DEFAULT</MaxValue>
|
<MaxValue>DEFAULT</MaxValue>
|
||||||
<MinValue>DEFAULT</MinValue>
|
<MinValue>DEFAULT</MinValue>
|
||||||
<OptionValue>DEFAULT</OptionValue>
|
<OptionValue>DEFAULT</OptionValue>
|
||||||
|
|
|
@ -71,6 +71,7 @@ class AtmosphericMain:
|
||||||
self.__workspace_path = None
|
self.__workspace_path = None
|
||||||
self.__workspace_tem_dir_path = None
|
self.__workspace_tem_dir_path = None
|
||||||
self.__input_paras = {}
|
self.__input_paras = {}
|
||||||
|
self.input_paras = {}
|
||||||
|
|
||||||
self.__processing_paras = {}
|
self.__processing_paras = {}
|
||||||
self.__preprocessed_paras = {}
|
self.__preprocessed_paras = {}
|
||||||
|
@ -96,7 +97,7 @@ class AtmosphericMain:
|
||||||
return False
|
return False
|
||||||
if self.__check_handler.check_run_env() is False:
|
if self.__check_handler.check_run_env() is False:
|
||||||
return False
|
return False
|
||||||
input_para_names = ["MasterSarData", "AuxiliarySarData", "MasterNC", "AuxiliaryNC", "DEM", "box"]
|
input_para_names = ["MainImg", "SARS", "MasterNC", "AuxiliaryNC", "DEM", "box"]
|
||||||
if self.__check_handler.check_input_paras(input_para_names) is False:
|
if self.__check_handler.check_input_paras(input_para_names) is False:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -105,7 +106,7 @@ class AtmosphericMain:
|
||||||
self.__create_work_space()
|
self.__create_work_space()
|
||||||
self.__input_paras = self.__alg_xml_handler.get_input_paras() # 获取输入文件夹中的数据名、类型、地址
|
self.__input_paras = self.__alg_xml_handler.get_input_paras() # 获取输入文件夹中的数据名、类型、地址
|
||||||
self.__processing_paras = self.__init_processing_paras(self.__input_paras, self.__workspace_preprocessed_path) # 输出{文件名:地址}
|
self.__processing_paras = self.__init_processing_paras(self.__input_paras, self.__workspace_preprocessed_path) # 输出{文件名:地址}
|
||||||
SrcImageName = os.path.split(self.__input_paras["MasterSarData"]['ParaValue'])[1].split('.tar.gz')[0]
|
SrcImageName = os.path.split(self.input_paras["MasterSarData"])[1].split('.tar.gz')[0]
|
||||||
result_name = SrcImageName + tar + ".tar.gz"
|
result_name = SrcImageName + tar + ".tar.gz"
|
||||||
self.__out_para = os.path.join(self.__workspace_path, EXE_NAME, 'Output', result_name)
|
self.__out_para = os.path.join(self.__workspace_path, EXE_NAME, 'Output', result_name)
|
||||||
self.__alg_xml_handler.write_out_para("AtmosphericDelayProduct", self.__out_para) # 写入输出参数
|
self.__alg_xml_handler.write_out_para("AtmosphericDelayProduct", self.__out_para) # 写入输出参数
|
||||||
|
@ -131,7 +132,7 @@ class AtmosphericMain:
|
||||||
param: names:字典列表,每个字典为一个输入产品的配置信息
|
param: names:字典列表,每个字典为一个输入产品的配置信息
|
||||||
"""
|
"""
|
||||||
processing_paras = {}
|
processing_paras = {}
|
||||||
|
m_nc, a_nc = 0, 0
|
||||||
for name in names:
|
for name in names:
|
||||||
para = self.__input_paras[name]
|
para = self.__input_paras[name]
|
||||||
if para is None:
|
if para is None:
|
||||||
|
@ -146,16 +147,31 @@ class AtmosphericMain:
|
||||||
processing_paras.update({name: para_path})
|
processing_paras.update({name: para_path})
|
||||||
|
|
||||||
elif para['DataType'] == "zip":
|
elif para['DataType'] == "zip":
|
||||||
para_value_list = out_path.split(";")
|
if name == "MasterNC":
|
||||||
if len(para_value_list) == 1:
|
|
||||||
para_path = para['ParaValue']
|
para_path = para['ParaValue']
|
||||||
if para_path != 'empty' and para_path != '':
|
if para_path != 'empty' and para_path != '':
|
||||||
file_path = BlockProcess.unzip_file(para_path, out_path)
|
file_path = BlockProcess.unzip_file(para_path, out_path)
|
||||||
|
if self.mas_key_word in file_path:
|
||||||
|
m_nc = 1
|
||||||
|
processing_paras.update({name: file_path})
|
||||||
|
elif name == "AuxiliaryNC":
|
||||||
|
para_path = para['ParaValue']
|
||||||
|
if para_path != 'empty' and para_path != '':
|
||||||
|
file_path = BlockProcess.unzip_file(para_path, out_path)
|
||||||
|
if self.aux_key_word in file_path:
|
||||||
|
a_nc = 1
|
||||||
processing_paras.update({name: file_path})
|
processing_paras.update({name: file_path})
|
||||||
else:
|
else:
|
||||||
for n, para_value_zip in zip(range(len(para_value_list)), para_value_list):
|
para_value_list = out_path.split(";")
|
||||||
file_path = BlockProcess.unzip_file(para_value_zip, out_path)
|
if len(para_value_list) == 1:
|
||||||
processing_paras.update({name+str(n): file_path})
|
para_path = para['ParaValue']
|
||||||
|
if para_path != 'empty' and para_path != '':
|
||||||
|
file_path = BlockProcess.unzip_file(para_path, out_path)
|
||||||
|
processing_paras.update({name: file_path})
|
||||||
|
else:
|
||||||
|
for n, para_value_zip in zip(range(len(para_value_list)), para_value_list):
|
||||||
|
file_path = BlockProcess.unzip_file(para_value_zip, out_path)
|
||||||
|
processing_paras.update({name+str(n): file_path})
|
||||||
elif para['DataType'] == 'file':
|
elif para['DataType'] == 'file':
|
||||||
if name in ["MasterNC", "AuxiliaryNC"]:
|
if name in ["MasterNC", "AuxiliaryNC"]:
|
||||||
processing_paras.update({name: para_path})
|
processing_paras.update({name: para_path})
|
||||||
|
@ -235,6 +251,28 @@ class AtmosphericMain:
|
||||||
shutil.copy(file_path, os.path.join(dem_path, tif_name))
|
shutil.copy(file_path, os.path.join(dem_path, tif_name))
|
||||||
para_path = os.path.join(self.__workspace_origin_path, para['ParaName'])
|
para_path = os.path.join(self.__workspace_origin_path, para['ParaName'])
|
||||||
processing_paras.update({'orbits': para_path})
|
processing_paras.update({'orbits': para_path})
|
||||||
|
if name == 'MainImg':
|
||||||
|
self.mas_key_word = para['ParaValue']
|
||||||
|
if name == 'SARS':
|
||||||
|
if para['DataType'] == 'File':
|
||||||
|
processing_paras.update({'slc': para['ParaValue']})
|
||||||
|
else:
|
||||||
|
para_path_list = para['ParaValue'].split(";")
|
||||||
|
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:
|
||||||
|
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({'slc': para_path})
|
||||||
|
for pa in para_path_list:
|
||||||
|
key_word = os.path.basename(pa).split('_')[7]
|
||||||
|
if key_word == self.mas_key_word:
|
||||||
|
self.input_paras.update({"MasterSarData": pa})
|
||||||
|
else:
|
||||||
|
self.aux_key_word = key_word
|
||||||
|
self.input_paras.update({"AuxiliarySarData": pa})
|
||||||
if name == 'box':
|
if name == 'box':
|
||||||
datas = para['ParaValue'].split(';')
|
datas = para['ParaValue'].split(';')
|
||||||
if len(datas) != 4:
|
if len(datas) != 4:
|
||||||
|
@ -749,8 +787,8 @@ class AtmosphericMain:
|
||||||
aux_phase_bias_array = Ady().cal_phase_bias(out_aux_file, out_aux_ztd_path, aux_lambd) # 辅影像延迟相位数组
|
aux_phase_bias_array = Ady().cal_phase_bias(out_aux_file, out_aux_ztd_path, aux_lambd) # 辅影像延迟相位数组
|
||||||
|
|
||||||
# 主辅影像延迟相位存为tif
|
# 主辅影像延迟相位存为tif
|
||||||
srcName_m = os.path.split(self.__input_paras["MasterSarData"]['ParaValue'])[1].split('.tar.gz')[0]
|
srcName_m = os.path.split(self.input_paras["MasterSarData"])[1].split('.tar.gz')[0]
|
||||||
srcName_a = os.path.split(self.__input_paras["AuxiliarySarData"]['ParaValue'])[1].split('.tar.gz')[0]
|
srcName_a = os.path.split(self.input_paras["AuxiliarySarData"])[1].split('.tar.gz')[0]
|
||||||
mas_phase_bias_path = os.path.join(self.__workspace_atmos_dely_path, srcName_m + "-PhaseBias.tif") # 输出的产品数据1/3
|
mas_phase_bias_path = os.path.join(self.__workspace_atmos_dely_path, srcName_m + "-PhaseBias.tif") # 输出的产品数据1/3
|
||||||
aux_phase_bias_path = os.path.join(self.__workspace_atmos_dely_path, srcName_a + "-PhaseBias.tif") # 输出的产品数据2/3
|
aux_phase_bias_path = os.path.join(self.__workspace_atmos_dely_path, srcName_a + "-PhaseBias.tif") # 输出的产品数据2/3
|
||||||
|
|
||||||
|
@ -786,7 +824,7 @@ class AtmosphericMain:
|
||||||
out_path1 = os.path.join(tem_folder, "trans_geo_projcs.tif")
|
out_path1 = os.path.join(tem_folder, "trans_geo_projcs.tif")
|
||||||
out_path2 = os.path.join(tem_folder, "trans_projcs_geo.tif")
|
out_path2 = os.path.join(tem_folder, "trans_projcs_geo.tif")
|
||||||
|
|
||||||
SrcImageName = os.path.split(self.__input_paras["MasterSarData"]['ParaValue'])[1].split('.tar.gz')[0]
|
SrcImageName = os.path.split(self.input_paras["MasterSarData"])[1].split('.tar.gz')[0]
|
||||||
meta_xml_path = os.path.join(self.__workspace_atmos_dely_path, SrcImageName + tar + ".meta.xml")
|
meta_xml_path = os.path.join(self.__workspace_atmos_dely_path, SrcImageName + tar + ".meta.xml")
|
||||||
|
|
||||||
para_dict = CreateMetaDict(image_path, self.ori_xml_m, self.__workspace_atmos_dely_path,
|
para_dict = CreateMetaDict(image_path, self.ori_xml_m, self.__workspace_atmos_dely_path,
|
||||||
|
@ -869,8 +907,8 @@ class AtmosphericMain:
|
||||||
Ady().write_ztd_tif(dem_file, base_file, a_ztd, out_aux_ztd_path) # ztd数组->ztd影像
|
Ady().write_ztd_tif(dem_file, base_file, a_ztd, out_aux_ztd_path) # ztd数组->ztd影像
|
||||||
Ady().write_ztd_tif(dem_file, base_file, m_ztd, out_mas_ztd_path) # ztd数组->ztd影像
|
Ady().write_ztd_tif(dem_file, base_file, m_ztd, out_mas_ztd_path) # ztd数组->ztd影像
|
||||||
|
|
||||||
srcName_m = os.path.split(self.__input_paras["MasterSarData"]['ParaValue'])[1].split('.tar.gz')[0]
|
srcName_m = os.path.split(self.input_paras["MasterSarData"])[1].split('.tar.gz')[0]
|
||||||
srcName_a = os.path.split(self.__input_paras["AuxiliarySarData"]['ParaValue'])[1].split('.tar.gz')[0]
|
srcName_a = os.path.split(self.input_paras["AuxiliarySarData"])[1].split('.tar.gz')[0]
|
||||||
geo_mas_ztd_path = self.__workspace_atmos_dely_path + srcName_m + "-ZTD.tif"
|
geo_mas_ztd_path = self.__workspace_atmos_dely_path + srcName_m + "-ZTD.tif"
|
||||||
geo_aux_ztd_path = self.__workspace_atmos_dely_path + srcName_a + "-ZTD.tif"
|
geo_aux_ztd_path = self.__workspace_atmos_dely_path + srcName_a + "-ZTD.tif"
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
<ParaType>File</ParaType>
|
<ParaType>File</ParaType>
|
||||||
<DataType>tar.gz</DataType>
|
<DataType>tar.gz</DataType>
|
||||||
<ParaSource>Cal</ParaSource>
|
<ParaSource>Cal</ParaSource>
|
||||||
<ParaValue>D:\BaiduNetdiskDownload\xibei\GF3B_KSC_QPSI_010328_E86.1_N44.3_20231109_L1A_AHV_L10000262133.tar.gz</ParaValue>
|
<ParaValue>F:\MicroWorkspace\def_GF3\GF3_KSC_FSII_036108_E120.1_N31.0_20230619_L1A_VHVV_L10006793347.tar.gz</ParaValue>
|
||||||
<EnModification>True</EnModification>
|
<EnModification>True</EnModification>
|
||||||
<EnMultipleChoice>False</EnMultipleChoice>
|
<EnMultipleChoice>False</EnMultipleChoice>
|
||||||
<Control>File</Control>
|
<Control>File</Control>
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
<ParaType>File</ParaType>
|
<ParaType>File</ParaType>
|
||||||
<DataType>File</DataType>
|
<DataType>File</DataType>
|
||||||
<ParaSource>Cal</ParaSource>
|
<ParaSource>Cal</ParaSource>
|
||||||
<ParaValue>D:\BaiduNetdiskDownload\dem_xb</ParaValue>
|
<ParaValue>F:\MicroWorkspace\原老师新增干涉数据20240413\copDem</ParaValue>
|
||||||
<EnModification>True</EnModification>
|
<EnModification>True</EnModification>
|
||||||
<EnMultipleChoice>True</EnMultipleChoice>
|
<EnMultipleChoice>True</EnMultipleChoice>
|
||||||
<Control>File</Control>
|
<Control>File</Control>
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
<ParaType>File</ParaType>
|
<ParaType>File</ParaType>
|
||||||
<DataType>tar.gz</DataType>
|
<DataType>tar.gz</DataType>
|
||||||
<ParaSource>Cal</ParaSource>
|
<ParaSource>Cal</ParaSource>
|
||||||
<ParaValue>D:\micro\WorkSpace\BackScattering\Output\GF3B_KSC_QPSI_010328_E86.1_N44.3_20231109_L1A_AHV_L10000262133-cal.tar.gz</ParaValue>
|
<ParaValue>D:\micro\WorkSpace\BackScattering\Output\GF3_KSC_FSII_036108_E120.1_N31.0_20230619_L1A_VHVV_L10006793347-cal.tar.gz</ParaValue>
|
||||||
<MaxValue>DEFAULT</MaxValue>
|
<MaxValue>DEFAULT</MaxValue>
|
||||||
<MinValue>DEFAULT</MinValue>
|
<MinValue>DEFAULT</MinValue>
|
||||||
<OptionValue>DEFAULT</OptionValue>
|
<OptionValue>DEFAULT</OptionValue>
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -39,6 +39,8 @@ else:
|
||||||
DEBUG = False
|
DEBUG = False
|
||||||
tar = r'-' + cf.get('tar')
|
tar = r'-' + cf.get('tar')
|
||||||
productLevel = cf.get('productLevel')
|
productLevel = cf.get('productLevel')
|
||||||
|
alks = cf.get('alks')
|
||||||
|
rlks = cf.get('rlks')
|
||||||
file = fileHandle(DEBUG)
|
file = fileHandle(DEBUG)
|
||||||
LogHandler.init_log_handler('run_log\\' + EXE_NAME)
|
LogHandler.init_log_handler('run_log\\' + EXE_NAME)
|
||||||
logger = logging.getLogger("mylog")
|
logger = logging.getLogger("mylog")
|
||||||
|
@ -94,6 +96,7 @@ class DeformationMain:
|
||||||
SrcImagePath = self.__input_paras["SARS"]['ParaValue']
|
SrcImagePath = self.__input_paras["SARS"]['ParaValue']
|
||||||
paths = SrcImagePath.split(';')
|
paths = SrcImagePath.split(';')
|
||||||
SrcImageName = os.path.split(paths[0])[1].split('.tar.gz')[0]
|
SrcImageName = os.path.split(paths[0])[1].split('.tar.gz')[0]
|
||||||
|
self.mainName = SrcImageName.split('_')[6]
|
||||||
result_name = SrcImageName + tar + ".tar.gz"
|
result_name = SrcImageName + tar + ".tar.gz"
|
||||||
self.__out_para = os.path.join(self.__workspace_path, EXE_NAME, 'Output', result_name)
|
self.__out_para = os.path.join(self.__workspace_path, EXE_NAME, 'Output', result_name)
|
||||||
self.__alg_xml_handler.write_out_para("DemProduct", self.__out_para)
|
self.__alg_xml_handler.write_out_para("DemProduct", self.__out_para)
|
||||||
|
@ -183,12 +186,15 @@ class DeformationMain:
|
||||||
if name == 'MainImg':
|
if name == 'MainImg':
|
||||||
processing_paras.update({'mainimg': para['ParaValue']})
|
processing_paras.update({'mainimg': para['ParaValue']})
|
||||||
if name == 'box':
|
if name == 'box':
|
||||||
datas = para['ParaValue'].split(';')
|
if para['ParaValue'] == 'empty':
|
||||||
if len(datas) != 4:
|
processing_paras.update({'box': 'empty'})
|
||||||
msg = 'para: box is error!box:' + para['ParaValue']
|
else:
|
||||||
raise Exception(msg)
|
datas = para['ParaValue'].split(';')
|
||||||
box = datas[0] + ' ' + datas[1] + ' ' + datas[2] + ' ' + datas[3]
|
if len(datas) != 4:
|
||||||
processing_paras.update({'box': box})
|
msg = 'para: box is error!box:' + para['ParaValue']
|
||||||
|
raise Exception(msg)
|
||||||
|
box = datas[0] + ' ' + datas[1] + ' ' + datas[2] + ' ' + datas[3]
|
||||||
|
processing_paras.update({'box': box})
|
||||||
if name == 'AuxDir':
|
if name == 'AuxDir':
|
||||||
if para['DataType'] == 'File':
|
if para['DataType'] == 'File':
|
||||||
processing_paras.update({'AuxDir': para['ParaValue']})
|
processing_paras.update({'AuxDir': para['ParaValue']})
|
||||||
|
@ -404,6 +410,11 @@ class DeformationMain:
|
||||||
CreateProductXml(para_dict, model_path, meta_xml_path).create_standard_xml()
|
CreateProductXml(para_dict, model_path, meta_xml_path).create_standard_xml()
|
||||||
return meta_xml_path
|
return meta_xml_path
|
||||||
|
|
||||||
|
def isce_run_steps(self, run_steps, target):
|
||||||
|
for i in range(0, len(run_steps)):
|
||||||
|
uwm_file = os.path.join(self.__workspace_isce_path, "run_files", run_steps[i])
|
||||||
|
shutil.move(uwm_file, target)
|
||||||
|
|
||||||
def process_handle(self,start):
|
def process_handle(self,start):
|
||||||
|
|
||||||
# 执行isce2.5生成干涉图
|
# 执行isce2.5生成干涉图
|
||||||
|
@ -413,8 +424,8 @@ class DeformationMain:
|
||||||
isce_work_space = r"/".join(self.__workspace_isce_path.split("\\"))
|
isce_work_space = r"/".join(self.__workspace_isce_path.split("\\"))
|
||||||
isce_work_space = '/cygdrive/' + isce_work_space.replace(":/", "/")
|
isce_work_space = '/cygdrive/' + isce_work_space.replace(":/", "/")
|
||||||
|
|
||||||
box = "'" + self.__in_processing_paras['box'] + "'"
|
# main_img = self.__in_processing_paras['mainimg']
|
||||||
main_img = self.__in_processing_paras['mainimg']
|
main_img = self.mainName
|
||||||
isce_exe_dir = r"/".join(os.path.join(self.env_str, "ISCEApp").split("\\"))
|
isce_exe_dir = r"/".join(os.path.join(self.env_str, "ISCEApp").split("\\"))
|
||||||
EsdCoherenceThreshold = self.__in_processing_paras['EsdCoherenceThreshold']
|
EsdCoherenceThreshold = self.__in_processing_paras['EsdCoherenceThreshold']
|
||||||
|
|
||||||
|
@ -439,11 +450,6 @@ class DeformationMain:
|
||||||
logger.info('demhgt2wgs finish!')
|
logger.info('demhgt2wgs finish!')
|
||||||
logger.info('progress bar: 5%')
|
logger.info('progress bar: 5%')
|
||||||
|
|
||||||
# cum_connections = self.__in_processing_paras['NumConnections']
|
|
||||||
# cmd = "stackSentinel.exe -s {} -d {} -a {} -o {} -w {} -c {} -b {} -m {} -n '1 2 3' -p 'vv' -W offset -e {} --exeabsolute_dir {}".format(slc_dir, dem_path, aux_dir, orbits_dir, isce_work_space, cum_connections, box, main_img, EsdCoherenceThreshold, isce_exe_dir)
|
|
||||||
# result = self.isce_stackSentinel(slc_dir, dem_path, aux_dir, orbits_dir, isce_work_space, main_img,
|
|
||||||
# isce_exe_dir, box, EsdCoherenceThreshold)
|
|
||||||
# os.chdir(isce_exe_dir)
|
|
||||||
# slc数据转isce格式
|
# slc数据转isce格式
|
||||||
|
|
||||||
slc_dir = r"/".join(self.__in_processing_paras['slc'].split("\\")) + "/"
|
slc_dir = r"/".join(self.__in_processing_paras['slc'].split("\\")) + "/"
|
||||||
|
@ -466,15 +472,35 @@ class DeformationMain:
|
||||||
logger.info('progress bar: 10%')
|
logger.info('progress bar: 10%')
|
||||||
|
|
||||||
# os.chdir(isce_exe_dir)
|
# os.chdir(isce_exe_dir)
|
||||||
cmd = "stackStripMap.exe -s {} -w {} -d {} -m {} -a {} -r {} -x {} -u 'snaphu' --nofocus".format(out_slc_dir, isce_work_space, dem_path, main_img, 3, 3, box)
|
if self.__in_processing_paras['box'] == 'empty':
|
||||||
logger.info('stackStripMap_cmd:{}'.format(cmd))
|
box = ''
|
||||||
result = os.system(cmd)
|
cmd = "stackStripMap.exe -s {} -w {} -d {} -m {} -a {} -r {} -u 'snaphu' --nofocus".format(out_slc_dir,
|
||||||
logger.info('cmd_result:{}'.format(result))
|
isce_work_space,
|
||||||
logger.info('stackStripMap finish!')
|
dem_path,
|
||||||
|
main_img, alks, rlks)
|
||||||
|
logger.info('stackStripMap_cmd:{}'.format(cmd))
|
||||||
|
result = os.system(cmd)
|
||||||
|
logger.info('cmd_result:{}'.format(result))
|
||||||
|
logger.info('stackStripMap finish!')
|
||||||
|
run_files = os.path.join(self.__workspace_isce_path, 'run_files')
|
||||||
|
for file in list(glob.glob(os.path.join(run_files, '*.job'))):
|
||||||
|
os.remove(file)
|
||||||
|
run_steps = ["run_07_grid_baseline"]
|
||||||
|
self.isce_run_steps(run_steps, self.__workspace_isce_path)
|
||||||
|
else:
|
||||||
|
box = "'" + self.__in_processing_paras['box'] + "'"
|
||||||
|
cmd = "stackStripMap.exe -s {} -w {} -d {} -m {} -a {} -r {} -x {} -u 'snaphu' --nofocus".format(
|
||||||
|
out_slc_dir, isce_work_space, dem_path, main_img, alks, rlks, box)
|
||||||
|
logger.info('stackStripMap_cmd:{}'.format(cmd))
|
||||||
|
result = os.system(cmd)
|
||||||
|
logger.info('cmd_result:{}'.format(result))
|
||||||
|
logger.info('stackStripMap finish!')
|
||||||
|
|
||||||
run_files = os.path.join(self.__workspace_isce_path, 'run_files')
|
run_files = os.path.join(self.__workspace_isce_path, 'run_files')
|
||||||
for file in list(glob.glob(os.path.join(run_files, '*.job'))):
|
for file in list(glob.glob(os.path.join(run_files, '*.job'))):
|
||||||
os.remove(file)
|
os.remove(file)
|
||||||
|
run_steps = ["run_08_grid_baseline"]
|
||||||
|
self.isce_run_steps(run_steps, self.__workspace_isce_path)
|
||||||
cmd = ['-e', isce_exe_dir, '-o', self.__workspace_isce_path]
|
cmd = ['-e', isce_exe_dir, '-o', self.__workspace_isce_path]
|
||||||
|
|
||||||
logger.info('autorun_cmd:{}'.format(cmd))
|
logger.info('autorun_cmd:{}'.format(cmd))
|
||||||
|
@ -515,6 +541,8 @@ class DeformationMain:
|
||||||
if os.path.exists(temp_folder) is False:
|
if os.path.exists(temp_folder) is False:
|
||||||
os.mkdir(temp_folder)
|
os.mkdir(temp_folder)
|
||||||
shutil.copy(meta_xml_path, out_xml)
|
shutil.copy(meta_xml_path, out_xml)
|
||||||
|
# out_def = os.path.join(temp_folder, os.path.basename(dem_product))
|
||||||
|
# shutil.copy(dem_product, out_def)
|
||||||
self.make_targz(self.__out_para, self.__product_dic)
|
self.make_targz(self.__out_para, self.__product_dic)
|
||||||
|
|
||||||
logger.info("write quick view and .tar.gz finish")
|
logger.info("write quick view and .tar.gz finish")
|
||||||
|
@ -529,7 +557,7 @@ if __name__ == '__main__':
|
||||||
start = datetime.datetime.now()
|
start = datetime.datetime.now()
|
||||||
try:
|
try:
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
xml_path = r'Deformation.xml'
|
xml_path = r'Deformation_C_SAR_V3.xml'
|
||||||
else:
|
else:
|
||||||
xml_path = sys.argv[1]
|
xml_path = sys.argv[1]
|
||||||
Main = DeformationMain(xml_path)
|
Main = DeformationMain(xml_path)
|
||||||
|
|
|
@ -79,7 +79,7 @@
|
||||||
<MinValue>DEFAULT</MinValue>
|
<MinValue>DEFAULT</MinValue>
|
||||||
<MaxValue>DEFAULT</MaxValue>
|
<MaxValue>DEFAULT</MaxValue>
|
||||||
<ParaSource>Man</ParaSource>
|
<ParaSource>Man</ParaSource>
|
||||||
<ParaValue>34.60;34.67;113.05;113.18</ParaValue>
|
<ParaValue>34.62;34.67;113.15;113.18</ParaValue>
|
||||||
<EnModification>True</EnModification>
|
<EnModification>True</EnModification>
|
||||||
<EnMultipleChoice>True</EnMultipleChoice>
|
<EnMultipleChoice>True</EnMultipleChoice>
|
||||||
<Control>UploadInput</Control>
|
<Control>UploadInput</Control>
|
||||||
|
@ -137,8 +137,7 @@
|
||||||
<MinValue>DEFAULT</MinValue>
|
<MinValue>DEFAULT</MinValue>
|
||||||
<MaxValue>DEFAULT</MaxValue>
|
<MaxValue>DEFAULT</MaxValue>
|
||||||
<NoDataValue>-9999</NoDataValue>
|
<NoDataValue>-9999</NoDataValue>
|
||||||
<ParaValue>
|
<ParaValue>D:\micro\WorkSpace\Deformation\Output\GF3_SAY_FSI_001614_E113.2_N34.5_20161129_L1A_HHHV_L10002015686-DF.tar.gz</ParaValue>
|
||||||
D:\micro\WorkSpace\Deformation\Output\GF3_SAY_FSI_001614_E113.2_N34.5_20161129_L1A_HHHV_L10002015686-DF.tar.gz</ParaValue>
|
|
||||||
</Parameter>
|
</Parameter>
|
||||||
</Outputs>
|
</Outputs>
|
||||||
</AlgCompt>
|
</AlgCompt>
|
||||||
|
|
|
@ -4,7 +4,8 @@
|
||||||
# 算法名称。修改临时工作区生成临时文件的名称,日志名称;
|
# 算法名称。修改临时工作区生成临时文件的名称,日志名称;
|
||||||
exe_name = Deformation
|
exe_name = Deformation
|
||||||
# 开启调试模式则不删除临时工作区,True:开启调试,False:不开启调试
|
# 开启调试模式则不删除临时工作区,True:开启调试,False:不开启调试
|
||||||
debug = True
|
debug = False
|
||||||
|
alks = 10
|
||||||
|
rlks = 10
|
||||||
tar = DF
|
tar = DF
|
||||||
productLevel = 5
|
productLevel = 5
|
||||||
|
|
|
@ -510,9 +510,9 @@ class DemMain:
|
||||||
for file in os.listdir(slc_paths):
|
for file in os.listdir(slc_paths):
|
||||||
if file.endswith('.meta.xml'):
|
if file.endswith('.meta.xml'):
|
||||||
self.ori_xml = os.path.join(slc_paths, file)
|
self.ori_xml = os.path.join(slc_paths, file)
|
||||||
# lamda = MetaDataHandler.get_lamda(ori_xml)
|
lamda = MetaDataHandler.get_lamda(self.ori_xml)
|
||||||
# dem_proPath = dem.get_Dem(self.__workspace_isce_path, temp_path,out_dir, dem_product, lamda) # 生成tif
|
dem_proPath = dem.get_Dem(self.__workspace_isce_path, temp_path,out_dir, dem_product, lamda) # 生成tif
|
||||||
dem_proPath = dem.get_Dem(self.__workspace_isce_path, temp_path,out_dir, dem_product) # 生成tif
|
# dem_proPath = dem.get_Dem(self.__workspace_isce_path, temp_path,out_dir, dem_product) # 生成tif
|
||||||
|
|
||||||
self.imageHandler.write_quick_view(dem_product) # 生成快视图
|
self.imageHandler.write_quick_view(dem_product) # 生成快视图
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,17 @@ def get_filt_fine_unw_path(isce_work_path):
|
||||||
|
|
||||||
return flit_fine_unw_path_ls
|
return flit_fine_unw_path_ls
|
||||||
|
|
||||||
|
def get_filt_fine_cor_path(isce_work_path):
|
||||||
|
flit_fine_cor_path_ls=[]
|
||||||
|
interferograms_path=os.path.join(isce_work_path,"Igrams")
|
||||||
|
for rootdir, dirs, files in os.walk(interferograms_path):
|
||||||
|
for filename in files:
|
||||||
|
# if filename=="filt_fine.unw.vrt":
|
||||||
|
if filename.endswith(".cor.vrt"):
|
||||||
|
flit_fine_cor_path_ls.append(os.path.join(rootdir, filename))
|
||||||
|
|
||||||
|
return flit_fine_cor_path_ls
|
||||||
|
|
||||||
def info_VRT(vrt_path):
|
def info_VRT(vrt_path):
|
||||||
vrt_data=gdal.Open(vrt_path,gdal.GA_ReadOnly)
|
vrt_data=gdal.Open(vrt_path,gdal.GA_ReadOnly)
|
||||||
print("width:\t",vrt_data.RasterXSize)
|
print("width:\t",vrt_data.RasterXSize)
|
||||||
|
@ -136,12 +147,61 @@ def geoCoding(tree,X_min,X_max,Y_min,Y_max,block_size,value_data,target_arr):
|
||||||
|
|
||||||
return target_arr
|
return target_arr
|
||||||
|
|
||||||
def get_Dem(isce_work_path,temp_work_path,pack_path,product_name):
|
def detrend_2d(unw_filename,cor_filename, out_file):
|
||||||
|
|
||||||
|
unwImg = ImageHandler.get_data(unw_filename)
|
||||||
|
# unwImg = unwImgt[1,:,:]
|
||||||
|
corImg = ImageHandler.get_data(cor_filename)
|
||||||
|
height = corImg.shape[0]
|
||||||
|
width = corImg.shape[1]
|
||||||
|
lines_intv = int(np.floor(height * 0.005))
|
||||||
|
width_intv = int(np.floor(width * 0.005))
|
||||||
|
x = np.arange(1, width, width_intv)
|
||||||
|
y = np.arange(1, height, lines_intv)
|
||||||
|
|
||||||
|
pointX = []
|
||||||
|
pointY = []
|
||||||
|
pointZ = []
|
||||||
|
|
||||||
|
for i in y:
|
||||||
|
for j in x:
|
||||||
|
if corImg[i,j] < 0.2:
|
||||||
|
continue
|
||||||
|
else:
|
||||||
|
pointX.append(j)
|
||||||
|
pointY.append(i)
|
||||||
|
pointZ.append(unwImg[i,j])
|
||||||
|
|
||||||
|
int_xy = np.multiply(np.array(pointX), np.array(pointY))
|
||||||
|
int_xx = np.multiply(np.array(pointX), np.array(pointX))
|
||||||
|
int_yy = np.multiply(np.array(pointY), np.array(pointY))
|
||||||
|
|
||||||
|
design_matrix = np.column_stack((np.array(pointX), np.array(pointY), int_xy, int_xx, int_yy))
|
||||||
|
X = np.linalg.lstsq(design_matrix, pointZ, rcond=None)[0]
|
||||||
|
a = X[0] # 系数1
|
||||||
|
b = X[1] # 系数2
|
||||||
|
c = X[2] # 系数3
|
||||||
|
d = X[3] # 系数4
|
||||||
|
e = X[4] # 系数5
|
||||||
|
|
||||||
|
dtd_unw = np.zeros((height, width), dtype=float)
|
||||||
|
for ii in range(width):
|
||||||
|
for jj in range(height):
|
||||||
|
str = a * (ii+1) + b * (jj+1) + c * (ii+1) * (jj+1) + d * (ii+1) * (ii+1) + e * (jj+1) * (jj+1)
|
||||||
|
# dtd_unw[ii, jj] = unwImg[ii, jj] - str
|
||||||
|
dtd_unw[jj, ii] = unwImg[jj, ii] - str
|
||||||
|
dtd_unw[np.where(corImg==0)] = 0
|
||||||
|
ImageHandler.write_img(out_file, '', [0.0, 1.0, 0.0, 0.0, 0.0, 1.0], dtd_unw)
|
||||||
|
return dtd_unw
|
||||||
|
|
||||||
|
|
||||||
|
def get_Dem(isce_work_path, temp_work_path, pack_path, product_name, lamda):
|
||||||
# lamda=get_lambel_sentinel(isce_work_path)
|
# lamda=get_lambel_sentinel(isce_work_path)
|
||||||
lamda=0.055517
|
|
||||||
filt_topophase_unw_path=get_filt_fine_unw_path(isce_work_path)[0]
|
filt_topophase_unw_path=get_filt_fine_unw_path(isce_work_path)[0]
|
||||||
unw_tiff_path=os.path.join(temp_work_path,"unw.tiff")
|
unw_tiff_path=os.path.join(temp_work_path,"unw.tiff")
|
||||||
vrt2tiff(filt_topophase_unw_path,unw_tiff_path,1)
|
vrt2tiff(filt_topophase_unw_path,unw_tiff_path,1)
|
||||||
|
|
||||||
|
filt_topophase_cor_path = get_filt_fine_cor_path(isce_work_path)[0]
|
||||||
|
|
||||||
[lon_path,lat_path]=get_long_lat_path(isce_work_path)
|
[lon_path,lat_path]=get_long_lat_path(isce_work_path)
|
||||||
lon_tiff_path=os.path.join(temp_work_path,"lon.tiff")
|
lon_tiff_path=os.path.join(temp_work_path,"lon.tiff")
|
||||||
|
@ -166,7 +226,9 @@ def get_Dem(isce_work_path,temp_work_path,pack_path,product_name):
|
||||||
lat = lat_data[:, lat_data.shape[1]-1]
|
lat = lat_data[:, lat_data.shape[1]-1]
|
||||||
lat_min = np.min(lat)
|
lat_min = np.min(lat)
|
||||||
lat_max = np.max(lat)
|
lat_max = np.max(lat)
|
||||||
unw_data=read_tiff_dataset(unw_tiff_path,band_idx=0)
|
out_detrend_path = os.path.join(temp_work_path, "detrend_unw.tif")
|
||||||
|
unw_data = detrend_2d(unw_tiff_path, filt_topophase_cor_path, out_detrend_path)
|
||||||
|
# unw_data=read_tiff_dataset(unw_tiff_path,band_idx=0)
|
||||||
hgt_data=read_tiff_dataset(hgt_tiff_path,band_idx=0)
|
hgt_data=read_tiff_dataset(hgt_tiff_path,band_idx=0)
|
||||||
|
|
||||||
los_data=los_data.reshape(-1)
|
los_data=los_data.reshape(-1)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<Root>
|
<Root>
|
||||||
<TaskID>CSAR_202107275419_0001-0</TaskID>
|
<TaskID>CSAR_202107275419_0001-0</TaskID>
|
||||||
<WorkSpace>E:\Result_GF3\</WorkSpace>
|
<WorkSpace>D:\micro\WorkSpace\</WorkSpace>
|
||||||
<AlgCompt>
|
<AlgCompt>
|
||||||
<DataTransModel>File</DataTransModel>
|
<DataTransModel>File</DataTransModel>
|
||||||
<Artificial>ElementAlg</Artificial>
|
<Artificial>ElementAlg</Artificial>
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
<ParaType>File</ParaType>
|
<ParaType>File</ParaType>
|
||||||
<DataType>tar.gz</DataType>
|
<DataType>tar.gz</DataType>
|
||||||
<ParaSource>Man</ParaSource>
|
<ParaSource>Man</ParaSource>
|
||||||
<ParaValue>E:\GF3Data\leafindex\GF3_MDJ_QPSI_031847_E116.4_N43.9_20220828_L1A_AHV_L10006708819-cal.tar.gz</ParaValue>
|
<ParaValue>E:\辅助数据\GF3Data\leafindex\GF3_MDJ_QPSI_031847_E116.4_N43.9_20220828_L1A_AHV_L10006708819-cal.tar.gz</ParaValue>
|
||||||
<EnModification>True</EnModification>
|
<EnModification>True</EnModification>
|
||||||
<EnMultipleChoice>False</EnMultipleChoice>
|
<EnMultipleChoice>False</EnMultipleChoice>
|
||||||
<Control>File</Control>
|
<Control>File</Control>
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
<ParaType>File</ParaType>
|
<ParaType>File</ParaType>
|
||||||
<DataType>zip</DataType>
|
<DataType>zip</DataType>
|
||||||
<ParaSource>Man</ParaSource>
|
<ParaSource>Man</ParaSource>
|
||||||
<ParaValue>E:\GF3Data\leafindex\CSAR_leaf_NEW_soil_moisture.zip</ParaValue>
|
<ParaValue>E:\辅助数据\GF3Data\leafindex\CSAR_leaf_NEW_soil_moisture.zip</ParaValue>
|
||||||
<EnModification>True</EnModification>
|
<EnModification>True</EnModification>
|
||||||
<EnMultipleChoice>False</EnMultipleChoice>
|
<EnMultipleChoice>False</EnMultipleChoice>
|
||||||
<Control>File</Control>
|
<Control>File</Control>
|
||||||
|
@ -98,7 +98,7 @@
|
||||||
<ParaType>File</ParaType>
|
<ParaType>File</ParaType>
|
||||||
<DataType>zip</DataType>
|
<DataType>zip</DataType>
|
||||||
<ParaSource>Man</ParaSource>
|
<ParaSource>Man</ParaSource>
|
||||||
<ParaValue>E:\GF3Data\leafindex\CSAR_leaf_new_LAI.zip</ParaValue>
|
<ParaValue>E:\辅助数据\GF3Data\leafindex\CSAR_leaf_new_LAI.zip</ParaValue>
|
||||||
<EnModification>True</EnModification>
|
<EnModification>True</EnModification>
|
||||||
<EnMultipleChoice>False</EnMultipleChoice>
|
<EnMultipleChoice>False</EnMultipleChoice>
|
||||||
<Control>File</Control>
|
<Control>File</Control>
|
||||||
|
@ -113,7 +113,7 @@
|
||||||
<ParaType>File</ParaType>
|
<ParaType>File</ParaType>
|
||||||
<DataType>zip</DataType>
|
<DataType>zip</DataType>
|
||||||
<ParaSource>Cal</ParaSource>
|
<ParaSource>Cal</ParaSource>
|
||||||
<ParaValue>E:\GF3Data\leafindex\CSAR_leaf_L9NDVI.zip</ParaValue>
|
<ParaValue>E:\辅助数据\GF3Data\leafindex\CSAR_leaf_L9NDVI.zip</ParaValue>
|
||||||
<EnModification>True</EnModification>
|
<EnModification>True</EnModification>
|
||||||
<EnMultipleChoice>False</EnMultipleChoice>
|
<EnMultipleChoice>False</EnMultipleChoice>
|
||||||
<Control>File</Control>
|
<Control>File</Control>
|
||||||
|
@ -143,7 +143,7 @@
|
||||||
<ParaType>File</ParaType>
|
<ParaType>File</ParaType>
|
||||||
<DataType>zip</DataType>
|
<DataType>zip</DataType>
|
||||||
<ParaSource>Cal</ParaSource>
|
<ParaSource>Cal</ParaSource>
|
||||||
<ParaValue>E:\GF3Data\leafindex\CASR_leaf_N50_40_2020LC030.zip</ParaValue>
|
<ParaValue>E:\辅助数据\GF3Data\leafindex\CASR_leaf_N50_40_2020LC030.zip</ParaValue>
|
||||||
<EnModification>True</EnModification>
|
<EnModification>True</EnModification>
|
||||||
<EnMultipleChoice>False</EnMultipleChoice>
|
<EnMultipleChoice>False</EnMultipleChoice>
|
||||||
<Control>File</Control>
|
<Control>File</Control>
|
||||||
|
@ -235,7 +235,7 @@
|
||||||
<ParaType>File</ParaType>
|
<ParaType>File</ParaType>
|
||||||
<DataType>tar.gz</DataType>
|
<DataType>tar.gz</DataType>
|
||||||
<ParaSource>Cal</ParaSource>
|
<ParaSource>Cal</ParaSource>
|
||||||
<ParaValue>E:\Result_GF3\LeafAreaIndex\Output\GF3_MDJ_QPSI_031847_E116.4_N43.9_20220828_L1A_AHV_L10006708819-cal-LAI.tar.gz</ParaValue>
|
<ParaValue>D:\micro\WorkSpace\LeafAreaIndex\Output\GF3_MDJ_QPSI_031847_E116.4_N43.9_20220828_L1A_AHV_L10006708819-cal-LAI.tar.gz</ParaValue>
|
||||||
<MaxValue>DEFAULT</MaxValue>
|
<MaxValue>DEFAULT</MaxValue>
|
||||||
<MinValue>DEFAULT</MinValue>
|
<MinValue>DEFAULT</MinValue>
|
||||||
<OptionValue>DEFAULT</OptionValue>
|
<OptionValue>DEFAULT</OptionValue>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<Root>
|
<Root>
|
||||||
<TaskID>CSAR_202107275419_0001-0</TaskID>
|
<TaskID>CSAR_202107275419_0001-0</TaskID>
|
||||||
<WorkSpace>D:\micro\WorkSpace\TOP\</WorkSpace>
|
<WorkSpace>D:\micro\WorkSpace\</WorkSpace>
|
||||||
<AlgCompt>
|
<AlgCompt>
|
||||||
<DataTransModel>File</DataTransModel>
|
<DataTransModel>File</DataTransModel>
|
||||||
<Artificial>ElementAlg</Artificial>
|
<Artificial>ElementAlg</Artificial>
|
||||||
|
@ -43,9 +43,9 @@
|
||||||
<ParaChsName>地表覆盖类型数据</ParaChsName>
|
<ParaChsName>地表覆盖类型数据</ParaChsName>
|
||||||
<Description>经过地理定标(WGS84)的地表覆盖类型数据</Description>
|
<Description>经过地理定标(WGS84)的地表覆盖类型数据</Description>
|
||||||
<ParaType>File</ParaType>
|
<ParaType>File</ParaType>
|
||||||
<DataType>tif</DataType>
|
<DataType>zip</DataType>
|
||||||
<ParaSource>Man</ParaSource>
|
<ParaSource>Man</ParaSource>
|
||||||
<ParaValue>F:\202306hb\Landcover\50T_20220101-20230101.tif</ParaValue>
|
<ParaValue>E:\辅助数据\GF3Data\soilMoisture\CSAR_solim_50T_20220101-20230101.zip</ParaValue>
|
||||||
</Parameter>
|
</Parameter>
|
||||||
<Parameter>
|
<Parameter>
|
||||||
<ParaName>CoveringIDs</ParaName>
|
<ParaName>CoveringIDs</ParaName>
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
<ParaType>Value</ParaType>
|
<ParaType>Value</ParaType>
|
||||||
<DataType>string</DataType>
|
<DataType>string</DataType>
|
||||||
<ParaSource>Man</ParaSource>
|
<ParaSource>Man</ParaSource>
|
||||||
<ParaValue>1;4;5;6;7;11;10;20;30;50;60;70;71;72;73;74;80;90;255</ParaValue>
|
<ParaValue>empty</ParaValue>
|
||||||
<MaxValue>DEFAULT</MaxValue>
|
<MaxValue>DEFAULT</MaxValue>
|
||||||
<MinValue>DEFAULT</MinValue>
|
<MinValue>DEFAULT</MinValue>
|
||||||
<OptionValue>DEFAULT</OptionValue>
|
<OptionValue>DEFAULT</OptionValue>
|
||||||
|
@ -64,9 +64,9 @@
|
||||||
<ParaChsName>NDVI数据</ParaChsName>
|
<ParaChsName>NDVI数据</ParaChsName>
|
||||||
<Description>经过地理定标(WGS84)的NDVI数据</Description>
|
<Description>经过地理定标(WGS84)的NDVI数据</Description>
|
||||||
<ParaType>File</ParaType>
|
<ParaType>File</ParaType>
|
||||||
<DataType>tif</DataType>
|
<DataType>zip</DataType>
|
||||||
<ParaSource>Man</ParaSource>
|
<ParaSource>Man</ParaSource>
|
||||||
<ParaValue>F:\202306hb\NDVI\S2_202306_NDVI.tif</ParaValue>
|
<ParaValue>E:\辅助数据\GF3Data\soilMoisture\CSAR_solim_S2_202306_NDVI.zip</ParaValue>
|
||||||
</Parameter>
|
</Parameter>
|
||||||
<Parameter>
|
<Parameter>
|
||||||
<ParaName>NDVIScope</ParaName>
|
<ParaName>NDVIScope</ParaName>
|
||||||
|
@ -98,9 +98,9 @@
|
||||||
<ParaChsName>NDWI数据</ParaChsName>
|
<ParaChsName>NDWI数据</ParaChsName>
|
||||||
<Description>经过地理定标(WGS84)的NDWI数据</Description>
|
<Description>经过地理定标(WGS84)的NDWI数据</Description>
|
||||||
<ParaType>File</ParaType>
|
<ParaType>File</ParaType>
|
||||||
<DataType>tif</DataType>
|
<DataType>zip</DataType>
|
||||||
<ParaSource>Man</ParaSource>
|
<ParaSource>Man</ParaSource>
|
||||||
<ParaValue>F:\202306hb\NDWI\S2_202306_NDWI.tif</ParaValue>
|
<ParaValue>E:\辅助数据\GF3Data\soilMoisture\CSAR_solim_S2_202306_NDWI.zip</ParaValue>
|
||||||
</Parameter>
|
</Parameter>
|
||||||
<Parameter>
|
<Parameter>
|
||||||
<ParaName>e1</ParaName>
|
<ParaName>e1</ParaName>
|
||||||
|
@ -183,7 +183,7 @@
|
||||||
<ParaType>File</ParaType>
|
<ParaType>File</ParaType>
|
||||||
<DataType>tar.gz</DataType>
|
<DataType>tar.gz</DataType>
|
||||||
<ParaSource>Man</ParaSource>
|
<ParaSource>Man</ParaSource>
|
||||||
<ParaValue>D:\micro\WorkSpace\TOP\SoilMoisture\Output\GF3B_SYC_QPSI_008316_E116.1_N43.3_20230622_L1A_AHV_L10000202892-cal-SMC.tar.gz</ParaValue>
|
<ParaValue>D:\micro\WorkSpace\SoilMoisture\Output\GF3B_SYC_QPSI_008316_E116.1_N43.3_20230622_L1A_AHV_L10000202892-cal-SMC.tar.gz</ParaValue>
|
||||||
<MaxValue>DEFAULT</MaxValue>
|
<MaxValue>DEFAULT</MaxValue>
|
||||||
<MinValue>DEFAULT</MinValue>
|
<MinValue>DEFAULT</MinValue>
|
||||||
<OptionValue>DEFAULT</OptionValue>
|
<OptionValue>DEFAULT</OptionValue>
|
||||||
|
|
|
@ -327,18 +327,38 @@ class SalinityMain:
|
||||||
key_name = key
|
key_name = key
|
||||||
block_num = len(dir_dict[key])
|
block_num = len(dir_dict[key])
|
||||||
|
|
||||||
for n in range(block_num):
|
mergeFeaturesDir = os.path.join(self.__workspace_block_tif_processed_path, "features")
|
||||||
name = os.path.basename(dir_dict[key_name][n])
|
|
||||||
suffix = '_' + name.split('_')[-4] + "_" + name.split('_')[-3] + "_" + name.split('_')[-2] + "_" + \
|
# 创建文件
|
||||||
|
if os.path.exists(mergeFeaturesDir) is False:
|
||||||
|
os.makedirs(mergeFeaturesDir)
|
||||||
|
for i in range(block_num):
|
||||||
|
file_list = []
|
||||||
|
for value in dir_dict.values():
|
||||||
|
file_list.append(os.path.basename(value[i]))
|
||||||
|
name = os.path.basename(file_list[0])
|
||||||
|
suffix = 'features_' + name.split('_')[-4] + "_" + name.split('_')[-3] + "_" + name.split('_')[-2] + "_" + \
|
||||||
name.split('_')[-1]
|
name.split('_')[-1]
|
||||||
features_path = self.__workspace_block_tif_processed_path + "features\\features" + suffix
|
out_str = os.path.join(mergeFeaturesDir, suffix)
|
||||||
features_array = np.zeros((len(dir_dict), block_size, block_size), dtype='float32')
|
input_str1 = os.path.dirname(value[0])
|
||||||
for m, value in zip(range(len(dir_dict)), dir_dict.values()):
|
input_str2 = ','.join(file_list)
|
||||||
features_array[m, :, :] = self.imageHandler.get_band_array(value[n], 1)
|
input_str3 = out_str
|
||||||
# 异常值转为0
|
cmd = r".\baseTool\tifMerge\x64\Release\tifMerge.exe {} {} {}".format(input_str1, input_str2, input_str3)
|
||||||
features_array[np.isnan(features_array)] = 0.0
|
# print(cmd)
|
||||||
features_array[np.isinf(features_array)] = 0.0
|
os.system(cmd)
|
||||||
self.imageHandler.write_img(features_path, "", [0, 0, 1, 0, 0, 1], features_array)
|
|
||||||
|
# for n in range(block_num):
|
||||||
|
# name = os.path.basename(dir_dict[key_name][n])
|
||||||
|
# suffix = '_' + name.split('_')[-4] + "_" + name.split('_')[-3] + "_" + name.split('_')[-2] + "_" + \
|
||||||
|
# name.split('_')[-1]
|
||||||
|
# features_path = self.__workspace_block_tif_processed_path + "features\\features" + suffix
|
||||||
|
# features_array = np.zeros((len(dir_dict), block_size, block_size), dtype='float32')
|
||||||
|
# for m, value in zip(range(len(dir_dict)), dir_dict.values()):
|
||||||
|
# features_array[m, :, :] = self.imageHandler.get_band_array(value[n], 1)
|
||||||
|
# # 异常值转为0
|
||||||
|
# features_array[np.isnan(features_array)] = 0.0
|
||||||
|
# features_array[np.isinf(features_array)] = 0.0
|
||||||
|
# self.imageHandler.write_img(features_path, "", [0, 0, 1, 0, 0, 1], features_array)
|
||||||
logger.info('create features matrix success!')
|
logger.info('create features matrix success!')
|
||||||
|
|
||||||
# 生成训练集
|
# 生成训练集
|
||||||
|
|
|
@ -9,7 +9,7 @@ a = Analysis(['SoilSalinityPredictMain.py'],
|
||||||
binaries=[],
|
binaries=[],
|
||||||
datas=[('D:/Anaconda/envs/micro/Lib/site-packages/dask/dask.yaml', './dask'), ('D:/Anaconda/envs/micro/Lib/site-packages/distributed/distributed.yaml', './distributed')],
|
datas=[('D:/Anaconda/envs/micro/Lib/site-packages/dask/dask.yaml', './dask'), ('D:/Anaconda/envs/micro/Lib/site-packages/distributed/distributed.yaml', './distributed')],
|
||||||
hiddenimports=['pyproj._compat'],
|
hiddenimports=['pyproj._compat'],
|
||||||
hookspath=[],
|
hookspath=[],·
|
||||||
hooksconfig={},
|
hooksconfig={},
|
||||||
runtime_hooks=[],
|
runtime_hooks=[],
|
||||||
excludes=[],
|
excludes=[],
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
<ParaType>File</ParaType>
|
<ParaType>File</ParaType>
|
||||||
<DataType>tar.gz</DataType>
|
<DataType>tar.gz</DataType>
|
||||||
<ParaSource>Man</ParaSource>
|
<ParaSource>Man</ParaSource>
|
||||||
<ParaValue>F:\2024xibei\GF3B_KSC_QPSI_010328_E86.1_N44.3_20231109_L1A_AHV_L10000262133-ortho.tar.gz</ParaValue>
|
<ParaValue>F:\202306hb\sar_img\GF3B_SYC_QPSI_008316_E116.1_N43.3_20230622_L1A_AHV_L10000202892-ortho.tar.gz</ParaValue>
|
||||||
<EnModification>True</EnModification>
|
<EnModification>True</EnModification>
|
||||||
<EnMultipleChoice>False</EnMultipleChoice>
|
<EnMultipleChoice>False</EnMultipleChoice>
|
||||||
<Control>File</Control>
|
<Control>File</Control>
|
||||||
|
@ -66,9 +66,9 @@
|
||||||
<ParaChsName>地表覆盖类型数据</ParaChsName>
|
<ParaChsName>地表覆盖类型数据</ParaChsName>
|
||||||
<Description>经过地理定标(WGS84)的地表覆盖类型数据</Description>
|
<Description>经过地理定标(WGS84)的地表覆盖类型数据</Description>
|
||||||
<ParaType>File</ParaType>
|
<ParaType>File</ParaType>
|
||||||
<DataType>tif</DataType>
|
<DataType>zip</DataType>
|
||||||
<ParaSource>Man</ParaSource>
|
<ParaSource>Man</ParaSource>
|
||||||
<ParaValue>F:\2023xibei\fugaileixing.tif</ParaValue>
|
<ParaValue>E:\辅助数据\GF3Data\soilMoisture\CSAR_solim_50T_20220101-20230101.zip</ParaValue>
|
||||||
<EnModification>True</EnModification>
|
<EnModification>True</EnModification>
|
||||||
<EnMultipleChoice>False</EnMultipleChoice>
|
<EnMultipleChoice>False</EnMultipleChoice>
|
||||||
<Control>File</Control>
|
<Control>File</Control>
|
||||||
|
@ -96,9 +96,9 @@
|
||||||
<ParaChsName>NDVI数据</ParaChsName>
|
<ParaChsName>NDVI数据</ParaChsName>
|
||||||
<Description>经过地理定标(WGS84)的NDVI数据</Description>
|
<Description>经过地理定标(WGS84)的NDVI数据</Description>
|
||||||
<ParaType>File</ParaType>
|
<ParaType>File</ParaType>
|
||||||
<DataType>tif</DataType>
|
<DataType>zip</DataType>
|
||||||
<ParaSource>Man</ParaSource>
|
<ParaSource>Man</ParaSource>
|
||||||
<ParaValue>F:\2024xibei\S2_NDVImed.tif</ParaValue>
|
<ParaValue>E:\辅助数据\GF3Data\soilMoisture\CSAR_solim_S2_202306_NDVI.zip</ParaValue>
|
||||||
<EnModification>True</EnModification>
|
<EnModification>True</EnModification>
|
||||||
<EnMultipleChoice>False</EnMultipleChoice>
|
<EnMultipleChoice>False</EnMultipleChoice>
|
||||||
<Control>File</Control>
|
<Control>File</Control>
|
||||||
|
@ -130,7 +130,7 @@
|
||||||
<ParaType>File</ParaType>
|
<ParaType>File</ParaType>
|
||||||
<DataType>tar.gz</DataType>
|
<DataType>tar.gz</DataType>
|
||||||
<ParaSource>Man</ParaSource>
|
<ParaSource>Man</ParaSource>
|
||||||
<ParaValue>D:\micro\WorkSpace\SurfaceRoughness\Output\GF3B_KSC_QPSI_010328_E86.1_N44.3_20231109_L1A_AHV_L10000262133-ortho-SR.tar.gz</ParaValue>
|
<ParaValue>D:\micro\WorkSpace\SurfaceRoughness\Output\GF3B_SYC_QPSI_008316_E116.1_N43.3_20230622_L1A_AHV_L10000202892-ortho-SR.tar.gz</ParaValue>
|
||||||
</Parameter>
|
</Parameter>
|
||||||
</Outputs>
|
</Outputs>
|
||||||
</AlgCompt>
|
</AlgCompt>
|
||||||
|
|
|
@ -7,7 +7,7 @@ block_cipher = None
|
||||||
a = Analysis(['SurfaceRoughnessMain.py'],
|
a = Analysis(['SurfaceRoughnessMain.py'],
|
||||||
pathex=[],
|
pathex=[],
|
||||||
binaries=[],
|
binaries=[],
|
||||||
datas=[('D:/ANACONDA/envs/micro/Lib/site-packages/dask/dask.yaml', './dask'), ('D:/ANACONDA/envs/micro/Lib/site-packages/distributed/distributed.yaml', './distributed')],
|
datas=[('D:/Anaconda/envs/micro/Lib/site-packages/dask/dask.yaml', './dask'), ('D:/Anaconda/envs/micro/Lib/site-packages/distributed/distributed.yaml', './distributed')],
|
||||||
hiddenimports=['pyproj._compat'],
|
hiddenimports=['pyproj._compat'],
|
||||||
hookspath=[],
|
hookspath=[],
|
||||||
hooksconfig={},
|
hooksconfig={},
|
||||||
|
|
Binary file not shown.
|
@ -94,16 +94,33 @@ class MachineLeaning:
|
||||||
key_name = key
|
key_name = key
|
||||||
block_num = len(dir_dict[key])
|
block_num = len(dir_dict[key])
|
||||||
break
|
break
|
||||||
for n in range(block_num):
|
|
||||||
name = os.path.basename(dir_dict[key_name][n])
|
for i in range(block_num):
|
||||||
suffix = '_' + name.split('_')[-4] + "_" + name.split('_')[-3] + "_" + name.split('_')[-2] + "_" + name.split('_')[-1]
|
file_list = []
|
||||||
features_path = os.path.join(workspace_block_feature_path, "features" + suffix) # + "\\features" + suffix
|
for value in dir_dict.values():
|
||||||
X_test_list.append(features_path)
|
file_list.append(os.path.basename(value[i]))
|
||||||
features_array = np.zeros((len(dir_dict), block_size, block_size), dtype='float32')
|
name = os.path.basename(file_list[0])
|
||||||
for m, value in zip(range(len(dir_dict)), dir_dict.values()):
|
suffix = 'features_' + name.split('_')[-4] + "_" + name.split('_')[-3] + "_" + name.split('_')[-2] + "_" + \
|
||||||
features_array[m, :, :] = ImageHandler.get_band_array(value[n])
|
name.split('_')[-1]
|
||||||
features_array[np.isnan(features_array)] = 0.0 # 异常值转为0
|
out_str = os.path.join(workspace_block_feature_path, suffix)
|
||||||
ImageHandler.write_img(features_path, '', [0, 0, 0, 0, 0, 0], features_array)
|
X_test_list.append(out_str)
|
||||||
|
input_str1 = os.path.dirname(value[0])
|
||||||
|
input_str2 = ','.join(file_list)
|
||||||
|
input_str3 = out_str
|
||||||
|
cmd = r".\baseTool\tifMerge\x64\Release\tifMerge.exe {} {} {}".format(input_str1, input_str2, input_str3)
|
||||||
|
# print(cmd)
|
||||||
|
os.system(cmd)
|
||||||
|
|
||||||
|
# for n in range(block_num):
|
||||||
|
# name = os.path.basename(dir_dict[key_name][n])
|
||||||
|
# suffix = '_' + name.split('_')[-4] + "_" + name.split('_')[-3] + "_" + name.split('_')[-2] + "_" + name.split('_')[-1]
|
||||||
|
# features_path = os.path.join(workspace_block_feature_path, "features" + suffix) # + "\\features" + suffix
|
||||||
|
# X_test_list.append(features_path)
|
||||||
|
# features_array = np.zeros((len(dir_dict), block_size, block_size), dtype='float32')
|
||||||
|
# for m, value in zip(range(len(dir_dict)), dir_dict.values()):
|
||||||
|
# features_array[m, :, :] = ImageHandler.get_band_array(value[n])
|
||||||
|
# features_array[np.isnan(features_array)] = 0.0 # 异常值转为0
|
||||||
|
# ImageHandler.write_img(features_path, '', [0, 0, 0, 0, 0, 0], features_array)
|
||||||
logger.info('create features matrix success!')
|
logger.info('create features matrix success!')
|
||||||
# file.del_folder(workspace_block_tif_path)
|
# file.del_folder(workspace_block_tif_path)
|
||||||
# file.del_folder(workspace_block_feature_path)
|
# file.del_folder(workspace_block_feature_path)
|
||||||
|
|
|
@ -69,6 +69,7 @@ class CreateFeature:
|
||||||
logger.error('FreemanDecomposition err')
|
logger.error('FreemanDecomposition err')
|
||||||
return False, None
|
return False, None
|
||||||
outFolderDic['Freeman'] = freemanOutDir
|
outFolderDic['Freeman'] = freemanOutDir
|
||||||
|
logger.info('Freeman successful')
|
||||||
|
|
||||||
# Touzi分解
|
# Touzi分解
|
||||||
if 'Touzi' in FeatureInput:
|
if 'Touzi' in FeatureInput:
|
||||||
|
@ -92,6 +93,7 @@ class CreateFeature:
|
||||||
logger.error('CloudePottierDecomposition err')
|
logger.error('CloudePottierDecomposition err')
|
||||||
return False, None
|
return False, None
|
||||||
outFolderDic['Yamaguchi'] = yamaguchiOutDir
|
outFolderDic['Yamaguchi'] = yamaguchiOutDir
|
||||||
|
logger.info('Yamaguchi successful')
|
||||||
|
|
||||||
if 'Cloude' in FeatureInput:
|
if 'Cloude' in FeatureInput:
|
||||||
# CloudePottier分解
|
# CloudePottier分解
|
||||||
|
@ -105,6 +107,7 @@ class CreateFeature:
|
||||||
logger.error('CloudePottierDecomposition err')
|
logger.error('CloudePottierDecomposition err')
|
||||||
return False, None
|
return False, None
|
||||||
outFolderDic['Cloude'] = cloudeOutDir
|
outFolderDic['Cloude'] = cloudeOutDir
|
||||||
|
logger.info('Cloude successful')
|
||||||
return True, outFolderDic
|
return True, outFolderDic
|
||||||
|
|
||||||
def creat_h_a_alpha_features(self, t3_path, out_dir):
|
def creat_h_a_alpha_features(self, t3_path, out_dir):
|
||||||
|
@ -153,7 +156,7 @@ class CreateFeature:
|
||||||
|
|
||||||
cfeature = CreateFeature(debug, exe_dir)
|
cfeature = CreateFeature(debug, exe_dir)
|
||||||
|
|
||||||
cfeature.creat_h_a_alpha_features(t3_path, feature_tif_dir)
|
# cfeature.creat_h_a_alpha_features(t3_path, feature_tif_dir)
|
||||||
|
|
||||||
t3_path = cfeature.ahv_to_t3(workspace_processing_path, workspace_preprocessing_path, hh_hv_vh_vv_list, name, FILTER_SIZE)
|
t3_path = cfeature.ahv_to_t3(workspace_processing_path, workspace_preprocessing_path, hh_hv_vh_vv_list, name, FILTER_SIZE)
|
||||||
flag, outFolderDic = cfeature.decompose(workspace_processing_path, name, t3_path, rows, cols, hh_hv_vh_vv_dic, FeatureInput) # , 'Touzi'
|
flag, outFolderDic = cfeature.decompose(workspace_processing_path, name, t3_path, rows, cols, hh_hv_vh_vv_dic, FeatureInput) # , 'Touzi'
|
||||||
|
|
|
@ -45,12 +45,12 @@ class DictXml:
|
||||||
point_downright = [float(bottomRight.find("longitude").text), float(bottomRight.find("latitude").text)]
|
point_downright = [float(bottomRight.find("longitude").text), float(bottomRight.find("latitude").text)]
|
||||||
scopes = [point_upleft, point_upright, point_downleft, point_downright]
|
scopes = [point_upleft, point_upright, point_downleft, point_downright]
|
||||||
|
|
||||||
point_upleft_buf = [float(topLeft.find("longitude").text) - 0.4, float(topLeft.find("latitude").text) + 0.4]
|
point_upleft_buf = [float(topLeft.find("longitude").text) - 0.6, float(topLeft.find("latitude").text) + 0.6]
|
||||||
point_upright_buf = [float(topRight.find("longitude").text) + 0.4, float(topRight.find("latitude").text) + 0.4]
|
point_upright_buf = [float(topRight.find("longitude").text) + 0.6, float(topRight.find("latitude").text) + 0.6]
|
||||||
point_downleft_buf = [float(bottomLeft.find("longitude").text) - 0.4,
|
point_downleft_buf = [float(bottomLeft.find("longitude").text) - 0.6,
|
||||||
float(bottomLeft.find("latitude").text) - 0.4]
|
float(bottomLeft.find("latitude").text) - 0.6]
|
||||||
point_downright_buf = [float(bottomRight.find("longitude").text) + 0.4,
|
point_downright_buf = [float(bottomRight.find("longitude").text) + 0.6,
|
||||||
float(bottomRight.find("latitude").text) - 0.4]
|
float(bottomRight.find("latitude").text) - 0.6]
|
||||||
scopes_buf = ([point_upleft_buf, point_upright_buf, point_downleft_buf, point_downright_buf], )
|
scopes_buf = ([point_upleft_buf, point_upright_buf, point_downleft_buf, point_downright_buf], )
|
||||||
return scopes, scopes_buf
|
return scopes, scopes_buf
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@
|
||||||
<ParaType>Value</ParaType>
|
<ParaType>Value</ParaType>
|
||||||
<DataType>string</DataType>
|
<DataType>string</DataType>
|
||||||
<ParaSource>Man</ParaSource>
|
<ParaSource>Man</ParaSource>
|
||||||
<ParaValue>0,1,2</ParaValue>
|
<ParaValue>0,1,2,7,8,9,10</ParaValue>
|
||||||
<EnModification>True</EnModification>
|
<EnModification>True</EnModification>
|
||||||
<EnMultipleChoice>True</EnMultipleChoice>
|
<EnMultipleChoice>True</EnMultipleChoice>
|
||||||
<Control>UploadInput</Control>
|
<Control>UploadInput</Control>
|
||||||
|
|
|
@ -350,7 +350,7 @@ class PhenologyMain:
|
||||||
return feature_geo_dir, train_data_dic
|
return feature_geo_dir, train_data_dic
|
||||||
|
|
||||||
def features_geo(self, features_path, paraMeter, sim_ori, sar_name):
|
def features_geo(self, features_path, paraMeter, sim_ori, sar_name):
|
||||||
dir = os.path.join(self.__workspace_processing_path, sar_name.split('_')[7], 'features_geo')
|
dir = os.path.join(self.__workspace_processing_path, sar_name, 'features_geo')
|
||||||
if not os.path.exists(dir):
|
if not os.path.exists(dir):
|
||||||
os.mkdir(dir)
|
os.mkdir(dir)
|
||||||
in_tif_paths = list(glob.glob(os.path.join(features_path, '*.tif')))
|
in_tif_paths = list(glob.glob(os.path.join(features_path, '*.tif')))
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue