diff --git a/python_src/SAR_MultiSlc.py b/python_src/SAR_MultiSlc.py index 891372296b77f8d89a7fdb88e3470763d7fa8fd8..1a0a27114f83cd2867130498fe2e9f5a96ec60e1 100644 --- a/python_src/SAR_MultiSlc.py +++ b/python_src/SAR_MultiSlc.py @@ -186,6 +186,12 @@ if __name__ == "__main__": func_utils.log(logging.CRITICAL, "Error, Wrong Threshold for fine deformation grid") 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 func_utils.check_ifExist(srtm_shapefile) func_utils.check_ifExist(hgts_path) @@ -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) - interferogram_path = list_of_Interferogram[0] + interferogram_path = "" + if version_interferogram == "yes": + interferogram_path = list_of_Interferogram[0] grid_path = list_of_Grids[0] # ==================================== # @@ -530,16 +538,16 @@ if __name__ == "__main__": 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_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)) # ==================================== # # Removing # # files # # ============================== # - - 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") + 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).split(".")[0]+".geom") if ortho_interferogram == "yes": interferogram_ortho = "interferogram_ortho.tif" func_utils.silentremove(output_dir, interferogram_ortho) diff --git a/python_src/SAR_MultiSlc_IW.py b/python_src/SAR_MultiSlc_IW.py index 68b73c0bdaad3f643324cf6756beaee69936ab74..fee8b494dd02ac5d03456a6794c063f22534cdc0 100644 --- a/python_src/SAR_MultiSlc_IW.py +++ b/python_src/SAR_MultiSlc_IW.py @@ -178,6 +178,12 @@ if __name__ == "__main__": esd_AutoMode = True 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 if (geoGrid_threshold < 0) or (geoGrid_threshold > 1) : func_utils.log(logging.CRITICAL, "Error, Wrong Threshold for fine deformation grid")