From 10b484e4bfa88e9957c8684b28492acf2a3a6985 Mon Sep 17 00:00:00 2001 From: tian jiax <446100073@qq.com> Date: Mon, 18 Sep 2023 16:32:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9C=9F=E5=A3=A4=E6=B0=B4?= =?UTF-8?q?=E3=80=81=E5=9C=9F=E5=A3=A4=E7=B2=97=E7=B3=99=E5=BA=A6=E6=8F=92?= =?UTF-8?q?=E5=80=BC=E6=A8=A1=E5=9D=97=E8=A7=A3=E5=86=B3=E5=86=85=E5=AD=98?= =?UTF-8?q?=E6=BA=A2=E5=87=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- atmosphericDelay/AtmosphericDelayMain.py | 4 ++-- soilMoisture_c_sar_oh2004/SoilMoistureMain.py | 4 ++-- soilMoisture_c_sar_oh2004/SoilMoistureTool.py | 22 +++++++++---------- surfaceRoughness_oh2004/SoilMoistureTool.py | 12 +++++----- .../VegetationHeightMain.py | 18 +++++++-------- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/atmosphericDelay/AtmosphericDelayMain.py b/atmosphericDelay/AtmosphericDelayMain.py index af2a815a..767d0cce 100644 --- a/atmosphericDelay/AtmosphericDelayMain.py +++ b/atmosphericDelay/AtmosphericDelayMain.py @@ -6,7 +6,7 @@ @Date :2021/09/3 14:39 @Version :1.0.0 """ - +import pyproj._compat #解决打包错误 from osgeo import gdal import glob from pykrige import OrdinaryKriging # 强制引入包 @@ -953,7 +953,7 @@ class AtmosphericMain: logger.info('progress bar :35%') # 二、 主影像 - # 2.1 执行stackSentinel.exe 生成运行配置文件 + # 2.1 执行stackSentinel.exe 生成运行配置文件 # # key_word = "20190113" key_word = self.mas_key_word self.isce_stackSentinel(slc_dir, dem_path, aux_dir, orbits_dir, isce_work_space, key_word, isce_exe_dir,box) diff --git a/soilMoisture_c_sar_oh2004/SoilMoistureMain.py b/soilMoisture_c_sar_oh2004/SoilMoistureMain.py index bce844f7..7cc27076 100644 --- a/soilMoisture_c_sar_oh2004/SoilMoistureMain.py +++ b/soilMoisture_c_sar_oh2004/SoilMoistureMain.py @@ -366,8 +366,8 @@ if __name__ == '__main__': except Exception: logger.exception('run-time error!') finally: - # main_handler.del_temp_workspace() - pass + main_handler.del_temp_workspace() + # pass end = datetime.datetime.now() msg = 'running use time: %s ' % (end - start) logger.info(msg) \ No newline at end of file diff --git a/soilMoisture_c_sar_oh2004/SoilMoistureTool.py b/soilMoisture_c_sar_oh2004/SoilMoistureTool.py index 0571763a..0263576e 100644 --- a/soilMoisture_c_sar_oh2004/SoilMoistureTool.py +++ b/soilMoisture_c_sar_oh2004/SoilMoistureTool.py @@ -117,17 +117,17 @@ class SoilMoistureTool: return oh2004_tifpath -if __name__ == '__main__': - - tif_path = r'F:\20230605\ortho\tif' - put_path = r'F:\20230605\back\oh2004' - cols = 7670 - rows = 7443 - incidence_file = r'F:\20230605\ortho\RD_localincidentAngle.tiff' - xml_file = r'F:\20230605\ortho\GF3C_MYC_QPSI_005390_E121.7_N41.1_20230415_L1A_AHV_L10000135644.meta.xml' - - soil = SoilMoistureTool(tif_path, put_path, cols, rows, incidence_file, xml_file) - soil.soil_oh2004() +# if __name__ == '__main__': +# +# tif_path = r'F:\20230605\ortho\tif' +# put_path = r'F:\20230605\back\oh2004' +# cols = 7670 +# rows = 7443 +# incidence_file = r'F:\20230605\ortho\RD_localincidentAngle.tiff' +# xml_file = r'F:\20230605\ortho\GF3C_MYC_QPSI_005390_E121.7_N41.1_20230415_L1A_AHV_L10000135644.meta.xml' +# +# soil = SoilMoistureTool(tif_path, put_path, cols, rows, incidence_file, xml_file) +# soil.soil_oh2004() # fn = r'F:\MicroWorkspace\mico_datas\GF3A_nanjing\PIESAR\test\GF3_SAY_QPSI_011444_E118.9_N31.4_20181012_L1A_HH_L10003515422.img' # fn1 = r'F:\MicroWorkspace\mico_datas\GF3A_nanjing\PIESAR\test11.bin' # data = ImageHandler().get_data(fn) diff --git a/surfaceRoughness_oh2004/SoilMoistureTool.py b/surfaceRoughness_oh2004/SoilMoistureTool.py index 0571763a..09a7fc7d 100644 --- a/surfaceRoughness_oh2004/SoilMoistureTool.py +++ b/surfaceRoughness_oh2004/SoilMoistureTool.py @@ -46,12 +46,12 @@ class SoilMoistureTool: atp.ahv_to_polsarpro_t3_soil(t3_path, tif_path) # Lee滤波 - # leeFilter = LeeRefinedFilterT3() - # lee_filter_path = os.path.join(self.__workspace_processing_path, - # 'lee_filter\\') - # - # leeFilter.api_lee_refined_filter_T3('', t3_path, lee_filter_path, 0, 0, atp.rows(), atp.cols()) - # logger.info("refine_lee filter success!") + leeFilter = LeeRefinedFilterT3() + lee_filter_path = os.path.join(self.__workspace_processing_path, + 'lee_filter\\') + + leeFilter.api_lee_refined_filter_T3('', t3_path, lee_filter_path, 0, 0, atp.rows(), atp.cols()) + logger.info("refine_lee filter success!") # logging.info("refine_lee filter success!") return t3_path diff --git a/vegetationHeight-L-SAR/VegetationHeightMain.py b/vegetationHeight-L-SAR/VegetationHeightMain.py index bb6dfb09..52898563 100644 --- a/vegetationHeight-L-SAR/VegetationHeightMain.py +++ b/vegetationHeight-L-SAR/VegetationHeightMain.py @@ -219,7 +219,7 @@ class VegetationHeightMain: para_dic.update({name: in_tif_path}) vv_flag = 1 elif 'IncidenceAngle' in os.path.basename(in_tif_path) or 'orth_sar_Angle' in os.path.basename(in_tif_path)\ - or "local_incidence" in os.path.basename(in_tif_path) or "orth_sar_incidence" in os.path.basename(in_tif_path): + or "inci_Angle-ortho" in os.path.basename(in_tif_path) or "orth_sar_incidence" in os.path.basename(in_tif_path): name = 'IncidenceAngle_' + para_name para_dic.update({name: in_tif_path}) angle_flag = 1 @@ -739,7 +739,7 @@ class VegetationHeightMain: lamda_01,height_01, width_01,lamda_02,height_02, width_02=self.calc_fe_kz() # self.force_del_file(self.__workspace_preprocessed_path) # 2、去地平效应 s2->flat_earth_removal->s2 - current_path = os.path.dirname(os.path.abspath(__file__)) + current_path = os.path.dirname(os.path.abspath(__file__)) # flat_earth_removal_master_slave_path = os.path.join(current_path, "flat_earth_removal_MasterSlave.exe") flat_earth_removal_master_slave_path = os.path.join(current_path, "flat_earth_removal_Slave.exe") master_fer =master_s2 ## self.__workspace_preprocessed2_path + "master_fer""\\" @@ -784,7 +784,7 @@ class VegetationHeightMain: coh_arrayt = AHVToPolSarProS2().read_none_complex_bin_to_array(t6_T11_bin) rows, cols=coh_arrayt.shape[0],coh_arrayt.shape[1] # 4、T6->boxcar_filter->T6 - logger.info('start computing the filter...') + logger.info('start computing the filter...') # 线性平滑滤波 boxcar_filter_tool_path = os.path.join(current_path, "boxcar_filter_T6.exe") # boxcar_filter_tool_path = os.path.join(current_path, "lee_refined_filter_T6.exe") master_slave_t6_box = self.__workspace_preprocessed2_path + "master_slave_t6_box""\\" @@ -795,7 +795,7 @@ class VegetationHeightMain: # master_slave_t6, *(3, 3, 0, 0)) logger.info("T6 lee_refined_filter finish") logger.info('progress bar :85%') - # 5、 T6->coherence_estimation->T6 + # 5、 T6->coherence_estimation->T6 相干度估计 coherence_estimation_path = os.path.join(current_path, "complex_coherence_estimation.exe") # coherence_opt_estimation_path = os.path.join(current_path, "complex_coherence_opt_estimation_T6.exe") master_slave_t6_box_coh = master_slave_t6_box @@ -852,11 +852,11 @@ class VegetationHeightMain: array =np.fromfile(bin_path,dtype=np.float32).reshape(height_01, width_01) #AHVToPolSarProS2().read_none_complex_bin_to_array(bin_path) # 对结果进行掩膜 ############# - if self.tif_angle_mask_path is None: - array = array - else: - roi_img = self.imageHandler.get_band_array(self.tif_angle_mask_path) - array = array * roi_img # 掩膜 + # if self.tif_angle_mask_path is None: + # array = array + # else: + # roi_img = self.imageHandler.get_band_array(self.tif_angle_mask_path) + # array = array * roi_img # 掩膜 #self.mask_m_angle_array[np.where(self.mask_m_angle_array!=0)]=1 #self.mask_a_angle_array[np.where(self.mask_a_angle_array!=0)]=1 #self.mask_m_angle_array[np.where(self.mask_m_angle_array==0)]=math.nan