diff --git a/surfaceRoughness_oh2004/SoilMoistureMain.py b/surfaceRoughness_oh2004/SoilMoistureMain.py index ee7412be..056769f2 100644 --- a/surfaceRoughness_oh2004/SoilMoistureMain.py +++ b/surfaceRoughness_oh2004/SoilMoistureMain.py @@ -22,6 +22,7 @@ from tool.algorithm.algtools.logHandler import LogHandler from SoilMoistureALg import MoistureAlg as alg from tool.algorithm.block.blockprocess import BlockProcess from tool.algorithm.algtools.MetaDataHandler import MetaDataHandler +from tool.algorithm.xml.CreateMetaDict import CreateMetaDict, CreateProductXml from tool.config.ConfigeHandle import Config as cf from tool.algorithm.xml.CreatMetafile import CreateMetafile from tool.algorithm.algtools.ROIAlg import ROIAlg as roi @@ -315,18 +316,6 @@ class MoistureMain: out_path2 = os.path.join(tem_folder, "trans_projcs_geo.tif") par_dict = CreateDict(image_path, self.processinfo, out_path1, out_path2).calu_nature(start) - # TODO:从原始文件的xml中获取得到方位角信息 SurfaceRoughness\Temporary\preprocessing\影像名\ 文件夹下 -ortho.meta.xml - # 这个添加方式有问题 待修改 - # 加载XML文件 - # tree = ET.parse(self.__processing_paras['META']) - # ## 获取根节点 - # root = tree.getroot() - # # # 找到SatelliteAzimuth标签并获取其值 - # satellite_azimuth = root.find('.//SatelliteAzimuth') - # if satellite_azimuth is not None: - # par_dict.update({"productinfo_SatelliteAzimuth": satellite_azimuth}) - - model_xml_path = os.path.join(tem_folder, "creat_standard.meta.xml") # 输出xml路径 id_min = 0 @@ -345,6 +334,27 @@ class MoistureMain: meta_xml_path = self.__product_dic + EXE_NAME + "Product.meta.xml" CreateMetafile(self.__processing_paras['META'], self.alg_xml_path, model_xml_path, meta_xml_path).process(SrcImageName) + #生成xml测试对比 231016 上面那个生成xml方式可以注释掉 + model_path = "./product.xml" + meta_xml_path = os.path.join(self.__product_dic, + os.path.basename(self.__out_para).replace(".tar.gz", ".meta.xml")) + + para_dict = CreateMetaDict(image_path, self.__processing_paras['Origin_META'], self.__product_dic, + out_path1, out_path2).calu_nature() + para_dict.update({"ProductProductionInfo_BandSelection": "1,2"}) + + # 从原始文件的xml中获取得到方位角信息 SurfaceRoughness\Temporary\preprocessing\影像名\ 文件夹下 -ortho.meta.xml + # 加载XML文件 + tree = ET.parse(self.__processing_paras['META']) + ## 获取根节点 + root = tree.getroot() + # # 找到SatelliteAzimuth标签并获取其值 + satellite_azimuth = root.find('.//SatelliteAzimuth').text + #if satellite_azimuth is not None: + para_dict.update({"ObservationGeometry_SatelliteAzimuth": satellite_azimuth}) + CreateProductXml(para_dict, model_path, meta_xml_path).create_standard_xml() + + # 文件夹打包 file.make_targz(self.__out_para, self.__product_dic) logger.info('process_handle success!') diff --git a/surfaceRoughness_oh2004/SurfaceRoughness.xml b/surfaceRoughness_oh2004/SurfaceRoughness.xml index 4acde4fa..bbbba884 100644 --- a/surfaceRoughness_oh2004/SurfaceRoughness.xml +++ b/surfaceRoughness_oh2004/SurfaceRoughness.xml @@ -1,7 +1,7 @@ CSAR_202107275419_0001-0 - K:\mircoData\OutTest\ + K:\mircoData\sufaceOut\ File ElementAlg @@ -38,7 +38,7 @@ File tar.gz Man - K:\mircoData\surfaceRoughnessData\GF3_MDJ_QPSI_031847_E116.4_N43.9_20220828_L1A_AHV_L10006708819-ortho.tar.gz + K:\mircoData\surfaceRoughnessData\fakerData\GF3_MDJ_QPSI_031847_E116.4_N43.9_20220828_L1A_AHV_L10006708819-ortho.tar.gz True False File @@ -130,7 +130,7 @@ File tar.gz Man - K:\mircoData\OutTest\SurfaceRoughness\Output\SurfaceRoughnessProduct.tar.gz + K:\mircoData\sufaceOut\SurfaceRoughness\Output\SurfaceRoughnessProduct.tar.gz