From df8dc9472e0882fc33787bb0f2d1658723419240 Mon Sep 17 00:00:00 2001
From: tian jiax <446100073@qq.com>
Date: Sat, 9 Nov 2024 09:54:17 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E6=B0=94=E5=BB=B6=E8=BF=9F=E6=A0=A1?=
=?UTF-8?q?=E6=AD=A3=E6=96=B0=E5=A2=9E=E5=A4=84=E7=90=86=E5=85=A8=E6=99=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
atmosphericDelay-C-SAR/AtmosphericDelay.xml | 2 +-
.../AtmosphericDelayMain.py | 133 ++++++++++++------
dem-C-SAR/geocoding.py | 2 +-
tool/algorithm/transforml1a/transHandle.py | 33 +----
4 files changed, 97 insertions(+), 73 deletions(-)
diff --git a/atmosphericDelay-C-SAR/AtmosphericDelay.xml b/atmosphericDelay-C-SAR/AtmosphericDelay.xml
index ee147036..c8ae33cb 100644
--- a/atmosphericDelay-C-SAR/AtmosphericDelay.xml
+++ b/atmosphericDelay-C-SAR/AtmosphericDelay.xml
@@ -125,7 +125,7 @@
Value
string
Man
- 34.64;34.67;113.15;113.18
+ empty
True
True
UploadInput
diff --git a/atmosphericDelay-C-SAR/AtmosphericDelayMain.py b/atmosphericDelay-C-SAR/AtmosphericDelayMain.py
index e1fe7ebe..9ef6caa5 100644
--- a/atmosphericDelay-C-SAR/AtmosphericDelayMain.py
+++ b/atmosphericDelay-C-SAR/AtmosphericDelayMain.py
@@ -263,12 +263,15 @@ class AtmosphericMain:
self.aux_key_word = key_word
self.input_paras.update({"AuxiliarySarData": pa})
if name == 'box':
- datas = para['ParaValue'].split(';')
- if len(datas) != 4:
- 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 para['ParaValue'] == 'empty':
+ processing_paras.update({'box': 'empty'})
+ else:
+ datas = para['ParaValue'].split(';')
+ if len(datas) != 4:
+ 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})
return processing_paras
def verifyAndModifyWgsXml(self, xmlPath, demPath):
@@ -1056,7 +1059,7 @@ class AtmosphericMain:
dem_dir = r"/".join(self.__processing_paras['DEM'].split("\\"))
isce_work_space = r"/".join(self.__workspace_isce_path.split("\\"))
isce_work_space = '/cygdrive/' + isce_work_space.replace(":/", "/")
- box = "'" + self.__processing_paras['box'] + "'"
+
isce_exe_dir = r"/".join(os.path.join(self.env_str, "ISCEApp").split("\\"))
target = isce_work_space
@@ -1100,31 +1103,57 @@ class AtmosphericMain:
logger.info('cmd_result:{}'.format(result))
logger.info('slc to isce_data finish!')
logger.info('progress bar: 10%')
+ if self.__processing_paras['box'] == 'empty':
- cmd = "stackStripMap.exe -s {} -w {} -d {} -m {} -a {} -r {} -x {} -u 'snaphu' --nofocus".format(out_slc_dir,
- isce_work_space,
- dem_path,
- self.aux_key_word, 3, 3,
- box)
+ cmd = "stackStripMap.exe -s {} -w {} -d {} -m {} -a {} -r {} -u 'snaphu' --nofocus".format(
+ out_slc_dir,
+ isce_work_space,
+ dem_path,
+ self.aux_key_word, 10, 10)
+
+ logger.info('stackStripMap_cmd:{}'.format(cmd))
+ result = os.system(cmd)
+ logger.info('cmd_result:{}'.format(result))
+ 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)
+ logger.info('aux slc stackStripMap finish!')
+
+ # 1.2 执行autorun.py 生成干涉图
+ run_steps = ["run_02_focus_split",
+ "run_03_geo2rdr_coarseResamp",
+ "run_04_refineSecondaryTiming",
+ "run_05_invertMisreg",
+ "run_06_fineResamp",
+ "run_07_grid_baseline",
+ "run_08_igram"]
+ self.isce_run_steps(run_steps, self.__workspace_isce_path)
+ else:
+ box = "'" + self.__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,
+ self.aux_key_word, 10, 10,
+ box)
- logger.info('stackStripMap_cmd:{}'.format(cmd))
- result = os.system(cmd)
- logger.info('cmd_result:{}'.format(result))
- 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)
- logger.info('aux slc stackStripMap finish!')
+ logger.info('stackStripMap_cmd:{}'.format(cmd))
+ result = os.system(cmd)
+ logger.info('cmd_result:{}'.format(result))
+ 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)
+ logger.info('aux slc stackStripMap finish!')
- # 1.2 执行autorun.py 生成干涉图
- run_steps = ["run_03_focus_split",
- "run_04_geo2rdr_coarseResamp",
- "run_05_refineSecondaryTiming",
- "run_06_invertMisreg",
- "run_07_fineResamp",
- "run_08_grid_baseline",
- "run_09_igram"]
- self.isce_run_steps(run_steps, self.__workspace_isce_path)
+ # 1.2 执行autorun.py 生成干涉图
+ run_steps = ["run_03_focus_split",
+ "run_04_geo2rdr_coarseResamp",
+ "run_05_refineSecondaryTiming",
+ "run_06_invertMisreg",
+ "run_07_fineResamp",
+ "run_08_grid_baseline",
+ "run_09_igram"]
+ self.isce_run_steps(run_steps, self.__workspace_isce_path)
cmd = ['-e', isce_exe_dir, '-o', self.__workspace_isce_path]
logger.info('autorun_cmd:{}'.format(cmd))
@@ -1147,20 +1176,42 @@ class AtmosphericMain:
# 二、 主影像
# 2.1 执行stackSentinel.exe 生成运行配置文件 #
# key_word = "20190113"
- cmd = "stackStripMap.exe -s {} -w {} -d {} -m {} -a {} -r {} -x {} -u 'snaphu' --nofocus".format(out_slc_dir,
- isce_work_space,
- dem_path,
- self.mas_key_word,
- 3, 3,
- box)
+ if self.__processing_paras['box'] == 'empty':
- logger.info('stackStripMap_cmd:{}'.format(cmd))
- result = os.system(cmd)
- logger.info('cmd_result:{}'.format(result))
- 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)
- logger.info('mas slc stackStripMap finish!')
+ cmd = "stackStripMap.exe -s {} -w {} -d {} -m {} -a {} -r {} -u 'snaphu' --nofocus".format(
+ out_slc_dir,
+ isce_work_space,
+ dem_path,
+ self.mas_key_word,
+ 10, 10)
+
+ logger.info('stackStripMap_cmd:{}'.format(cmd))
+ result = os.system(cmd)
+ logger.info('cmd_result:{}'.format(result))
+ 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)
+ logger.info('mas slc stackStripMap finish!')
+ run_steps = ["run_07_grid_baseline"]
+ self.isce_run_steps(run_steps, self.__workspace_isce_path)
+ else:
+ box = "'" + self.__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,
+ self.mas_key_word,
+ 10, 10,
+ box)
+
+ logger.info('stackStripMap_cmd:{}'.format(cmd))
+ result = os.system(cmd)
+ logger.info('cmd_result:{}'.format(result))
+ 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)
+ logger.info('mas slc stackStripMap finish!')
+ run_steps = ["run_08_grid_baseline"]
+ self.isce_run_steps(run_steps, self.__workspace_isce_path)
# 2.2 执行autorun.py生成干涉图
cmd = ['-e', isce_exe_dir, '-o', self.__workspace_isce_path]
diff --git a/dem-C-SAR/geocoding.py b/dem-C-SAR/geocoding.py
index bd0f53f3..0b42bf61 100644
--- a/dem-C-SAR/geocoding.py
+++ b/dem-C-SAR/geocoding.py
@@ -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]<=2 ####################################################################################
+ dist_mask=dist[:,3]<=1 ####################################################################################
idx=np.where(dist_mask==1)
ind=ind[idx,:][0,:,:]
dist=dist[idx,:][0,:,:]
diff --git a/tool/algorithm/transforml1a/transHandle.py b/tool/algorithm/transforml1a/transHandle.py
index dfa5f827..d7e8542c 100644
--- a/tool/algorithm/transforml1a/transHandle.py
+++ b/tool/algorithm/transforml1a/transHandle.py
@@ -1060,38 +1060,11 @@ class TransImgL1A_ori:
if __name__ == '__main__':
- # ori_sim_path = r"I:\坐标转换\坐标转换接口\L1A数据(l1a_img_path数据)\RPC_ori_sim.tif"
- # roi_Extend = [[120.53, 31.5], [120.61, 31.5], [120.61, 31.45], [120.53, 31.45]]
- # conver_path = r"I:\坐标转换\坐标转换接口\裁剪后辅助数据(geo_img_path数据)\Covering_cut.tif"
- # ndvi_path = r"I:\坐标转换\坐标转换接口\裁剪后辅助数据(geo_img_path数据)\NDVI_cut.tif"
- # out_path = r"I:\坐标转换\SAR2GEO\test"
- #
- # tr = TransImgL1A(ori_sim_path,roi_Extend)
- # tr.l1a_2_geo("I:/cut.tif", "I:/salinity.tif", "I:/salinity_geo2.tif")
- ori_sim = r"D:\micro\LWork\AtmosphericDelay\Temporary\cut\ori_sim.tif"
- product_tif = r"D:\micro\LWork\AtmosphericDelay\Temporary\apsWork\master_ztd\dlosout.tiff"
- result = r"D:\micro\LWork\AtmosphericDelay\Temporary\apsWork\master_ztd\dlosout_geo.tiff"
+ ori_sim = r"D:\micro\LWork\Dem-1\Temporary\processing\temp\ori_sim.tif"
+ product_tif = r"D:\micro\LWork\Dem-1\Temporary\processing\temp\master_ztd\dlosout.tiff"
+ result = r'D:\micro\LWork\Dem-1\Temporary\processing\temp\dlosout-geo.tif'
method = 'linear'
scopes = ImageHandle.ImageHandler().get_scopes(ori_sim)
- # """
- # 31.14;31.50;120.34;120.75
- # """
- # # roi_Extend = [[102.12, 33.879], [102.327, 33.879], [102.327, 33.66], [102.12, 31.45]]
- # ori_sim_data = ImageHandle.ImageHandler.get_data(ori_sim)
- # lon = ori_sim_data[0, :, :]
- # lat = ori_sim_data[1, :, :]
- # min_lon = np.nanmin(lon)
- # max_lon = np.nanmax(lon)
- # min_lat = np.nanmin(lat)
- # max_lat = np.nanmax(lat)
- # print(np.nanmin(lon))
- # print(np.nanmax(lon))
- # print(np.nanmin(lat))
- # print(np.nanmax(lat))
- #
- # # roi_Extend = [[min_lon, max_lat], [max_lon, max_lat], [min_lon, min_lat], [max_lon, min_lat]]
- # roi_Extend = [[116.17328, 43.727577], [116.652504, 43.727577], [116.652504, 44.119164], [116.17328, 44.119164]]
- # # roi_Extend = [[108.51960117899473, 38.192443138079895], [109.62308480328566, 38.192443138079895], [109.62308480328566, 37.69300142375064], [108.51960117899473, 37.69300142375064]]
tr = TransImgL1A_ori(ori_sim, scopes)
tr.l1a_2_geo(ori_sim, product_tif, result, method)