将正射角度写入meta.xml
parent
5f6ac39781
commit
bc07e824d2
|
@ -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\</WorkSpace>
|
<WorkSpace>K:\mircoData\OutTest\</WorkSpace>
|
||||||
<AlgCompt>
|
<AlgCompt>
|
||||||
<DataTransModel>File</DataTransModel>
|
<DataTransModel>File</DataTransModel>
|
||||||
<Artificial>ElementAlg</Artificial>
|
<Artificial>ElementAlg</Artificial>
|
||||||
|
@ -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>E:\MicroWorkspace\Micro\neimenggu\GF3_MDJ_QPSI_031847_E116.4_N43.9_20220828_L1A_AHV_L10006708819.tar.gz</ParaValue>
|
<ParaValue>K:\mircoData\Azimuth\GF3_SAY_QPSI_011444_E118.9_N31.4_20181012_L1A_AHV_L10003515422.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>E:\MicroWorkspace\Micro\neimenggu\DEM</ParaValue>
|
<ParaValue>K:\mircoData\Azimuth\DEM</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\GF3_MDJ_QPSI_031847_E116.4_N43.9_20220828_L1A_AHV_L10006708819-ortho.tar.gz</ParaValue>
|
<ParaValue>K:\mircoData\OutTest\Ortho\Output\GF3_SAY_QPSI_011444_E118.9_N31.4_20181012_L1A_AHV_L10003515422-ortho.tar.gz</ParaValue>
|
||||||
</Parameter>
|
</Parameter>
|
||||||
</Outputs>
|
</Outputs>
|
||||||
</AlgCompt>
|
</AlgCompt>
|
||||||
|
|
|
@ -358,6 +358,20 @@ class OrthoMain:
|
||||||
self.processinfo = [hh_flag, hv_flag, vh_flag, vv_flag,dh_flag]
|
self.processinfo = [hh_flag, hv_flag, vh_flag, vv_flag,dh_flag]
|
||||||
return para_dic
|
return para_dic
|
||||||
|
|
||||||
|
|
||||||
|
def getAzuimithFromTxt(self,Txtpath):
|
||||||
|
Azuimith = 0
|
||||||
|
# 打开txt文件
|
||||||
|
file = open(Txtpath, 'r')
|
||||||
|
|
||||||
|
# 读取文件内容
|
||||||
|
Azuimith = file.read()
|
||||||
|
|
||||||
|
# 关闭文件
|
||||||
|
file.close()
|
||||||
|
|
||||||
|
return Azuimith
|
||||||
|
|
||||||
def process_handle(self):
|
def process_handle(self):
|
||||||
isError, CorrectMethod = self.__check_handler.check_input_paras(['CorrectMethod']) # //todo 获取xml中校正方法 根据不同方法进行结果处理
|
isError, CorrectMethod = self.__check_handler.check_input_paras(['CorrectMethod']) # //todo 获取xml中校正方法 根据不同方法进行结果处理
|
||||||
|
|
||||||
|
@ -574,7 +588,10 @@ class OrthoMain:
|
||||||
GTC_out_path=self.__workspace_package_path
|
GTC_out_path=self.__workspace_package_path
|
||||||
|
|
||||||
parameter_path = os.path.join(self.__workspace_package_path, "orth_para.txt")
|
parameter_path = os.path.join(self.__workspace_package_path, "orth_para.txt")
|
||||||
dem_rc = os.path.join(self.__workspace_Temporary_path, "dem_rc.tiff")
|
# ERROR 4: K:\mircoData\OutTest\Ortho\Temporary\dem_rc.tiff: No such file or directory报错
|
||||||
|
# c++项目中this->dem_rc_path = JoinPath(out_dir_path, "RD_sim_ori.tif");路径不对
|
||||||
|
#dem_rc = os.path.join(self.__workspace_Temporary_path, "dem_rc.tiff")
|
||||||
|
dem_rc = os.path.join(self.__workspace_package_path, "RD_sim_ori.tif")
|
||||||
|
|
||||||
in_tif_paths = list(glob.glob(os.path.join(slc_paths, '*.tiff')))
|
in_tif_paths = list(glob.glob(os.path.join(slc_paths, '*.tiff')))
|
||||||
for in_tif_path in in_tif_paths:
|
for in_tif_path in in_tif_paths:
|
||||||
|
@ -641,6 +658,9 @@ class OrthoMain:
|
||||||
para_dict = CreateMetaDict(image_path, self.__in_processing_paras['META'], self.__workspace_package_path, out_path1, out_path2).calu_nature()
|
para_dict = CreateMetaDict(image_path, self.__in_processing_paras['META'], self.__workspace_package_path, out_path1, out_path2).calu_nature()
|
||||||
para_dict.update({"ProductProductionInfo_BandSelection": "1,2"})
|
para_dict.update({"ProductProductionInfo_BandSelection": "1,2"})
|
||||||
para_dict.update({"ProductProductionInfo_AuxiliaryDataDescription": "DEM"})
|
para_dict.update({"ProductProductionInfo_AuxiliaryDataDescription": "DEM"})
|
||||||
|
#更新meta.xml中方位角信息
|
||||||
|
Azuimith=self.getAzuimithFromTxt(self.__workspace_Temporary_path+'\Azimuth.txt')
|
||||||
|
para_dict.update({"ObservationGeometry_SatelliteAzimuth": Azuimith})
|
||||||
CreateProductXml(para_dict, model_path, meta_xml_path).create_standard_xml()
|
CreateProductXml(para_dict, model_path, meta_xml_path).create_standard_xml()
|
||||||
|
|
||||||
# 生成压缩包
|
# 生成压缩包
|
||||||
|
|
|
@ -598,7 +598,7 @@ class ImageHandler:
|
||||||
min = np.percentile(t_data, 2) # np.nanmin(t_data)
|
min = np.percentile(t_data, 2) # np.nanmin(t_data)
|
||||||
max = np.percentile(t_data, 98) # np.nanmax(t_data)
|
max = np.percentile(t_data, 98) # np.nanmax(t_data)
|
||||||
t_data[np.isnan(t_data)] = max
|
t_data[np.isnan(t_data)] = max
|
||||||
if (max - min) < 256 & (max-min) != 0: # 会报异常RuntimeWarning: divide by zero encountered in true_divide t_data = (t_data - min) / (max - min) * 255 jia's
|
if (max - min) < 256 : # 会报异常RuntimeWarning: divide by zero encountered in true_divide t_data = (t_data - min) / (max - min) * 255 jia's
|
||||||
t_data = (t_data - min) / (max - min) * 255
|
t_data = (t_data - min) / (max - min) * 255
|
||||||
out_img = Image.fromarray(t_data)
|
out_img = Image.fromarray(t_data)
|
||||||
out_img = out_img.resize((q_c, q_r)) # 重采样
|
out_img = out_img.resize((q_c, q_r)) # 重采样
|
||||||
|
|
Loading…
Reference in New Issue