Skip to content
Snippets Groups Projects
Commit 2db1abf6 authored by Gaëlle USSEGLIO's avatar Gaëlle USSEGLIO
Browse files

Merge branch 'robustify_sar_multislc' into 'master'

Robustify SAR_MultiSlc and SAR_MultiSlc_IW

See merge request !30
parents a4473bea 258e7ab8
No related branches found
No related tags found
1 merge request!30Robustify SAR_MultiSlc and SAR_MultiSlc_IW
...@@ -161,9 +161,9 @@ if __name__ == "__main__": ...@@ -161,9 +161,9 @@ if __name__ == "__main__":
fine_metadata_file = dict_Metadata_Correction['out']['fine_metadata_file'] fine_metadata_file = dict_Metadata_Correction['out']['fine_metadata_file']
# ====== DIn_SAR # ====== DIn_SAR
spacingxy = 0.0001 spacingxy = "0.0001"
if "Spacingxy" in dict_DInSAR['parameter']: if "Spacingxy" in dict_DInSAR['parameter']:
spacingxy = dict_DInSAR['parameter']['Spacingxy'] spacingxy = str(dict_DInSAR['parameter']['Spacingxy'])
roi = None roi = None
if 'roi' in dict_DInSAR['parameter']: if 'roi' in dict_DInSAR['parameter']:
roi = dict_DInSAR['parameter']['roi'] roi = dict_DInSAR['parameter']['roi']
...@@ -186,6 +186,12 @@ if __name__ == "__main__": ...@@ -186,6 +186,12 @@ if __name__ == "__main__":
func_utils.log(logging.CRITICAL, "Error, Wrong Threshold for fine deformation grid") func_utils.log(logging.CRITICAL, "Error, Wrong Threshold for fine deformation grid")
geoGrid_threshold = 0.3 geoGrid_threshold = 0.3
# ====== Check if interferogram is activated for ortho interferogram
if ortho_interferogram == "yes" and version_interferogram == "no":
func_utils.log(logging.CRITICAL, "Error, Impossible to have ortho interferogram without interferogram\n"
"If Ortho is required, please activate interferogram estimation in your json file")
quit()
# ====== Check if images exist # ====== Check if images exist
func_utils.check_ifExist(srtm_shapefile) func_utils.check_ifExist(srtm_shapefile)
func_utils.check_ifExist(hgts_path) func_utils.check_ifExist(hgts_path)
...@@ -474,7 +480,9 @@ if __name__ == "__main__": ...@@ -474,7 +480,9 @@ if __name__ == "__main__":
list_of_Grids, list_of_Interferogram = DInSar.gridToInterferogram(dem, master_Image, master_Image_base, slave_Image, slave_Image_base, master_data_dir, output_dir, param, 'Others', output_dir) list_of_Grids, list_of_Interferogram = DInSar.gridToInterferogram(dem, master_Image, master_Image_base, slave_Image, slave_Image_base, master_data_dir, output_dir, param, 'Others', output_dir)
interferogram_path = list_of_Interferogram[0] interferogram_path = ""
if version_interferogram == "yes":
interferogram_path = list_of_Interferogram[0]
grid_path = list_of_Grids[0] grid_path = list_of_Grids[0]
# ==================================== # # ==================================== #
...@@ -530,16 +538,16 @@ if __name__ == "__main__": ...@@ -530,16 +538,16 @@ if __name__ == "__main__":
interf_roi = "interferogram_roi.tif" interf_roi = "interferogram_roi.tif"
func_utils.extract_roi(os.path.join(output_dir, interf_ortho), os.path.join(output_dir, interf_roi), roi) func_utils.extract_roi(os.path.join(output_dir, interf_ortho), os.path.join(output_dir, interf_roi), roi)
func_utils.extract_band123(os.path.join(output_dir, interf_roi), os.path.join(output_dir, Interfero_roi)) func_utils.extract_band123(os.path.join(output_dir, interf_roi), os.path.join(output_dir, Interfero_roi))
if ortho_interferogram == "no" and roi is None: if version_interferogram == "yes" and ortho_interferogram == "no" and roi is None:
func_utils.extract_band123(interferogram_path, os.path.join(output_dir, InterferoB123)) func_utils.extract_band123(interferogram_path, os.path.join(output_dir, InterferoB123))
# ==================================== # # ==================================== #
# Removing # # Removing #
# files # # files #
# ============================== # # ============================== #
if version_interferogram == "yes":
func_utils.silentremove(os.path.dirname(interferogram_path), os.path.basename(interferogram_path)) func_utils.silentremove(os.path.dirname(interferogram_path), os.path.basename(interferogram_path))
func_utils.silentremove(os.path.dirname(interferogram_path), os.path.basename(interferogram_path).split(".")[0]+".geom") func_utils.silentremove(os.path.dirname(interferogram_path), os.path.basename(interferogram_path).split(".")[0]+".geom")
if ortho_interferogram == "yes": if ortho_interferogram == "yes":
interferogram_ortho = "interferogram_ortho.tif" interferogram_ortho = "interferogram_ortho.tif"
func_utils.silentremove(output_dir, interferogram_ortho) func_utils.silentremove(output_dir, interferogram_ortho)
......
...@@ -155,9 +155,9 @@ if __name__ == "__main__": ...@@ -155,9 +155,9 @@ if __name__ == "__main__":
if roi: if roi:
ortho_interferogram = "yes" ortho_interferogram = "yes"
print("ortho_interferogram", ortho_interferogram) print("ortho_interferogram", ortho_interferogram)
spacingxy = 0.0001 spacingxy = '0.0001'
if "Spacingxy" in dict_DInSAR['parameter']: if "Spacingxy" in dict_DInSAR['parameter']:
spacingxy = dict_DInSAR['parameter']['Spacingxy'] spacingxy = str(dict_DInSAR['parameter']['Spacingxy'])
geoGrid_gridstep_range = dict_DInSAR['parameter']['GridStep_range'] geoGrid_gridstep_range = dict_DInSAR['parameter']['GridStep_range']
geoGrid_gridstep_azimut = dict_DInSAR['parameter']['GridStep_azimut'] geoGrid_gridstep_azimut = dict_DInSAR['parameter']['GridStep_azimut']
geoGrid_threshold = dict_DInSAR['parameter']['Grid_Threshold'] geoGrid_threshold = dict_DInSAR['parameter']['Grid_Threshold']
...@@ -178,6 +178,12 @@ if __name__ == "__main__": ...@@ -178,6 +178,12 @@ if __name__ == "__main__":
esd_AutoMode = True esd_AutoMode = True
esd_NbIter = 10 # 10 iterations maximum for automatic mode esd_NbIter = 10 # 10 iterations maximum for automatic mode
# ====== Check if interferogram is activated for ortho interferogram
if ortho_interferogram == "yes" and version_interferogram == "no":
func_utils.log(logging.CRITICAL, "Error, Impossible to have ortho interferogram without interferogram\n"
"If Ortho is required, please activate interferogram estimation in your json file")
quit()
# ====== Check Threshold # ====== Check Threshold
if (geoGrid_threshold < 0) or (geoGrid_threshold > 1) : if (geoGrid_threshold < 0) or (geoGrid_threshold > 1) :
func_utils.log(logging.CRITICAL, "Error, Wrong Threshold for fine deformation grid") func_utils.log(logging.CRITICAL, "Error, Wrong Threshold for fine deformation grid")
......
...@@ -377,7 +377,7 @@ def build_virutal_raster(master_Image, start_time, end_time, master_date, ...@@ -377,7 +377,7 @@ def build_virutal_raster(master_Image, start_time, end_time, master_date,
hgts = check_srtm_coverage(master_footprint, srtm_shapefile) hgts = check_srtm_coverage(master_footprint, srtm_shapefile)
hgts_tuple = [] hgts_tuple = []
for hgt in hgts: for hgt in hgts:
hgts_tuple.append(hgts_path + hgt) hgts_tuple.append(os.path.join(hgts_path, hgt))
print("\n Creating virtual raster from intersected hgt files...\n") print("\n Creating virtual raster from intersected hgt files...\n")
dem = gdal.BuildVRT("{}/output_{}_to_{}_m_{}/dem_scene.vrt".format( dem = gdal.BuildVRT("{}/output_{}_to_{}_m_{}/dem_scene.vrt".format(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment